cfengine-tags - Generate tags files for Cfengine
cfengine-tags [--config /etc/rack.conf] [--tags tag1,tag2,...] [type] cfengine-tags { --help | --man | --version }
Specify the path to the configuration file. Default to /usr/local/etc/rack.conf
Specify the path where to write the tags files. This option overrides the [cfengine-tags]/path config parameter.
[cfengine-tags]/path
Run the program in verbose mode.
Specify a comma-separated list of tags to process. This option overrides the [cfengine-tags]/tags config parameter.
[cfengine-tags]/tags
Specify a comma-separated list of attributes, which values will be used as tag names. This option overrides the [cfengine-tags]/attrs config parameter.
[cfengine-tags]/attrs
Specify a comma-separated list of tokens, defining tags and attribute values. This option overrides the [cfengine-tags]/filter config parameter. See the corresponding documentation for more details.
[cfengine-tags]/filter
Request to mogrify the host names so they are valid Cfengine class names. This was the default behaviour for versions of this program older than 1.06. This option is now needed to enable this behaviour.
Print a short usage description, then exit.
Print the manual page of the program, then exit.
Print the program name and version, then exit.
This program generate a bunch of definition files for Cfengine, one for each RackTables tag, containing the names of the devices with that tag.
The list of tags to process can be given by the [cfengine-tags]/tags config parameter or the --tags option. If no explicit list is provided, process all the tags attached to the devices.
--tags
In a similar way, a list of attributes can be given with the [cfengine-tags]/attrs config parameter or the --attrs option. The value of these attributes will be mogrified to generate additional tags.
--attrs
A filter can be given, either by the [cfengine-tags]/filter config parameter or the --filter option, to filter the result devices list: only the devices with any of the given tags or attribute name-value pairs will be included. A lack of tag or attribute definition disables the filtering of that type.
--filter
cfengine-tags(1)'s configuration is stored in rack(1)'s configuration, with the following additional definitions.
path - specify the path where to write the tags files; will be overridden by the --output-path option
path
--output-path
type - specify the default type if none is given to the command; default to "server".
type
"server"
tags - specify the defaults tags as a comma-separated list; will be overridden by the --tags option
tags
attrs - specify some attributes, as a comma-separated list, which values will be used as tag names; will be overridden by the --attrs option
attrs
filter - specify a filter; will be overridden by the --filter option. See "FILTER SYNTAX" for details and examples.
filter
When defined, only the devices with the matching tags and attributes will be included in the resulting lists. When no tag or attribute pair is defined, the filtering fot that particular type is disabled.
A filter is a comma-separated list of tokens, defining tags and attribute values used as criteria to determine which device to keep. The general syntax is:
token, token, ...
with no arbitrary limits on the number of tokens. The syntax of a token works like this:
a token in the form tag:name defines the tag with the given name
tag:name
a token in the form attr=value defines the pair (attribute, value)
attr=value
only keep the devices with the tags generic and infra (no attribute filtering):
generic
infra
tag:generic, tag:infra
only keep the devices with the attribute Use set to prod or preprod (no tag filtering):
Use
prod
preprod
Use=prod, Use=preprod
only keep the devices with the tag cfengine and the attribute Use set to prod or preprod:
cfengine
tag:cfengine, Use=prod, Use=preprod
Sebastien Aperghis-Tramoni (sebastien@aperghis.net)
To install RackMan, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RackMan
CPAN shell
perl -MCPAN -e shell install RackMan
For more information on module installation, please visit the detailed CPAN module installation guide.