GNU cfengine
3.2 Special variables
Variables are referred to in either of two different ways, depending on
your taste. You can use the forms $(variable) or
${variable}. The variable in braces or parentheses can be the
name of any user defined macro, environment variable or one of the
following special internal variables.
AllClasses
- A long string in the form `CFALLCLASSES=class1:class2...'. This
variable is a summary of all the defined classes at any given time. It
is always kept up to date so that scripts can make use of cfengine's
class data.
arch
- The current detailed architecture string--an amalgamation of the
information from uname. Non-definable.
binserver
- The default server for binary data.
Non definable.
ChecksumDatabase
- If set to the name of a file, cfagent will use this to store checksums of important
files, and give `tripwire functionality', See section 3.8.7 ChecksumDatabase.
ChecksumUpdates
- If set to `on', security information is automatically updated, See section 3.8.8 ChecksumUpdates.
class
- The currently defined system hard-class (e.g.
sun4, hpux).
Non-definable.
date
- The current date string. Note that if you use this in a shell command it might
be interpreted as a list variable, since it contains the default separator
`:'.
domain
- The currently defined domain.
faculty
- The faculty or site as defined in control (see site).
fqhost
- The fully qualified (DNS/BIND) hostname of the system, which
includes the domain name as well.
host
- The hostname of the machine running the program.
ipaddress
- The numerical form of the internet address of the host currently running
cfengine.
MaxCfengines
- The maximum number of cfengines which should be allowed to
co-exist concurrently on the system. This can prevent excessive
load due to unintentional spamming in situations where several
cfengines are started independently. The default value is unlimited.
ostype
- A short for of
$(arch).
OutputPrefix
- This quoted string can be used to change the default `cfengine:'
prefix on output lines to something else. You might wish to shorten
the string, or have a different prefix for different hosts. The value
in this variable is appended with the name of the host. The default is
equivalent to,
| | OutputPrefix = ( "cfengine:$(host):")
|
RepChar
- The character value of the string used by the file repository in
constructing unique filenames from path names. This is the character which
replaces `/' (see the reference manual).
site
- This variable is identical to
$(faculty) and may be used interchangeably.
split
- The character on which list variables are split (see the reference manual).
sysadm
- The name or mail address of the system administrator.
timezone
- The current timezone as defined in
control.
UnderscoreClasses
- If this is set to `on' cfengine uses hard-classes which begin with
an underscore, so as to avoid name collisions. See also Runtime Options in the
Reference manual.
year
- The current year.
These variables are kept special because they play a special role in
setting up a system configuration.
You are encouraged to use them to define fully
generalized rules in your programs. Variables can be used to advantage
in defining filenames, directory names and in passing arguments to shell
commands. The judicious use of variables can reduce many definitions to
a single one if you plan carefully.
NOTE: the above control variables are not case sensitive, unlike
user macros, so you should not define your own macros with these names.
The following variables are also reserved and may be used to produce
troublesome special characters in strings.
cr
- Expands to the carriage-return character.
dblquote
- Expands to a double quote
"
dollar
- Expands to `$'.
lf
- Expands to a line-feed character (Unix end of line).
n
- Expands to a newline character.
quote
- Expands to a single quote
'.
spc
- Expands simply to a single space. This can be used to place spaces in
filenames etc.
tab
- Expands to a single tab character.