CFENGINE 3.0.0-training SYNTAX

Promise datatype legend

  1. string
  2. int
  3. real
  4. slist
  5. ilist
  6. rlist
  7. (option)
  8. (option list)
  9. (ext body)
  10. class
  11. clist
  12. irange [int,int]
  13. rrange [real,real]

Bundle types (software components)

  • COMPONENT common
  • Promise types for common bundles

    • PROMISE TYPE vars

      stringstring(arbitrary string)
      intint-9999999,999999
      realreal-9.99999E100,9.99999E100
      slistslist(arbitrary string)
      ilistilist-9999999,999999
      rlistrlist-9.99999E100,9.99999E100
      policy(option)free,overridable,constant
  • COMPONENT agent
  • Promise types for agent bundles

    • PROMISE TYPE vars

      stringstring(arbitrary string)
      intint-9999999,999999
      realreal-9.99999E100,9.99999E100
      slistslist(arbitrary string)
      ilistilist-9999999,999999
      rlistrlist-9.99999E100,9.99999E100
      policy(option)free,overridable,constant
    • PROMISE TYPE files

      file_select(ext body)
      nameslist(arbitrary string)
      pathslist/.*
      modestring(arbitrary string)
      sizeirange [int,int](arbitrary string)
      ownerslist(arbitrary string)
      groupslist(arbitrary string)
      ctimeirange [int,int]0,4026531839
      mtimeirange [int,int]0,4026531839
      atimeirange [int,int]0,4026531839
      exec_regexstring(arbitrary string)
      filetypes(option list)reg,link,dir,socket,fifo,door,char,block
      issymlinktoslist(arbitrary string)
      filetypestring[(plain|
      link|
      dir|
      socket|
      fifo|
      door|
      char|
      block)[|
      ]*]*
      resultstring[(name|
      path|
      filetype|
      mode|
      size|
      owner|
      group|
      atime|
      ctime|
      mtime|
      issymlinkto|
      exec_regex)[|
      &!.]*]*
      copyfrom(ext body)
      sourcestring(arbitrary string)
      serversslist(arbitrary string)
      actionstring(arbitrary string)
      backupstring(arbitrary string)
      repositorystring/.*
      stealth(option)true,false,yes,no,on,off
      preserve(option)true,false,yes,no,on,off
      linkpatternstring(arbitrary string)
      xdev(option)true,false,yes,no,on,off
      compare(option)atime,mtime,ctime,checksum
      linktype(option)absolute,relative,hard
      typecheck(option)true,false,yes,no,on,off
      forceupdate(option)true,false,yes,no,on,off
      forcedirs(option)true,false,yes,no,on,off
      forceipv4(option)true,false,yes,no,on,off
      sizeint0,inf
      triggerslist(arbitrary string)
      trustkey(option)true,false,yes,no,on,off
      encrypt(option)true,false,yes,no,on,off
      verify(option)true,false,yes,no,on,off
      purge(option)true,false,yes,no,on,off
      findertype(option)MacOSX
      linkto(ext body)
      link_type(option)symbolic,absolute,abs,hard,relative,rel
      copy_patternsstring(arbitrary string)
      deadlinks(option)kill,force
      when_no_file(option)force,kill
      access(ext body)
      modestring[0-7ugorwx,+-]*
      ownerslist.*
      groupslist.*
      changes(ext body)
      hash(option)md5,sha1
      update(option)true,false,yes,no,on,off
      tidy(ext body)
      ageirange [int,int]0,inf
      sizeirange [int,int]0,inf
      age_type(option)mtime,ctime,mtime,atime
      dirlinks(option)delete,keep,tidy
      rmdirs(option)yes,no,true,false,sub
      links(option)stop,keep,traverse,tidy
      rename(ext body)
      newnamestringfilename
      type(option)plain,file,link
      rotateint0,99
      sizeirange [int,int]0,inf
      repositorystring/.*
      edit_line(ext body)(Separate Bundle)
      edit_xml(ext body)(Separate Bundle)
      acl(ext body)
      recurseint0,inf
    • PROMISE TYPE executables

      argsstring(arbitrary string)
      containment(ext body)
      useshell(option)true,false,yes,no,on,off
      umaskint0,77
      ownerslist(arbitrary string)
      groupslist(arbitrary string)
      chdirstring/.*
      chrootslist/.*
      module(option)true,false,yes,no,on,off
      timeoutint1,3600
      background(option)true,false,yes,no,on,off
    • PROMISE TYPE processes

      signals(option list)hup,int,trap,kill,pipe,cont,abrt,stop,quit,term,child,usr1,usr2,bus,segv
      number(ext body)
      match_rangeirange [int,int](arbitrary string)
      in_range_defineslist(arbitrary string)
      out_of_range_defineslist(arbitrary string)
      process_select(ext body)
      ownerslist(arbitrary string)
      pidstring(arbitrary string)
      ppidstring(arbitrary string)
      pgidstring(arbitrary string)
      rsizestring(arbitrary string)
      vsizestring(arbitrary string)
      statusstring(arbitrary string)
      ttime_rangestring(arbitrary string)
      stime_rangestring(arbitrary string)
      commandstring(arbitrary string)
      ttystring(arbitrary string)
      prioritystring(arbitrary string)
      threadsstring(arbitrary string)
      result(option)owner,pid,ppid,pgid,rsize,vsize,status,command,ttime,stime,tty,priority,threads
      restartstring[a-zA-Z0-9_]+
  • COMPONENT server
  • Promise types for server bundles

    • PROMISE TYPE vars

      stringstring(arbitrary string)
      intint-9999999,999999
      realreal-9.99999E100,9.99999E100
      slistslist(arbitrary string)
      ilistilist-9999999,999999
      rlistrlist-9.99999E100,9.99999E100
      policy(option)free,overridable,constant
    • PROMISE TYPE access

      admitslist(arbitrary string)
      denyslist(arbitrary string)
  • COMPONENT monitor
  • Promise types for monitor bundles

    • PROMISE TYPE vars

      stringstring(arbitrary string)
      intint-9999999,999999
      realreal-9.99999E100,9.99999E100
      slistslist(arbitrary string)
      ilistilist-9999999,999999
      rlistrlist-9.99999E100,9.99999E100
      policy(option)free,overridable,constant

builtin functions

Return typeFunction nameArguments
intrandomint()2 args expected
intgetuid()1 args expected
intgetgid()1 args expected
stringexecresult()2 args expected
stringreadtcp()4 args expected
classreturnszero()2 args expected
classisnewerthan()2 args expected
classaccessedbefore()2 args expected
classchangedbefore()2 args expected
classfileexists()1 args expected
classisdir()1 args expected
classislink()1 args expected
classisplain()1 args expected
classiprange()1 args expected
classhostrange()2 args expected
classisvariable()1 args expected
classstrcmp()2 args expected
classregcmp()2 args expected
classisgreaterthan()2 args expected
classislessthan()2 args expected
classuserexists()1 args expected
classgroupexists()1 args expected
slistreadstringlist()4 args expected
ilistreadintlist()4 args expected
rlistreadreallist()4 args expected
irange [int,int]irange()2 args expected
rrange [real,real]rrange()2 args expected
intondate()6 args expected
intago()6 args expected
intnow()0 args expected
classpersiststate()3 args expected
classerasestate()1 args expected