From 29a28347e809c502fb359a3d6852faa9e89dff6c Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Mon, 8 Feb 2010 19:24:43 +0000 Subject: doc: Migrate some more docs over from the wiki Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5717 ce84e21b-d406-0410-9b95-82705330c041 --- doc/unsorted/bundler_examples.txt | 102 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 doc/unsorted/bundler_examples.txt (limited to 'doc/unsorted/bundler_examples.txt') diff --git a/doc/unsorted/bundler_examples.txt b/doc/unsorted/bundler_examples.txt new file mode 100644 index 000000000..88db94f56 --- /dev/null +++ b/doc/unsorted/bundler_examples.txt @@ -0,0 +1,102 @@ +.. -*- mode: rst -*- + +.. _unsorted-bundler_examples: + +================ +Bundler Examples +================ + +Some simple examples of Bundles can be found in the example repository +at the locations in the following table: + ++--------------+---------------------+ +| Bundle Name | Description | ++==============+=====================+ +| `atxml`_ | At bundle | ++--------------+---------------------+ +| `bcfgxml`_ | Bcfg2 client bundle | ++--------------+---------------------+ +| `ntpxml`_ | NTP bundle | ++--------------+---------------------+ +| `sshxml`_ | OpenSSH bundle | ++--------------+---------------------+ +| `syslogxml`_ | syslog bundle | ++--------------+---------------------+ + +.. _atxml: http://trac.mcs.anl.gov/projects/bcfg2/browser/trunk/repository/Bundler/at.xml +.. _bcfgxml: http://trac.mcs.anl.gov/projects/bcfg2/browser/trunk/repository/Bundler/bcfg.xml +.. _ntpxml: http://trac.mcs.anl.gov/projects/bcfg2/browser/trunk/repository/Bundler/ntp.xml +.. _sshxml: http://trac.mcs.anl.gov/projects/bcfg2/browser/trunk/repository/Bundler/ssh.xml +.. _syslogxml: http://trac.mcs.anl.gov/projects/bcfg2/browser/trunk/repository/Bundler/syslog.xml + +In addition to the example repository, the following is a list of some more complex example Bundles. To add your own example, create a wiki page called Plugins/Bundler/examples/ + +[[TitleIndex(Plugins/Bundler/examples/)]] + +=========================== +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, Base, and SGenshi. -- cgit v1.2.3-1-g7c22