Multiple Control Sections
From Cfwiki
Request for comments: Someone has requested additional comments to this article. For more information about what the proposer is unclear with, check the text below this box.
What exactly are multiple control sections good for? Any examples? What are the pros or cons? Will the time needed for parsing the config increase?
Note: Please have a look into the discussion about this comment.
This code snippet shows how multiple control sections can be used in the same file.
control:
actionsequence = ( shellcommands )
var1 = ( "foo" )
groups:
group1 = ( any )
control:
group1::
var2 = ( "bar" )
shellcommands:
any::
"/bin/echo $(var1)"
group1::
"/bin/echo $(var2)"
Here is the output from the command:
********************************************************************* Main Tree Sched: shellcommands pass 1 @ Fri Sep 24 08:51:32 2004 ********************************************************************* cfengine:: Executing script /bin/echo foo...(timeout=0,uid=-1,gid=-1) (Setting umask to 77) cfengine::/bin/echo foo: foo cfengine:: Finished script /bin/echo foo cfengine:: Executing script /bin/echo bar...(timeout=0,uid=-1,gid=-1) (Setting umask to 77) cfengine::/bin/echo bar: bar cfengine:: Finished script /bin/echo bar
You will notice the output echos both "foo" and "bar", which means the section control was parsed and set $(var2).
