.. -*- mode: rst -*-
.. NOTE: these are relative links (change when directory structure
.. changes)
.. _Base: plugins/structures/base
.. _Bundler: plugins/structures/bundler
.. _Cfg: plugins/generators/cfg.html
.. _TGenshi: plugins/generators/tgenshi
.. _TCheetah: plugins/generators/tcheetah.html
.. _Rules: plugins/generators/rules.html
.. _server-configurationentries:
=====================
Configuration Entries
=====================
This page describes the names and semantics of each of the configuration
entries used by Bcfg2.
Non-POSIX entries
=================
+-------------+---------------------+-----------------------------+
| TagName | Description | Attributes |
+=============+=====================+=============================+
| Action | Command | name, command, when, timing |
+-------------+---------------------+-----------------------------+
| Package | Software Packages | name, type, version, url |
+-------------+---------------------+-----------------------------+
| PostInstall | PostInstall command | name |
+-------------+---------------------+-----------------------------+
| Service | System Services | name, type, status, target |
+-------------+---------------------+-----------------------------+
POSIX entries
=============
.. versionadded:: 1.0.0
The unified POSIX Path entries prevent inconsistent configuration
specifications of multiple entries for a given path. The following table
describes the various types available for new **Path** entries.
The abstract specification of these entries (i.e. In `Bundler`_)
will only contain a *name* attribute. The type will be added by the
plugin that handles the entry in the case of `Cfg`_, `TGenshi`_, or
`TCheetah`_. If the entry is handled by the `Rules`_ plugin (i.e. it is
a device, directory, hardlink, symlink, etc), then you will specify both
the *type* and any other necessary attributes in `Rules`_.
Running ``bcfg2-lint`` will check your configuration specification for
the presence of any mandatory attributes that are necessary for the
Path type specified.
.. note:: A tool for converting old POSIX entries is available in the
Bcfg2 source directory at tools/posixunified.py
+-------------+----------------------+-----------------+--------------------------+
| Type | Replacement/New | Description | Attributes |
+=============+======================+=================+==========================+
| device | New | Create block, | name, owner, group, |
| | | character, and | dev_type |
| | | fifo devices | (block, char, fifo), |
| | | | major/minor |
| | | | (for block/char devices) |
+-------------+----------------------+-----------------+--------------------------+
| directory | Replaces Directory | Directories | name, owner, group, |
| | entries | | perms, prune |
+-------------+----------------------+-----------------+--------------------------+
| file | Replaces ConfigFile | Configuration | name, owner, group, |
| | entries | File | perms, encoding, empty |
+-------------+----------------------+-----------------+--------------------------+
| hardlink | New | Create | name, to |
| | | hardlinks | |
+-------------+----------------------+-----------------+--------------------------+
| symlink | Replaces SymLink | SymLinks | name, to |
| | entries | | |
+-------------+----------------------+-----------------+--------------------------+
| ignore | New | Ignore files | name |
| | | that cause | |
| | | package | |
| | | verification | |
| | | failures | |
| | | (currently | |
| | | applies to only | |
| | | YUMng) | |
+-------------+----------------------+-----------------+--------------------------+
| nonexistent | New | Specify a path | name, recursive |
| | | that should not | |
| | | exist | |
+-------------+----------------------+-----------------+--------------------------+
| permissions | Replaces Permissions | Permissions of | name, owner, |
| | entries | POSIX entities | group, perms |
| | | | |
+-------------+----------------------+-----------------+--------------------------+
| vcs | New | Create version | vcstype (git), |
| | | control | sourceurl, revision |
| | | checkout | |
+-------------+----------------------+-----------------+--------------------------+
Keep in mind that permissions for files served up by Cfg/TGenshi/TCheetah
are still handled via the traditional :ref:`server-info` mechanisms.
.. _boundentries:
Bound Entries
=============
This feature is a mechanism to specify a full entry at once from
a bundle. Traditionally, entries are defined in two stages. First,
an abstract entry is defined in a bundle. This entry includes a type
(the XML tag) and a name attribute. Then this entry is bound for
a client, providing the appropriate instance of that entry for the
client. Specifying a bound entry short-circuits this process; the only
second stage processing on Bound entries is to remove the "Bound" prefix
from the element tag. The use of a bound entry allows the single stage
definition of a complete entry. Bound entries can be used for any type.
Example:
.. code-block:: xml
Fun and Profit using altsrc
===========================
Altsrc is a generic, bcfg2-server-side mechanism for performing
configuration entry name remapping for the purpose of data binding.
Use Cases
---------
* Equivalent configuration entries on different architectures with
different names
* Mapping entries with the same name to different bind results in a
configuration (two packages with the same name but different types)
* A single configuration entry across multiple specifications
(multi-plugin, or multi-repo)
Examples
--------
* Consider the case of ``/etc/hosts`` on linux and ``/etc/inet/hosts`` on
solaris. These files contain the same data in the same format,
and should typically be synchronized, however, exist in different
locations. Classically, one would need to create one entry for each
in `Cfg`_ or `TCheetah`_ and perform manual synchronization. Or,
you could use symlinks and pray. Altsrc is driven from the bundle
side. For example:
.. code-block:: xml
In this case, when a solaris host gets the 'netinfo' bundle, it will
get the first Path entry, which includes an altsrc parameter. This
will cause the server to bind the entry as if it were a Path
called ``/etc/hosts``. This configuration entry is still called
``/etc/inet/hosts``, and is installed as such.
* On encap systems, frequently multiple packages of the same name, but
of different types will exist. For example, there might be an openssl
encap package, and an openssl rpm package. This can be dealt with
using a bundle like:
.. code-block:: xml
This bundle will bind data for the packages "openssl-encap" and
"openssl-rpm", but will be delivered to the client with both packages
named "openssl" with different types.
* Finally, consider the case where there exist complicated, but
completely independent specifications for the same configuration entry
but different groups of clients. The following bundle will allow the use
of two different `TCheetah`_ templates ``/etc/firewall-rules-external``
and ``/etc/firewall-rules-internal`` for different clients based on
their group membership.
.. code-block:: xml
...
* Consider the case where a variety of files can be constructed by a
single template (`TCheetah`_ or `TGenshi`_). It would be possible to
copy this template into the proper location for each file, but that
requires proper synchronization upon modification and knowing up front
what the files will all be called. Instead, the following bundle allows
the use of a single template for all proper config file instances.
.. code-block:: xml
altsrc can be used as a parameter for any entry type, and can be used
in any structure, including `Bundler`_ and `Base`_.