summaryrefslogtreecommitdiffstats
path: root/doc/unsorted/altsrc.txt
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2010-01-24 18:47:00 +0000
committerSol Jerome <solj@ices.utexas.edu>2010-01-24 18:47:00 +0000
commit7c6c1e10f3cc62acc919123d0067a8a9720aeffa (patch)
treea6f6cb0cc17d41e6ccbc27c2e9f986df2e37c67d /doc/unsorted/altsrc.txt
parente3bd887d601dad1be9352768206cbb45a91a8cc7 (diff)
downloadbcfg2-7c6c1e10f3cc62acc919123d0067a8a9720aeffa.tar.gz
bcfg2-7c6c1e10f3cc62acc919123d0067a8a9720aeffa.tar.bz2
bcfg2-7c6c1e10f3cc62acc919123d0067a8a9720aeffa.zip
doc: Add a lot more unsorted stuff from the wiki
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5703 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'doc/unsorted/altsrc.txt')
-rw-r--r--doc/unsorted/altsrc.txt71
1 files changed, 71 insertions, 0 deletions
diff --git a/doc/unsorted/altsrc.txt b/doc/unsorted/altsrc.txt
new file mode 100644
index 000000000..248405ebc
--- /dev/null
+++ b/doc/unsorted/altsrc.txt
@@ -0,0 +1,71 @@
+.. -*- mode: rst -*-
+
+.. _unsorted-altsrc:
+
+===========================
+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
+
+ <Bundle name='netinfo'>
+ <Group name='solaris'>
+ <ConfigFile name='/etc/inet/hosts' altsrc='/etc/hosts'/>
+ </Group>
+ <Group name='linux'>
+ <ConfigFile name='/etc/hosts'/>
+ </Group>
+ </Bundle>
+
+ In this case, when a solaris host gets the 'netinfo' bundle, it will get the first !ConfigFile entry, which includes an altsrc parameter. This will cause the server to bind the entry as if it were a !ConfigFile 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
+
+ <Bundle name='openssl'>
+ <Package name='openssl' altsrc='openssl-encap'/>
+ <Package name='openssl' altsrc='openssl-rpm'/>
+ </Bundle>
+
+ 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
+
+ <Bundle name='firewall'>
+ ...
+ <Group name='conduit'>
+ <ConfigFile name='/etc/firewall-rules' altsrc='/etc/firewall-rules-external'/>
+ </Group>
+ <Group name='internal'>
+ <ConfigFile name='/etc/firewall-rules' altsrc='/etc/firewall-rules-internal'/>
+ </Group>
+ </Bundle>
+
+* 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
+
+ <Bundle name='netconfig'>
+ <ConfigFile name='/etc/sysconfig/network-scripts/ifcfg-eth0' altsrc='/etc/ifcfg-template'/>
+ <ConfigFile name='/etc/sysconfig/network-scripts/ifcfg-eth1' altsrc='/etc/ifcfg-template'/>
+ <ConfigFile name='/etc/sysconfig/network-scripts/ifcfg-eth2' altsrc='/etc/ifcfg-template'/>
+ </Bundle>
+
+ altsrc can be used as a parameter for any entry type, and can be used in any structure, including Bundler, Base, and SGenshi.