NAME
cfengine-tags - Generate tags files for Cfengine
SYNOPSIS
cfengine-tags [--config /etc/rack.conf] [--tags tag1,tag2,...] [type]
cfengine-tags { --help | --man | --version }
OPTIONS
Standard options
- -c, --config path
-
Specify the path to the configuration file. Default to /usr/local/etc/rack.conf
- -O, --path, --output-path path
-
Specify the path where to write the tags files. This option overrides the
[cfengine-tags]/pathconfig parameter. - -v, --verbose
-
Run the program in verbose mode.
Program options
-
Specify a comma-separated list of tags to process. This option overrides the
[cfengine-tags]/tagsconfig parameter. - -A, --attrs list of attributes
-
Specify a comma-separated list of attributes, which values will be used as tag names. This option overrides the
[cfengine-tags]/attrsconfig parameter. - -F, --filter list of tokens
-
Specify a comma-separated list of tokens, defining tags and attribute values. This option overrides the
[cfengine-tags]/filterconfig parameter. See the corresponding documentation for more details. - -N, --class-names
-
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.
Help options
- -h, --help
-
Print a short usage description, then exit.
- --man
-
Print the manual page of the program, then exit.
- -V, --version
-
Print the program name and version, then exit.
DESCRIPTION
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.
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.
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.
CONFIGURATION
cfengine-tags(1)'s configuration is stored in rack(1)'s configuration, with the following additional definitions.
Section [cfengine-tags]
path- specify the path where to write the tags files; will be overridden by the--output-pathoptiontype- specify the default type if none is given to the command; default to"server".tags- specify the defaults tags as a comma-separated list; will be overridden by the--tagsoptionattrs- specify some attributes, as a comma-separated list, which values will be used as tag names; will be overridden by the--attrsoptionfilter- specify a comma-separated list of tokens, defining tags and attribute values; will be overridden by the--filteroption.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.
The sub-syntax of the tokens is:
a token in the form
tag:namedefines the tag with the given namea token in the form
attr=valuedefines the pair (attribute, value)
Examples:
only keep the devices with the tags
genericandinfra(no attribute filtering):tag:generic, tag:infraonly keep the devices with the attribute
Useset toprodorpreprod(no tag filtering):Use=prod, Use=preprodonly keep the devices with the tag
cfengineand the attributeUseset toprodorpreprod:tag:cfengine, Use=prod, Use=preprod
AUTHOR
Sebastien Aperghis-Tramoni (sebastien@aperghis.net)