It all begins with the global parser
The global parser, which I discussed in previous chapters, creates
cfrun atoms. The
atoms are a single configuration line (for example, "add this user")
with the attached section and class-conditional execution. For
instance, "add user" would be in the "users" section, and perhaps it's
only for the "linux" classes.
cfrun() function executes these
cfrun atoms. Before the functional atoms are executed, however,
cfrun() needs to process the
group statements. In a future version of cfperl, the imports may be done
conditionally, as in cfengine. In this version, imports are
See the sample configuration cftest.conf in the cfperl CVS repository or the cfengine sample configuration (both in the Resources
section) for an example of how imports work on the user side. In
cfperl, imports are processed by the top-level parser with the
load_file() function. Imports need to be executed first to simplify the program flow.
The control and groups sections are processed after imports but before user-side functionality atoms. The
control: cfengine section defines the
actionsequence and user-defined classes, for example. The
actionsequence declares what the order of cfengine/cfperl sections will be. Cfperl implements the
actionsequence with the
cfqueue atoms, which are inserted in an array called
groups section is necessary in order to declare the classes that cfengine/cfperl will interpret for conditional execution later.
dispatch() function takes a
cfrun atom and dispatches it to the appropriate secondary parser. I'll explain the
group section secondary parser and the empty default secondary parser later in this chapter.