summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/appendix/files/mysql.txt10
-rw-r--r--doc/appendix/files/ntp.txt18
-rw-r--r--doc/appendix/guides/centos.txt156
-rw-r--r--doc/appendix/guides/converging_rhel5.txt2
-rw-r--r--doc/appendix/guides/fedora.txt494
-rw-r--r--doc/appendix/guides/import-existing-ssh-keys.txt11
-rw-r--r--doc/appendix/guides/ubuntu.txt6
-rw-r--r--doc/client/tools/actions.txt18
-rw-r--r--doc/getting_started/index.txt4
-rw-r--r--doc/server/configurationentries.txt2
-rw-r--r--doc/server/plugins/generators/examples/genshi/ganglia.txt2
-rw-r--r--doc/server/plugins/generators/nagiosgen.txt2
-rw-r--r--doc/server/plugins/generators/packages.txt2
-rw-r--r--doc/server/plugins/generators/semodules.txt4
-rw-r--r--doc/server/plugins/generators/sslca.txt2
-rw-r--r--doc/server/plugins/structures/altsrc.txt8
-rw-r--r--doc/server/plugins/structures/bundler/index.txt21
-rw-r--r--doc/server/plugins/structures/bundler/kernel.txt2
-rw-r--r--doc/server/plugins/structures/bundler/moab.txt2
-rw-r--r--doc/server/plugins/structures/bundler/nagios.txt2
-rw-r--r--doc/server/plugins/structures/bundler/ntp.txt2
-rw-r--r--doc/server/plugins/structures/bundler/snmpd.txt2
-rw-r--r--doc/server/plugins/structures/bundler/torque.txt2
-rw-r--r--doc/server/plugins/structures/bundler/yp.txt2
-rw-r--r--doc/unsorted/writing_specification.txt7
-rw-r--r--examples/Bundler/dirvish.xml20
-rw-r--r--examples/Bundler/sgenshi-dirvish.genshi23
-rw-r--r--schemas/authorizedkeys.xsd3
-rw-r--r--schemas/bundle.xsd7
-rw-r--r--schemas/fileprobes.xsd3
-rw-r--r--schemas/nagiosgen.xsd3
-rw-r--r--schemas/packages.xsd3
-rw-r--r--schemas/privkey.xsd5
-rw-r--r--schemas/pubkey.xsd3
-rw-r--r--schemas/sslca-cert.xsd3
-rw-r--r--schemas/sslca-key.xsd3
-rw-r--r--src/lib/Bcfg2/Server/Plugin/helpers.py20
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Bundler.py101
38 files changed, 217 insertions, 763 deletions
diff --git a/doc/appendix/files/mysql.txt b/doc/appendix/files/mysql.txt
index 6c6c83e3e..a84beb3f8 100644
--- a/doc/appendix/files/mysql.txt
+++ b/doc/appendix/files/mysql.txt
@@ -7,14 +7,14 @@
MySQL example
=============
-I had some time ago to continue with putting my configuration into
+I had some time ago to continue with putting my configuration into
Bcfg2 and maybe this helps someone else.
I added a new bundle:
.. code-block:: xml
- <Bundle name="mysql-server" version="3.0">
+ <Bundle>
<Path name="/root/bcfg2-install/mysql/users.sh"/>
<Path name="/root/bcfg2-install/mysql/users.sql"/>
<Action name="mysql_users"/>
@@ -31,9 +31,9 @@ The ``users.sh`` script looks like this:
mysql --defaults-extra-file=/etc/mysql/debian.cnf mysql \
< /root/bcfg2-install/mysql/users.sql
-On debian there is a user account in ``/etc/mysql/debian.cnf``
-automatically created, but you could also (manually) create a
-user in the database that has enough permissions and add the
+On debian there is a user account in ``/etc/mysql/debian.cnf``
+automatically created, but you could also (manually) create a
+user in the database that has enough permissions and add the
login information in a file yourself. This file looks like this::
[client]
diff --git a/doc/appendix/files/ntp.txt b/doc/appendix/files/ntp.txt
index e14816f6e..97a0c611c 100644
--- a/doc/appendix/files/ntp.txt
+++ b/doc/appendix/files/ntp.txt
@@ -13,7 +13,7 @@ another layer of functionality.
* After each change, run ``bcfg-repo-validate -v``
* Run the server with ``bcfg2-server -v``
* Update the client with ``bcfg2 -v -d -n`` (will not actually make
- client changes)
+ client changes)
Package only
------------
@@ -43,7 +43,7 @@ a client, a profile group, a list of packages, and an NTP bundle.
.. code-block:: xml
- <Bundle name="ntp">
+ <Bundle>
<Package name='ntp'/>
</Bundle>
@@ -75,7 +75,7 @@ Configure the service, and add it to Rules.
.. code-block:: xml
- <Bundle name="ntp">
+ <Bundle>
<Package name='ntp'/>
<Service name='ntpd'/>
</Bundle>
@@ -85,7 +85,7 @@ Add config file
Setup an ``etc/`` directory structure, and add it to the base::
- # cat Cfg/etc/ntp.conf/ntp.conf
+ # cat Cfg/etc/ntp.conf/ntp.conf
server ntp1.utexas.edu
``Base/base.xml``:
@@ -94,7 +94,7 @@ Setup an ``etc/`` directory structure, and add it to the base::
.. code-block:: xml
- <Bundle name="ntp">
+ <Bundle>
<Package name='ntp'/>
<Service name='ntpd'/>
<Path name='/etc/ntp.conf'/>
@@ -114,18 +114,18 @@ used to provide a single service. This is done for several reasons:
packages are upgraded, so that they can be repaired if the
package install clobbered them.
* Services associated with a bundle get restarted whenever any entity
- in that bundle is modified. This ensures that new configuration
- files and software are used after installation.
+ in that bundle is modified. This ensures that new configuration
+ files and software are used after installation.
The config file, package, and service are really all related
-components describing the idea of an ntp client, so they should be
+components describing the idea of an ntp client, so they should be
logically grouped together. We use a bundle to accomplish this.
``Bundler/ntp.xml``:
.. code-block:: xml
- <Bundle name='ntp'>
+ <Bundle>
<Package name='ntp'/>
<Service name='ntpd'/>
<Path name='/etc/ntp.conf'/>
diff --git a/doc/appendix/guides/centos.txt b/doc/appendix/guides/centos.txt
index afec18ff5..f0c91e9aa 100644
--- a/doc/appendix/guides/centos.txt
+++ b/doc/appendix/guides/centos.txt
@@ -258,9 +258,8 @@ it with the *yum* package.
.. code-block:: xml
- [root@centos ~]# cat /var/lib/bcfg2/Bundler/base-packages.xml
- <Bundle name='base-packages'>
- <Package name='yum'/>
+ <Bundle>
+ <Package name='yum'/>
</Bundle>
You need to reference the bundle from your Metadata. The resulting
@@ -357,22 +356,22 @@ looks like this
.. code-block:: xml
- <Bundle name='base-packages'>
- <Package name='bcfg2-server'/>
- <Package name='exim'/>
- <Package name='grub'/>
- <Package name='kernel'/>
- <Package name='krb5-workstation'/>
- <Package name='m2crypto'/>
- <Package name='openssh-clients'/>
- <Package name='openssh-server'/>
- <Package name='prelink'/>
- <Package name='redhat-lsb'/>
- <Package name='rpm-build'/>
- <Package name='rsync'/>
- <Package name='sysklogd'/>
- <Package name='vim-enhanced'/>
- <Package name='yum'/>
+ <Bundle>
+ <Package name='bcfg2-server'/>
+ <Package name='exim'/>
+ <Package name='grub'/>
+ <Package name='kernel'/>
+ <Package name='krb5-workstation'/>
+ <Package name='m2crypto'/>
+ <Package name='openssh-clients'/>
+ <Package name='openssh-server'/>
+ <Package name='prelink'/>
+ <Package name='redhat-lsb'/>
+ <Package name='rpm-build'/>
+ <Package name='rsync'/>
+ <Package name='sysklogd'/>
+ <Package name='vim-enhanced'/>
+ <Package name='yum'/>
</Bundle>
Now when I run the client, you can see I have only one unmanaged
@@ -388,8 +387,6 @@ package::
Finished
Loaded tool drivers:
Action Chkconfig POSIX YUM
- Extra Package gpg-pubkey e8562897-459f07a4.None.
- Extra Package gpg-pubkey 217521f6-45e8a532.None.
Phase: initial
Correct entries: 187
@@ -403,96 +400,11 @@ package::
Incorrect entries: 0
Total managed entries: 187
Unmanaged entries: 16
- Package:gpg-pubkey
Service:atd
Service:avahi-daemon
Service:bcfg2-server
...
-The gpg-pubkey packages are special in that they are not really
-packages. Currently, the way to manage them is using :ref:`BoundEntries
-<boundentries>`. So, after adding them, our Bundle now looks like this
-
-.. note:: This does not actually control the contents of the files,
- you will need to do this part separately (see below).
-
-.. code-block:: xml
-
- <Bundle name='base-packages'>
- <BoundPackage name="gpg-pubkey" type="rpm" version="foo">
- <Instance simplefile="/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5" version="e8562897" release="459f07a4"/>
- <Instance simplefile="/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL" version="217521f6" release="45e8a532"/>
- </BoundPackage>
- <Package name='bcfg2-server'/>
- <Package name='exim'/>
- <Package name='grub'/>
- <Package name='kernel'/>
- <Package name='krb5-workstation'/>
- <Package name='m2crypto'/>
- <Package name='openssh-clients'/>
- <Package name='openssh-server'/>
- <Package name='prelink'/>
- <Package name='redhat-lsb'/>
- <Package name='rpm-build'/>
- <Package name='rsync'/>
- <Package name='sysklogd'/>
- <Package name='vim-enhanced'/>
- <Package name='yum'/>
- </Bundle>
-
-.. note::
-
- version="foo" is just a dummy attribute for the gpg-pubkey Package
-
-To actually push the gpg keys out via Bcfg2, you will need to manage the
-files as well. This can be done by adding Path entries for each of the
-gpg keys you want to manage
-
-.. code-block:: xml
-
- <Bundle name='base-packages'>
- <Path name='/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5'/>
- <Path name='/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL'/>
- <BoundPackage name="gpg-pubkey" type="rpm" version="foo">
- <Instance simplefile="/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5" version="e8562897" release="459f07a4"/>
- <Instance simplefile="/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL" version="217521f6" release="45e8a532"/>
- </BoundPackage>
- <Package name='bcfg2-server'/>
- <Package name='exim'/>
- <Package name='grub'/>
- <Package name='kernel'/>
- <Package name='krb5-workstation'/>
- <Package name='m2crypto'/>
- <Package name='openssh-clients'/>
- <Package name='openssh-server'/>
- <Package name='prelink'/>
- <Package name='redhat-lsb'/>
- <Package name='rpm-build'/>
- <Package name='rsync'/>
- <Package name='sysklogd'/>
- <Package name='vim-enhanced'/>
- <Package name='yum'/>
- </Bundle>
-
-Then add the files to Cfg::
-
- mkdir -p Cfg/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
- cp /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 !$/RPM-GPG-KEY-CentOS-5
- mkdir -p Cfg/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
- cp /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL !$/RPM-GPG-KEY-EPEL
-
-You will also want to add an *important* attribute to these files so
-that they are installed on the client prior to any attempts to install
-the **gpg-pubkey** rpm packages. This is especially important during the
-bootstrapping phase and can be accomplished using an :ref:`server-info`
-file that looks like the following:
-
-.. code-block:: xml
-
- <FileInfo>
- <Info owner='root' group='root' mode='0644' important='true'/>
- </FileInfo>
-
Now, running the client shows only unmanaged Service entries. Woohoo!
Manage services
@@ -526,22 +438,22 @@ entries to our bundle.
[root@centos ~]# cat /var/lib/bcfg2/Rules/services.xml
<Rules priority='1'>
- <!-- basic services -->
- <Service type='chkconfig' status='on' name='atd'/>
- <Service type='chkconfig' status='on' name='avahi-daemon'/>
- <Service type='chkconfig' status='on' name='bcfg2-server'/>
- <Service type='chkconfig' status='on' name='crond'/>
- <Service type='chkconfig' status='on' name='cups'/>
- <Service type='chkconfig' status='on' name='gpm'/>
- <Service type='chkconfig' status='on' name='lvm2-monitor'/>
- <Service type='chkconfig' status='on' name='mcstrans'/>
- <Service type='chkconfig' status='on' name='messagebus'/>
- <Service type='chkconfig' status='on' name='netfs'/>
- <Service type='chkconfig' status='on' name='network'/>
- <Service type='chkconfig' status='on' name='postfix'/>
- <Service type='chkconfig' status='on' name='rawdevices'/>
- <Service type='chkconfig' status='on' name='sshd'/>
- <Service type='chkconfig' status='on' name='syslog'/>
+ <!-- basic services -->
+ <Service type='chkconfig' status='on' name='atd'/>
+ <Service type='chkconfig' status='on' name='avahi-daemon'/>
+ <Service type='chkconfig' status='on' name='bcfg2-server'/>
+ <Service type='chkconfig' status='on' name='crond'/>
+ <Service type='chkconfig' status='on' name='cups'/>
+ <Service type='chkconfig' status='on' name='gpm'/>
+ <Service type='chkconfig' status='on' name='lvm2-monitor'/>
+ <Service type='chkconfig' status='on' name='mcstrans'/>
+ <Service type='chkconfig' status='on' name='messagebus'/>
+ <Service type='chkconfig' status='on' name='netfs'/>
+ <Service type='chkconfig' status='on' name='network'/>
+ <Service type='chkconfig' status='on' name='postfix'/>
+ <Service type='chkconfig' status='on' name='rawdevices'/>
+ <Service type='chkconfig' status='on' name='sshd'/>
+ <Service type='chkconfig' status='on' name='syslog'/>
</Rules>
Now we run the client and see there are no more unmanaged entries!::
diff --git a/doc/appendix/guides/converging_rhel5.txt b/doc/appendix/guides/converging_rhel5.txt
index d6883c778..615d104b1 100644
--- a/doc/appendix/guides/converging_rhel5.txt
+++ b/doc/appendix/guides/converging_rhel5.txt
@@ -79,7 +79,7 @@ For a "Package"
.. code-block:: xml
- <Bundle name='keys'>
+ <Bundle>
<!-- GPG keys -->
<BoundPackage name="gpg-pubkey" type="rpm" version="foo">
<Instance simplefile="/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL" version="217521f6" release="45e8a532"/>
diff --git a/doc/appendix/guides/fedora.txt b/doc/appendix/guides/fedora.txt
deleted file mode 100644
index 1c2a33f3b..000000000
--- a/doc/appendix/guides/fedora.txt
+++ /dev/null
@@ -1,494 +0,0 @@
-.. -*- mode: rst -*-
-
-.. This guide is based on the Centos guide.
-
-.. _guide-fedora:
-
-======
-Fedora
-======
-
-This guide is work in progess.
-
-
-This is a complete getting started guide for Fedora. With this
-document you should be able to install a Bcfg2 server, a Bcfg2 client,
-and change the ``/etc/motd`` file on the client.
-
-Prerequisites
-=============
-
-To setup a configuration management system based on Bcfg2 only a few
-prerequisites need to be fullfilled.
-
-* A server machine that can host the Bcfg2
-* Internet access for the installation process
-* A working network with DNS
-
-
-Install Bcfg2 From RPM
-======================
-
-The fastest way to get Bcfg2 onto your system is to use ``yum``
-or PackageKit. ``yum`` will pull all dependencies of Bcfg2
-automatically in. ::
-
- $ su -c 'yum install bcfg2-server bcfg2'
-
-Your system should now have the necessary software to use Bcfg2.
-The next step is to set up your Bcfg2 :term:`repository`.
-
-
-Initialize your repository
-==========================
-
-Now that you're done with the install, you need to initialize your
-repository and setup your ``/etc/bcfg2.conf``. ``bcfg2-admin init``
-is a tool which allows you to automate this:
-
-.. code-block:: sh
-
- # bcfg2-admin init
- Store bcfg2 configuration in [/etc/bcfg2.conf]:
- Location of bcfg2 repository [/var/lib/bcfg2]:
- Directory /var/lib/bcfg2 exists. Overwrite? [y/N]:y
- Input password used for communication verification (without echoing; leave blank for a random):
- What is the server's hostname: [config01.local.net]
- Input the server location [https://config01.local.net:6789]:
- Input base Operating System for clients:
- 1: Red Hat/Fedora/RHEL/RHAS/Centos
- 2: SUSE/SLES
- 3: Mandrake
- 4: Debian
- 5: Ubuntu
- 6: Gentoo
- 7: FreeBSD
- : 1
- Generating a 1024 bit RSA private key
- .......................................................++++++
- .....++++++
- writing new private key to '/etc/bcfg2.key'
- -----
- Signature ok
- subject=/C=US/ST=Illinois/L=Argonne/CN=config01.local.net
- Getting Private key
- Repository created successfuly in /var/lib/bcfg2
-
-Change responses as necessary.
-
-Start the server
-================
-
-You are now ready to start your Bcfg2 server for the first time::
-
- $ su -c '/etc/init.d/bcfg2-server start'
- Starting Configuration Management Server: bcfg2-server [ OK ]
-
-To verify that everything started ok, look for the running daemon and
-check the logs:
-
-.. code-block:: sh
-
- $ su -c 'tail /var/log/messages'
- May 16 14:14:57 config01 bcfg2-server[2746]: service available at https://config01.local.net:6789
- May 16 14:14:57 config01 bcfg2-server[2746]: serving bcfg2-server at https://config01.local.net:6789
- May 16 14:14:57 config01 bcfg2-server[2746]: serve_forever() [start]
- May 16 14:14:57 config01 bcfg2-server[2746]: Handled 16 events in 0.009s
-
-
-Run ``bcfg2`` to be sure you are able to communicate with the server:
-
-.. code-block:: sh
-
- $ su -c 'bcfg2 -vqne'
-
- /usr/lib/python2.6/site-packages/Bcfg2/Client/Tools/rpmtools.py:23: DeprecationWarning: the md5 module is deprecated; use hashlib instead
- import md5
- Loaded plugins: presto, refresh-packagekit
- Loaded tool drivers:
- Action Chkconfig POSIX YUM
- Extra Package imsettings-libs 0.108.0-2.fc13.i686.
- Extra Package PackageKit-device-rebind 0.6.4-1.fc13.i686.
- ...
- Extra Package newt-python 0.52.11-2.fc13.i686.
- Extra Package pulseaudio-gdm-hooks 0.9.21-6.fc13.i686.
-
- Phase: initial
- Correct entries: 0
- Incorrect entries: 0
- Total managed entries: 0
- Unmanaged entries: 1314
-
-
- Phase: final
- Correct entries: 0
- Incorrect entries: 0
- Total managed entries: 0
- Unmanaged entries: 1314
- Package:ConsoleKit Package:jasper-libs Package:pcsc-lite-libs
- Package:ConsoleKit-libs Package:java-1.5.0-gcj Package:perf
- ...
- Package:iw Package:pcre Service:sshd
- Package:jack-audio-connection-kit Package:pcsc-lite Service:udev-post
-
-The ``bcfg2.conf`` file contains only standard plugins so far.
-
-.. code-block:: sh
-
- $ su -c 'cat /etc/bcfg2.conf'
-
- [server]
- repository = /var/lib/bcfg2
- plugins = SSHbase,Cfg,Pkgmgr,Rules,Metadata,Base,Bundler
-
- [statistics]
- sendmailpath = /usr/lib/sendmail
-
- [database]
- engine = sqlite3
- # 'postgresql', 'mysql', 'mysql_old', 'sqlite3' or 'ado_mssql'.
- name =
- # Or path to database file if using sqlite3.
- #<repository>/etc/brpt.sqlite is default path if left empty
- user =
- # Not used with sqlite3.
- password =
- # Not used with sqlite3.
- host =
- # Not used with sqlite3.
- port =
-
- [communication]
- protocol = xmlrpc/ssl
- password = test1234
- certificate = /etc/bcfg2.crt
- key = /etc/bcfg2.key
- ca = /etc/bcfg2.crt
-
- [components]
- bcfg2 = https://config01.local.net:6789
-
-
-Add the machines to Bcfg2
--------------------------
-
-``bcfg2-admin`` can be used to add a machine to Bcfg2 easily. You
-need to know the Fully Qualified Domain Name (FQDN) of ever system
-you want to control through Bcfg2. ::
-
- bcfg2-admin client add <FQDN machine>
-
-Bring your first machine under Bcfg2 control
---------------------------------------------
-
-Now it is time to get the first machine's configuration into the
-Bcfg2 repository. The server will be the first machine. It's
-already in the ``Metadata/client.xml``.
-
-
-Setup the :ref:`server-plugins-generators-packages` plugin
-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-First, replace **Pkgmgr** with **Packages** in the plugins
-line of ``bcfg2.conf``. Then create a `Packages/` directory in
-``/var/lib/bcfg2`` ::
-
- $ su -c 'mkdir /var/lib/bcfg2/Packages'
-
-Create a ``packages.conf`` in the ``/var/lib/bcfg2/Packages`` directory
-with the following contents::
-
- [global]
-
-Create a ``sources.xml`` file for the packages in
-``/var/lib/bcfg2/Packages`` with the following content. Choose a mirror
-near your location according the `Mirror list`_ .
-
-.. _Mirror list: http://mirrors.fedoraproject.org/publiclist/
-
-.. code-block:: xml
-
- <Sources>
- <Group name="fedora13">
- <Source type="yum"
- url="ftp://fedora.tu-chemnitz.de/pub/linux/fedora/linux/releases/"
- version="13">
- <Component>Fedora</Component>
- <Arch>i386</Arch>
- <Arch>x86_64</Arch>
- <Source>
- </Group>
- </Sources>
-
-
-In order to make these sources apply to our clients, we need to modify
-our Metadata. Let's add a **fedora13** group which inherits a
-**fedora** group (this should replace the existing **redhat** group)
-present in ``/var/lib/bcfg2/Metadata/groups.xml``. The resulting file
-should look something like this
-
-.. note::
-
- The reason we are creating a release-specific group in this case is
- that the YUMSource above is specific to the 13th release of fedora.
- That is, it should not apply to other releases (14, 15, etc).
-
-.. code-block:: xml
-
- <Groups version='3.0'>
- <Group profile='true' public='true' default='true' name='basic'>
- <Group name='fedora13'/>
- </Group>
- <Group name='fedora13'/>
- <Group name='fedora'/>
- <Group name='ubuntu'/>
- <Group name='debian'/>
- <Group name='freebsd'/>
- <Group name='gentoo'/>
- <Group name='fedora'/>
- <Group name='suse'/>
- <Group name='mandrake'/>
- <Group name='solaris'/>
- </Groups>
-
-.. note::
- When editing your xml files by hand, it is useful to occasionally
- run ``bcfg2-lint`` to ensure that your xml validates properly.
-
-Add a probe
-+++++++++++
-
-The next step for the client will be to have the proper
-arch group membership. For this, we will make use of the
-:ref:`unsorted-dynamic_groups` capabilities of the Probes plugin. Add
-**Probes** to your plugins line in ``bcfg2.conf`` and create the Probe:
-
-.. code-block:: sh
-
- $ su -c 'mkdir /var/lib/bcfg2/Probes'
- $ su -c 'cat /var/lib/bcfg2/Probes/groups'
- #!/bin/sh
-
- echo "group:`uname -m`"
-
-Now a restart of ``bcfg2-server`` is needed::
-
- $ su -c '/etc/init.d/bcfg2-server restart'
-
-To test the Probe just run ``bcfg2 -vqn``.
-
-.. code-block:: xml
-
- $ su -c 'bcfg2 -vqn'
- Running probe group
- Probe group has result:
- group:i686
- ...
-
-Start managing packages
-+++++++++++++++++++++++
-
-Add a base-packages bundle. Let's see what happens when we just populate
-it with the *yum* package. Create the ``base-packages.xml`` in your
-``Bundler/`` directory with a entry for ``yum``.
-
-.. code-block:: xml
-
- $ cat /var/lib/bcfg2/Bundler/base-packages.xml
- <Bundle name='base-packages'>
- <Package name='yum'/>
- </Bundle>
-
-You need to reference the bundle from your ``group.xml``. The resulting
-profile group might look something like this
-
-.. code-block:: xml
-
- <Group profile='true' public='true' default='true' name='basic'>
- <Bundle name='base-packages'/>
- <Group name='fedora13'/>
- </Group>
-
-Now if we run the client, we can see what this has done for us.::
-
- output
-
-As you can see, the Packages plugin has generated the dependencies
-required for the yum package automatically. The ultimate goal should
-be to move all the packages from the **Unmanaged** entries section
-to the **Managed** entries section. So, what exactly *are* those
-Unmanaged entries?::
-
- output
-
-Now you can go through these and continue adding the packages you
-want to your Bundle. After a while, I ended up with a minimal bundle
-that looks like this
-
-.. code-block:: xml
-
- <Bundle name='base-packages'>
-
- </Bundle>
-
-Now when I run the client, you can see I have only one unmanaged
-package::
-
- outout
-
-The gpg-pubkey packages are special in that they are not really
-packages. Currently, the way to manage them is using
-:ref:`BoundEntries <boundentries>`. So, after adding them, our
-Bundle now looks like this
-
-.. note:: This does not actually control the contents of the files,
- you will need to do this part separately (see below).
-
-.. code-block:: xml
-
- <Bundle name='base-packages'>
- <BoundPackage name="gpg-pubkey" type="rpm" version="foo">
- <Instance simplefile="/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5" version="e8562897" release="459f07a4"/>
- <Instance simplefile="/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL" version="217521f6" release="45e8a532"/>
- </BoundPackage>
- <Package name='bcfg2-server'/>
- <Package name='exim'/>
- <Package name='grub'/>
- <Package name='kernel'/>
- <Package name='krb5-workstation'/>
- <Package name='m2crypto'/>
- <Package name='openssh-clients'/>
- <Package name='openssh-server'/>
- <Package name='prelink'/>
- <Package name='redhat-lsb'/>
- <Package name='rpm-build'/>
- <Package name='rsync'/>
- <Package name='sysklogd'/>
- <Package name='vim-enhanced'/>
- <Package name='yum'/>
- </Bundle>
-
-.. note::
-
- version="foo" is just a dummy attribute for the gpg-pubkey Package
-
-To actually push the gpg keys out via Bcfg2, you will need to manage
-the files as well. This can be done by adding Path entries for each
-of the gpg keys you want to manage
-
-.. code-block:: xml
-
- <Bundle name='base-packages'>
- <Path name='/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5'/>
- <Path name='/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL'/>
- <BoundPackage name="gpg-pubkey" type="rpm" version="foo">
- <Instance simplefile="/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5" version="e8562897" release="459f07a4"/>
- <Instance simplefile="/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL" version="217521f6" release="45e8a532"/>
- </BoundPackage>
- <Package name='bcfg2-server'/>
- <Package name='exim'/>
- <Package name='grub'/>
- <Package name='kernel'/>
- <Package name='krb5-workstation'/>
- <Package name='m2crypto'/>
- <Package name='openssh-clients'/>
- <Package name='openssh-server'/>
- <Package name='prelink'/>
- <Package name='redhat-lsb'/>
- <Package name='rpm-build'/>
- <Package name='rsync'/>
- <Package name='sysklogd'/>
- <Package name='vim-enhanced'/>
- <Package name='yum'/>
- </Bundle>
-
-Then add the files to Cfg::
-
- mkdir -p Cfg/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
- cp /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 !$/RPM-GPG-KEY-CentOS-5
- mkdir -p Cfg/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
- cp /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL !$/RPM-GPG-KEY-EPEL
-
-Now, running the client shows only unmanaged Service entries. Woohoo!
-
-Manage services
-+++++++++++++++
-
-Now let's clear up the unmanaged service entries by adding the
-following entries to our bundle...
-
-.. code-block:: xml
-
- <!-- basic services -->
- <Service name='atd'/>
- <Service name='avahi-daemon'/>
- <Service name='bcfg2-server'/>
- <Service name='crond'/>
- <Service name='cups'/>
- <Service name='gpm'/>
- <Service name='lvm2-monitor'/>
- <Service name='mcstrans'/>
- <Service name='messagebus'/>
- <Service name='netfs'/>
- <Service name='network'/>
- <Service name='postfix'/>
- <Service name='rawdevices'/>
- <Service name='sshd'/>
- <Service name='syslog'/>
-
-...and bind them in Rules
-
-.. code-block:: xml
-
- [root@centos ~]# cat /var/lib/bcfg2/Rules/services.xml
- <Rules priority='1'>
- <!-- basic services -->
- <Service type='chkconfig' status='on' name='atd'/>
- <Service type='chkconfig' status='on' name='avahi-daemon'/>
- <Service type='chkconfig' status='on' name='bcfg2-server'/>
- <Service type='chkconfig' status='on' name='crond'/>
- <Service type='chkconfig' status='on' name='cups'/>
- <Service type='chkconfig' status='on' name='gpm'/>
- <Service type='chkconfig' status='on' name='lvm2-monitor'/>
- <Service type='chkconfig' status='on' name='mcstrans'/>
- <Service type='chkconfig' status='on' name='messagebus'/>
- <Service type='chkconfig' status='on' name='netfs'/>
- <Service type='chkconfig' status='on' name='network'/>
- <Service type='chkconfig' status='on' name='postfix'/>
- <Service type='chkconfig' status='on' name='rawdevices'/>
- <Service type='chkconfig' status='on' name='sshd'/>
- <Service type='chkconfig' status='on' name='syslog'/>
- </Rules>
-
-Now we run the client and see there are no more unmanaged entries! ::
-
- $ su -c 'bcfg2 -veqn'
-
-
-Adding Plugins
-++++++++++++++
-
-Git
----
-
-.. _Git tutorial: http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html
-
-Adding the :ref:`server-plugins-version-git` plugins can preserve
-versioning information. The first step is to add *Git* to your
-plugin line::
-
- plugins = Base,Bundler,Cfg,...,Git
-
-For tracking the configuration files in the ``/var/lib/bcfg2``
-directory a git repository need to be established::
-
- git init
-
-For more detail about the setup of git please refer to a `git tutorial`_.
-The first commit can be the empty or the allready populated directory::
-
- git add . && git commit -a
-
-While running ``bcfg2-info`` the following line will show up::
-
- Initialized git plugin with git directory = /var/lib/bcfg2/.git
diff --git a/doc/appendix/guides/import-existing-ssh-keys.txt b/doc/appendix/guides/import-existing-ssh-keys.txt
index 64a1b62cd..6ce41ba60 100644
--- a/doc/appendix/guides/import-existing-ssh-keys.txt
+++ b/doc/appendix/guides/import-existing-ssh-keys.txt
@@ -21,10 +21,11 @@ Add a bundle for ssh
After verifying that SSHbase is listed on the plugins line in
``/etc/bcfg2.conf``, you need to create a bundle containing the
-appropriate entries.::
+appropriate entries.
- cat > /tmp/ssh.xml << EOF
- <Bundle name='ssh'>
+.. code-block:: xml
+
+ <Bundle>
<Path name='/etc/ssh/ssh_host_dsa_key'/>
<Path name='/etc/ssh/ssh_host_rsa_key'/>
<Path name='/etc/ssh/ssh_host_dsa_key.pub'/>
@@ -34,10 +35,6 @@ appropriate entries.::
<Path name='/etc/ssh/ssh_known_hosts'/>
</Bundle>
-::
-
- mv /tmp/ssh.xml /var/lib/bcfg2/Bundle
-
Next, you need to add the ssh bundle to the client's metadata in
groups.xml.
diff --git a/doc/appendix/guides/ubuntu.txt b/doc/appendix/guides/ubuntu.txt
index 06813f50b..8399daf07 100644
--- a/doc/appendix/guides/ubuntu.txt
+++ b/doc/appendix/guides/ubuntu.txt
@@ -267,8 +267,8 @@ it with the ubuntu-standard package.
.. code-block:: xml
root@lucid:~# cat /var/lib/bcfg2/Bundler/base-packages.xml
- <Bundle name='base-packages'>
- <Package name='ubuntu-standard'/>
+ <Bundle>
+ <Package name='ubuntu-standard'/>
</Bundle>
You need to reference the bundle from your Metadata. The resulting
@@ -357,7 +357,7 @@ while, I ended up with a minimal bundle that looks like this
.. code-block:: xml
- <Bundle name='base-packages'>
+ <Bundle>
<Package name='bash-completion'/>
<Package name='bcfg2-server'/>
<Package name='debconf-i18n'/>
diff --git a/doc/client/tools/actions.txt b/doc/client/tools/actions.txt
index 81486ecd1..ffca8572e 100644
--- a/doc/client/tools/actions.txt
+++ b/doc/client/tools/actions.txt
@@ -31,14 +31,14 @@ central reporting of action failure is desired, set this attribute to
'check'. Also note that Action entries included in Base will not be
executed.
-Actions cannot be completely defined inside of a bundle; they are a bound
-entry, much like Packages, Services or Paths. The Rules plugin can bind
-these entries. For example to include the above action in a bundle,
-first the Action entry must be included in the bundle:
+Actions are not completely defined inside of a bundle; they are an
+abstract entry. The Rules plugin can bind these entries. For example
+to include the above action in a bundle, first the Action entry must
+be included in the bundle:
.. code-block:: xml
- <Bundle name='bundle_name'>
+ <Bundle>
...
<Action name='action_name'/>
</Bundle>
@@ -55,6 +55,14 @@ Then a corresponding entry must be included in the Rules directory, like:
This allows different clients to get different actions as a part of the
same bundle based on group membership.
+It is also possible to do this in one step in the bundle itself with a
+``BoundAction`` tag, e.g.:
+
+ <Bundle>
+ <BoundAction timing='post' when='modified' name='action_name'
+ command='/path/to/command arg1 arg2' status='ignore'/>
+ </Rules>
+
Example Action (add APT keys)
=============================
diff --git a/doc/getting_started/index.txt b/doc/getting_started/index.txt
index 5f84117d4..58a673b75 100644
--- a/doc/getting_started/index.txt
+++ b/doc/getting_started/index.txt
@@ -20,7 +20,7 @@ Get and Install Bcfg2 Server
We recommend running the server on a Linux machine for ease of
deployment due to the availability of packages for the dependencies.
-First, you need to download and install Bcfg2. The section
+First, you need to download and install Bcfg2. The section
:ref:`installation-index` in this manual describes the steps to take.
To start, you will need to install the server on one machine and the
client on one or more machines. Yes, your server can also be a client
@@ -168,7 +168,7 @@ Next, we create a motd.xml file in the Bundler directory:
.. code-block:: xml
- <Bundle name='motd' version='2.0'>
+ <Bundle>
<Path name='/etc/motd' />
</Bundle>
diff --git a/doc/server/configurationentries.txt b/doc/server/configurationentries.txt
index 66ff617c0..446257d62 100644
--- a/doc/server/configurationentries.txt
+++ b/doc/server/configurationentries.txt
@@ -28,7 +28,7 @@ Example:
.. code-block:: xml
- <Bundle name='ntp'>
+ <Bundle>
<BoundPackage name='ntp' type='deb' version='1:4.2.4p4+dfsg-3ubuntu2.1'/>
</Bundle>
diff --git a/doc/server/plugins/generators/examples/genshi/ganglia.txt b/doc/server/plugins/generators/examples/genshi/ganglia.txt
index 3a20fde92..d7030e990 100644
--- a/doc/server/plugins/generators/examples/genshi/ganglia.txt
+++ b/doc/server/plugins/generators/examples/genshi/ganglia.txt
@@ -33,7 +33,7 @@ Bundler/ganglia.xml
.. code-block:: xml
- <Bundle name='ganglia'>
+ <Bundle>
<Package name='ganglia-gmond' />
<Package name='ganglia-gmond-modules-python' />
<Path name='/etc/ganglia/gmond.conf' />
diff --git a/doc/server/plugins/generators/nagiosgen.txt b/doc/server/plugins/generators/nagiosgen.txt
index ee99b2dc1..4c49bdc54 100644
--- a/doc/server/plugins/generators/nagiosgen.txt
+++ b/doc/server/plugins/generators/nagiosgen.txt
@@ -124,7 +124,7 @@ Create a nagios Bcfg2 bundle ``/var/lib/bcfg2/Bundler/nagios.xml``
.. code-block:: xml
- <Bundle name='nagios' version='2.0'>
+ <Bundle>
<Path name='/etc/nagiosgen.status'/>
<Group name='rh'>
<Group name='nagios-server'>
diff --git a/doc/server/plugins/generators/packages.txt b/doc/server/plugins/generators/packages.txt
index a7987260a..bd013bfdb 100644
--- a/doc/server/plugins/generators/packages.txt
+++ b/doc/server/plugins/generators/packages.txt
@@ -388,7 +388,7 @@ attribute, e.g.:
.. code-block:: xml
- <Bundle name="yum">
+ <Bundle>
<Group name="sles">
<Path name="/etc/yum/yum.repos.d/bcfg2.repo"
altsrc="/etc/yum.repos.d/bcfg2.repo"/>
diff --git a/doc/server/plugins/generators/semodules.txt b/doc/server/plugins/generators/semodules.txt
index 04d72e139..d75160cdf 100644
--- a/doc/server/plugins/generators/semodules.txt
+++ b/doc/server/plugins/generators/semodules.txt
@@ -41,7 +41,7 @@ SEModules handles ``<SEModule>`` entries. For instance:
.. code-block:: xml
- <Bundle name="foo">
+ <Bundle>
<SEModule name="foo.pp"/>
</Bundle>
@@ -50,7 +50,7 @@ The ``.pp`` extension is optional.
.. note::
If you use a ``BoundSEModule`` tag, you must *not* include the
- ``.pp`` extension. This is not recommend, though.
+ ``.pp`` extension. This is not recommended, though.
You can also install a disabled module:
diff --git a/doc/server/plugins/generators/sslca.txt b/doc/server/plugins/generators/sslca.txt
index cab7eb233..9c3a0806d 100644
--- a/doc/server/plugins/generators/sslca.txt
+++ b/doc/server/plugins/generators/sslca.txt
@@ -280,7 +280,7 @@ Here's a more complete example bcfg2-client bundle:
.. code-block:: xml
- <Bundle name='bcfg2-client'>
+ <Bundle>
<Path name='/etc/bcfg2.conf'/>
<Path name='/etc/cron.d/bcfg2-client'/>
<Package name='bcfg2'/>
diff --git a/doc/server/plugins/structures/altsrc.txt b/doc/server/plugins/structures/altsrc.txt
index 1268a8584..cfc2fa326 100644
--- a/doc/server/plugins/structures/altsrc.txt
+++ b/doc/server/plugins/structures/altsrc.txt
@@ -36,7 +36,7 @@ Examples
.. code-block:: xml
- <Bundle name='netinfo'>
+ <Bundle>
<Group name='solaris'>
<Path name='/etc/inet/hosts' altsrc='/etc/hosts'/>
</Group>
@@ -58,7 +58,7 @@ Examples
.. code-block:: xml
- <Bundle name='openssl'>
+ <Bundle>
<Package name='openssl' altsrc='openssl-encap'/>
<Package name='openssl' altsrc='openssl-rpm'/>
</Bundle>
@@ -76,7 +76,7 @@ Examples
.. code-block:: xml
- <Bundle name='firewall'>
+ <Bundle>
...
<Group name='conduit'>
<Path name='/etc/firewall-rules' altsrc='/etc/firewall-rules-external'/>
@@ -97,7 +97,7 @@ Examples
.. code-block:: xml
- <Bundle name='netconfig'>
+ <Bundle>
<Path name='/etc/sysconfig/network-scripts/ifcfg-eth0' altsrc='/etc/ifcfg-template'/>
<Path name='/etc/sysconfig/network-scripts/ifcfg-eth1' altsrc='/etc/ifcfg-template'/>
<Path name='/etc/sysconfig/network-scripts/ifcfg-eth2' altsrc='/etc/ifcfg-template'/>
diff --git a/doc/server/plugins/structures/bundler/index.txt b/doc/server/plugins/structures/bundler/index.txt
index a19959e66..f6ed1357d 100644
--- a/doc/server/plugins/structures/bundler/index.txt
+++ b/doc/server/plugins/structures/bundler/index.txt
@@ -30,7 +30,7 @@ The following is an annotated copy of a bundle:
.. code-block:: xml
- <Bundle name='ssh' version='2.0'>
+ <Bundle>
<Path name='/etc/ssh/ssh_host_dsa_key'/>
<Path name='/etc/ssh/ssh_host_rsa_key'/>
<Path name='/etc/ssh/ssh_host_dsa_key.pub'/>
@@ -118,13 +118,14 @@ Genshi XML templates allow you to use the `Genshi
generate a bundle. Genshi templates can be specified one of two ways:
1. Add an XML-style genshi template to the Bundler directory with a
- ``.genshi`` and the associated namespace attribute.
-2. Simply add the appropriate namespace attribute to your existing XML
+ ``.genshi`` and the associated namespace attribute. *This is
+ deprecated as of Bcfg2 1.4.0.*
+2. Add the Genshi namespace to your existing XML
bundle.
The top-level Bundle tag should look like the following::
- <Bundle name="foo" xmlns:py="http://genshi.edgewall.org/">
+ <Bundle xmlns:py="http://genshi.edgewall.org/">
Several variables are pre-defined inside templates:
@@ -184,8 +185,8 @@ in their name. The following template produces such a config file entry.
.. code-block:: xml
- <Bundle name='foo' xmlns:py="http://genshi.edgewall.org/">
- <Path name='/etc/package-${metadata.hostname}'/>
+ <Bundle xmlns:py="http://genshi.edgewall.org/">
+ <Path name='/etc/package-${metadata.hostname}'/>
</Bundle>
Depending on the circumstance, these configuration files can either be
@@ -199,7 +200,7 @@ and returns them in a newline delimited string.
.. code-block:: xml
- <Bundle name="networkinterfaces" xmlns:py="http://genshi.edgewall.org/">
+ <Bundle xmlns:py="http://genshi.edgewall.org/">
<?python
files = metadata.Probes["getmacs"].split("\n")
?>
@@ -219,7 +220,7 @@ if declaration.
.. code-block:: xml
- <Bundle name='bacula' xmlns:py="http://genshi.edgewall.org/">
+ <Bundle xmlns:py="http://genshi.edgewall.org/">
<Path name="/etc/bacula/bconsole.conf"/>
<Path name="/etc/bacula/bacula-fd.conf"/>
<Path name="/etc/bacula/bacula-sd.conf"/>
@@ -231,7 +232,7 @@ or alternately
.. code-block:: xml
- <Bundle name='bacula' xmlns:py="http://genshi.edgewall.org/">
+ <Bundle xmlns:py="http://genshi.edgewall.org/">
<Path name="/etc/bacula/bconsole.conf"/>
<Path name="/etc/bacula/bacula-fd.conf"/>
<Path name="/etc/bacula/bacula-sd.conf"/>
@@ -244,7 +245,7 @@ or yet another way
.. code-block:: xml
- <Bundle name='bacula' xmlns:py="http://genshi.edgewall.org/">
+ <Bundle xmlns:py="http://genshi.edgewall.org/">
<Path name="/etc/bacula/bconsole.conf"/>
<Path name="/etc/bacula/bacula-fd.conf"/>
<Path name="/etc/bacula/bacula-sd.conf"/>
diff --git a/doc/server/plugins/structures/bundler/kernel.txt b/doc/server/plugins/structures/bundler/kernel.txt
index c6aa5e3f3..e61d21476 100644
--- a/doc/server/plugins/structures/bundler/kernel.txt
+++ b/doc/server/plugins/structures/bundler/kernel.txt
@@ -21,7 +21,7 @@ some of which might be better than this one. Feel free to hack as needed.
.. code-block:: xml
- <Bundle name='kernel' version='2.0'>
+ <Bundle>
<Group name='sles8'>
<!-- =================== ia32 ==================== -->
<Group name='ia32'>
diff --git a/doc/server/plugins/structures/bundler/moab.txt b/doc/server/plugins/structures/bundler/moab.txt
index e0d96be74..8f747376a 100644
--- a/doc/server/plugins/structures/bundler/moab.txt
+++ b/doc/server/plugins/structures/bundler/moab.txt
@@ -9,7 +9,7 @@ This is a fairly simple Bundle for the Moab workload manager.
.. code-block:: xml
- <Bundle name='moab' version='2.0'>
+ <Bundle>
<Path name='/var/spool/moab'/>
<Path name='/var/spool/moab/moab.cfg'/>
<Group name='moab-server'>
diff --git a/doc/server/plugins/structures/bundler/nagios.txt b/doc/server/plugins/structures/bundler/nagios.txt
index fa5b67f30..d25e1cf0a 100644
--- a/doc/server/plugins/structures/bundler/nagios.txt
+++ b/doc/server/plugins/structures/bundler/nagios.txt
@@ -12,7 +12,7 @@ the clients.
.. code-block:: xml
- <Bundle name='nagios-client' version='2.0'>
+ <Bundle>
<Group name='sles8'>
<Package name='ucdsnmp'/>
</Group>
diff --git a/doc/server/plugins/structures/bundler/ntp.txt b/doc/server/plugins/structures/bundler/ntp.txt
index b1264b5ee..31bc8a97a 100644
--- a/doc/server/plugins/structures/bundler/ntp.txt
+++ b/doc/server/plugins/structures/bundler/ntp.txt
@@ -12,7 +12,7 @@ better through use of groups.
.. code-block:: xml
- <Bundle name='ntp'>
+ <Bundle>
<Package name='xntp'/>
<Path name='/etc/sysconfig/xntp'/>
<Path name='/etc/sysconfig/clock'/>
diff --git a/doc/server/plugins/structures/bundler/snmpd.txt b/doc/server/plugins/structures/bundler/snmpd.txt
index 2318f8ca1..859e07f7f 100644
--- a/doc/server/plugins/structures/bundler/snmpd.txt
+++ b/doc/server/plugins/structures/bundler/snmpd.txt
@@ -10,7 +10,7 @@ configuration file.
.. code-block:: xml
- <Bundle name="snmpd" version="3.0">
+ <Bundle>
<Package name="snmpd"/>
<Service name="snmpd"/>
<Path name="/etc/snmp/snmpd.conf"/>
diff --git a/doc/server/plugins/structures/bundler/torque.txt b/doc/server/plugins/structures/bundler/torque.txt
index 32e6d4c30..f6349df6e 100644
--- a/doc/server/plugins/structures/bundler/torque.txt
+++ b/doc/server/plugins/structures/bundler/torque.txt
@@ -11,7 +11,7 @@ A longer Bundle that includes many group-specific entries.
.. code-block:: xml
- <Bundle name='torque' version='1.0'>
+ <Bundle>
<Service name='nfs'/>
<Service name='nfslock'/>
<BoundPath type='directory' owner='root' group='root' mode='0755' name='/var/spool/torque'/>
diff --git a/doc/server/plugins/structures/bundler/yp.txt b/doc/server/plugins/structures/bundler/yp.txt
index 6eecb3304..9990fbc2c 100644
--- a/doc/server/plugins/structures/bundler/yp.txt
+++ b/doc/server/plugins/structures/bundler/yp.txt
@@ -14,7 +14,7 @@ treatment too.
.. code-block:: xml
- <Bundle name='yp' version='2.0'>
+ <Bundle>
<Package name='yp-tools'/>
<Path name='/etc/nsswitch.conf'/>
<Path name='/etc/yp.conf'/>
diff --git a/doc/unsorted/writing_specification.txt b/doc/unsorted/writing_specification.txt
index 700c1ab72..378a5af0e 100644
--- a/doc/unsorted/writing_specification.txt
+++ b/doc/unsorted/writing_specification.txt
@@ -121,9 +121,8 @@ consist of
If any of these pieces are installed or updated, all should be rechecked
and any associated services should be restarted.
-All files in the Bundles/ subdirectory of the repository are processed.
-Each bundle must be defined in its own file and the filename must be the
-same as the bundle name with a .xml suffix.::
+All files in the Bundles/ subdirectory of the repository are
+processed. Each bundle must be defined in its own file::
# ls Bundler
Glide3.xml
@@ -165,7 +164,7 @@ The following is an annotated copy of a bundle:
.. code-block:: xml
- <Bundle name='ssh' version='2.0'>
+ <Bundle>
<Path name='/etc/ssh/ssh_host_dsa_key'/>
<Path name='/etc/ssh/ssh_host_rsa_key'/>
<Path name='/etc/ssh/ssh_host_dsa_key.pub'/>
diff --git a/examples/Bundler/dirvish.xml b/examples/Bundler/dirvish.xml
new file mode 100644
index 000000000..47bf8cf54
--- /dev/null
+++ b/examples/Bundler/dirvish.xml
@@ -0,0 +1,20 @@
+<Bundle xmlns:py="http://genshi.edgewall.org/">
+ <py:for each="user in metadata.Properties['dirvish.xml'].xdata.find('users')">
+ <!-- Generate configs for all users in dirvish.xml -->
+ <BoundPath
+ name='/backup/homes/${user.tag}/dirvish/default.conf'
+ owner='root'
+ group='root'
+ perms='0644'>client: nfs-host
+tree: /export/homes/${user.text}
+exclude:
+ *~
+ .nfs*
+ </BoundPath>
+ </py:for>
+
+ <Package name='dirvish'/>
+ <Path name='/etc/cron.d/dirvish'/>
+ <Path name='/etc/dirvish/dirvish-cronjob'/>
+ <Path name='/etc/dirvish/master.conf'/>
+</Bundle>
diff --git a/examples/Bundler/sgenshi-dirvish.genshi b/examples/Bundler/sgenshi-dirvish.genshi
deleted file mode 100644
index b4ea08f2c..000000000
--- a/examples/Bundler/sgenshi-dirvish.genshi
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--
-vim: ft=xml
--->
-<Bundle name='sgenshi-dirvish' xmlns:py="http://genshi.edgewall.org/">
-<py:for each="user in metadata.Properties['dirvish.xml'].xdata.find('users')">
-<!-- Generate configs for all users in dirvish.xml -->
-<BoundPath
- name='/backup/homes/${user.tag}/dirvish/default.conf'
- owner='root'
- group='root'
- perms='0644'>client: nfs-host
-tree: /export/homes/${user.text}
-exclude:
- *~
- .nfs*
-</BoundPath>
-</py:for>
-
-<Package name='dirvish'/>
-<Path name='/etc/cron.d/dirvish'/>
-<Path name='/etc/dirvish/dirvish-cronjob'/>
-<Path name='/etc/dirvish/master.conf'/>
-</Bundle>
diff --git a/schemas/authorizedkeys.xsd b/schemas/authorizedkeys.xsd
index ca238d492..b0495c242 100644
--- a/schemas/authorizedkeys.xsd
+++ b/schemas/authorizedkeys.xsd
@@ -1,4 +1,5 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:py="http://genshi.edgewall.org/" xml:lang="en">
<xsd:annotation>
<xsd:documentation>
Schema for :ref:`server-plugins-generators-cfg-sshkeys`
diff --git a/schemas/bundle.xsd b/schemas/bundle.xsd
index 863e10b4b..1b997ede3 100644
--- a/schemas/bundle.xsd
+++ b/schemas/bundle.xsd
@@ -256,11 +256,12 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
- <xsd:attribute type='xsd:string' name='name' use='required'>
+ <xsd:attribute type='xsd:string' name='name'>
<xsd:annotation>
<xsd:documentation>
- The name of the bundle. This must match the bundle
- filename, minus the extension.
+ The name of the bundle. If present, this must match the
+ bundle filename, minus the extension. Specifying the name
+ explicitly is deprecated.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
diff --git a/schemas/fileprobes.xsd b/schemas/fileprobes.xsd
index 4fe168c98..12f60378c 100644
--- a/schemas/fileprobes.xsd
+++ b/schemas/fileprobes.xsd
@@ -1,4 +1,5 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:py="http://genshi.edgewall.org/" xml:lang="en">
<xsd:annotation>
<xsd:documentation>
FileProbes plugin config schema for bcfg2
diff --git a/schemas/nagiosgen.xsd b/schemas/nagiosgen.xsd
index 0ef1fb064..b3ccf5095 100644
--- a/schemas/nagiosgen.xsd
+++ b/schemas/nagiosgen.xsd
@@ -1,4 +1,5 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:py="http://genshi.edgewall.org/" xml:lang="en">
<xsd:annotation>
<xsd:documentation>
NagiosGen config schema for bcfg2
diff --git a/schemas/packages.xsd b/schemas/packages.xsd
index 948402ca5..9e7489d51 100644
--- a/schemas/packages.xsd
+++ b/schemas/packages.xsd
@@ -1,4 +1,5 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:py="http://genshi.edgewall.org/" xml:lang="en">
<xsd:annotation>
<xsd:documentation>
packages config schema for bcfg2
diff --git a/schemas/privkey.xsd b/schemas/privkey.xsd
index 9446d5777..392f28e97 100644
--- a/schemas/privkey.xsd
+++ b/schemas/privkey.xsd
@@ -1,4 +1,5 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:py="http://genshi.edgewall.org/" xml:lang="en">
<xsd:annotation>
<xsd:documentation>
Schema for :ref:`server-plugins-generators-cfg-sshkeys` ``privkey.xml``
@@ -77,9 +78,9 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
+ <xsd:attributeGroup ref="py:genshiAttrs"/>
</xsd:extension>
</xsd:simpleContent>
- <xsd:attributeGroup ref="py:genshiAttrs"/>
</xsd:complexType>
<xsd:complexType name="PrivateKeyParamsType">
diff --git a/schemas/pubkey.xsd b/schemas/pubkey.xsd
index 38d47ed0a..f3ffc7f44 100644
--- a/schemas/pubkey.xsd
+++ b/schemas/pubkey.xsd
@@ -1,4 +1,5 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:py="http://genshi.edgewall.org/" xml:lang="en">
<xsd:annotation>
<xsd:documentation>
Schema for :ref:`server-plugins-generators-cfg-sshkeys` ``pubkey.xml``
diff --git a/schemas/sslca-cert.xsd b/schemas/sslca-cert.xsd
index 97e258d78..99fb2be99 100644
--- a/schemas/sslca-cert.xsd
+++ b/schemas/sslca-cert.xsd
@@ -1,4 +1,5 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:py="http://genshi.edgewall.org/" xml:lang="en">
<xsd:annotation>
<xsd:documentation>
Schema for :ref:`server-plugins-generators-sslca` ``cert.xml``
diff --git a/schemas/sslca-key.xsd b/schemas/sslca-key.xsd
index 844304908..021da275c 100644
--- a/schemas/sslca-key.xsd
+++ b/schemas/sslca-key.xsd
@@ -1,4 +1,5 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:py="http://genshi.edgewall.org/" xml:lang="en">
<xsd:annotation>
<xsd:documentation>
Schema for :ref:`server-plugins-generators-sslca` ``key.xml``
diff --git a/src/lib/Bcfg2/Server/Plugin/helpers.py b/src/lib/Bcfg2/Server/Plugin/helpers.py
index 9d76337e0..871b5eb4e 100644
--- a/src/lib/Bcfg2/Server/Plugin/helpers.py
+++ b/src/lib/Bcfg2/Server/Plugin/helpers.py
@@ -570,7 +570,7 @@ class XMLFileBacked(FileBacked):
return "%s at %s" % (self.__class__.__name__, self.name)
-class StructFile(XMLFileBacked):
+class StructFile(XMLFileBacked, Debuggable):
""" StructFiles are XML files that contain a set of structure file
formatting logic for handling ``<Group>`` and ``<Client>``
tags.
@@ -589,6 +589,7 @@ class StructFile(XMLFileBacked):
def __init__(self, filename, should_monitor=False):
XMLFileBacked.__init__(self, filename, should_monitor=should_monitor)
+ Debuggable.__init__(self)
self.setup = Bcfg2.Options.get_option_parser()
self.encoding = self.setup['encoding']
self.template = None
@@ -605,15 +606,16 @@ class StructFile(XMLFileBacked):
encoding=self.encoding)
except LookupError:
err = sys.exc_info()[1]
- LOGGER.error('Genshi lookup error in %s: %s' % (self.name,
- err))
+ self.logger.error('Genshi lookup error in %s: %s' % (self.name,
+ err))
except genshi.template.TemplateError:
err = sys.exc_info()[1]
- LOGGER.error('Genshi template error in %s: %s' % (self.name,
- err))
+ self.logger.error('Genshi template error in %s: %s' %
+ (self.name, err))
except genshi.input.ParseError:
err = sys.exc_info()[1]
- LOGGER.error('Genshi parse error in %s: %s' % (self.name, err))
+ self.logger.error('Genshi parse error in %s: %s' % (self.name,
+ err))
if self.encryption and HAS_CRYPTO:
strict = self.xdata.get(
@@ -625,15 +627,15 @@ class StructFile(XMLFileBacked):
el.text = self._decrypt(el).encode('ascii',
'xmlcharrefreplace')
except UnicodeDecodeError:
- LOGGER.info("%s: Decrypted %s to gibberish, skipping" %
- (self.name, el.tag))
+ self.logger.info("%s: Decrypted %s to gibberish, skipping"
+ % (self.name, el.tag))
except Bcfg2.Encryption.EVPError:
msg = "Failed to decrypt %s element in %s" % (el.tag,
self.name)
if strict:
raise PluginExecutionError(msg)
else:
- LOGGER.warning(msg)
+ self.logger.warning(msg)
Index.__doc__ = XMLFileBacked.Index.__doc__
def _decrypt(self, element):
diff --git a/src/lib/Bcfg2/Server/Plugins/Bundler.py b/src/lib/Bcfg2/Server/Plugins/Bundler.py
index 051443e22..5eeb542ee 100644
--- a/src/lib/Bcfg2/Server/Plugins/Bundler.py
+++ b/src/lib/Bcfg2/Server/Plugins/Bundler.py
@@ -3,8 +3,6 @@
import os
import re
import sys
-import copy
-import lxml.etree
import Bcfg2.Server
import Bcfg2.Server.Plugin
import Bcfg2.Server.Lint
@@ -13,12 +11,29 @@ from genshi.template import TemplateError
class BundleFile(Bcfg2.Server.Plugin.StructFile):
""" Representation of a bundle XML file """
- def get_xml_value(self, metadata):
- """ get the XML data that applies to the given client """
- bundle = lxml.etree.Element('Bundle', name=self.xdata.get("name"))
- for item in self.Match(metadata):
- bundle.append(copy.copy(item))
- return bundle
+ bundle_name_re = re.compile('^(?P<name>.*)\.(xml|genshi)$')
+
+ def __init__(self, filename, should_monitor=False):
+ Bcfg2.Server.Plugin.StructFile.__init__(self, filename,
+ should_monitor=should_monitor)
+ if self.name.endswith(".genshi"):
+ self.logger.warning("Bundler: Bundle filenames ending with "
+ ".genshi are deprecated; add the Genshi XML "
+ "namespace to a .xml bundle instead")
+ __init__.__doc__ = Bcfg2.Server.Plugin.StructFile.__init__.__doc__
+
+ def Index(self):
+ Bcfg2.Server.Plugin.StructFile.Index(self)
+ if self.xdata.get("name"):
+ self.logger.warning("Bundler: Explicitly specifying bundle names "
+ "is deprecated")
+ Index.__doc__ = Bcfg2.Server.Plugin.StructFile.Index.__doc__
+
+ @property
+ def bundle_name(self):
+ """ The name of the bundle, as determined from the filename """
+ return self.bundle_name_re.match(
+ os.path.basename(self.name)).group("name")
class Bundler(Bcfg2.Server.Plugin.Plugin,
@@ -28,38 +43,35 @@ class Bundler(Bcfg2.Server.Plugin.Plugin,
bundle/translation scheme from Bcfg1. """
__author__ = 'bcfg-dev@mcs.anl.gov'
__child__ = BundleFile
- patterns = re.compile('^(?P<name>.*)\.(xml|genshi)$')
def __init__(self, core, datastore):
Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore)
Bcfg2.Server.Plugin.Structure.__init__(self)
- try:
- Bcfg2.Server.Plugin.XMLDirectoryBacked.__init__(self, self.data)
- except OSError:
- err = sys.exc_info()[1]
- msg = "Failed to load Bundle repository %s: %s" % (self.data, err)
- self.logger.error(msg)
- raise Bcfg2.Server.Plugin.PluginInitError(msg)
+ Bcfg2.Server.Plugin.XMLDirectoryBacked.__init__(self, self.data)
+ #: Bundles by bundle name, rather than filename
+ self.bundles = dict()
+ __init__.__doc__ = Bcfg2.Server.Plugin.Plugin.__init__.__doc__
- def BuildStructures(self, metadata):
- """Build all structures for client (metadata)."""
- bundleset = []
+ def HandleEvent(self, event):
+ Bcfg2.Server.Plugin.XMLDirectoryBacked.HandleEvent(self, event)
- bundle_entries = {}
- for key, item in self.entries.items():
- bundle_entries.setdefault(
- self.patterns.match(os.path.basename(key)).group('name'),
- []).append(item)
+ self.bundles = dict()
+ for bundle in self.entries.values():
+ self.bundles[bundle.bundle_name] = bundle
+ HandleEvent.__doc__ = \
+ Bcfg2.Server.Plugin.XMLDirectoryBacked.HandleEvent.__doc__
+ def BuildStructures(self, metadata):
+ bundleset = []
for bundlename in metadata.bundles:
try:
- entries = bundle_entries[bundlename]
+ bundle = self.bundles[bundlename]
except KeyError:
self.logger.error("Bundler: Bundle %s does not exist" %
bundlename)
continue
try:
- bundleset.append(entries[0].get_xml_value(metadata))
+ bundleset.append(bundle.XMLMatch(metadata))
except TemplateError:
err = sys.exc_info()[1]
self.logger.error("Bundler: Failed to render templated bundle "
@@ -68,6 +80,8 @@ class Bundler(Bcfg2.Server.Plugin.Plugin,
self.logger.error("Bundler: Unexpected bundler error for %s" %
bundlename, exc_info=1)
return bundleset
+ BuildStructures.__doc__ = \
+ Bcfg2.Server.Plugin.Structure.BuildStructures.__doc__
class BundlerLint(Bcfg2.Server.Lint.ServerPlugin):
@@ -83,7 +97,9 @@ class BundlerLint(Bcfg2.Server.Lint.ServerPlugin):
@classmethod
def Errors(cls):
return {"bundle-not-found": "error",
- "inconsistent-bundle-name": "warning"}
+ "unused-bundle": "warning",
+ "explicit-bundle-name": "error",
+ "genshi-extension-bundle": "error"}
def missing_bundles(self):
""" find bundles listed in Metadata but not implemented in Bundler """
@@ -94,21 +110,28 @@ class BundlerLint(Bcfg2.Server.Lint.ServerPlugin):
ref_bundles = set([b.get("name")
for b in groupdata.findall("//Bundle")])
- allbundles = self.core.plugins['Bundler'].entries.keys()
+ allbundles = self.core.plugins['Bundler'].bundles.keys()
for bundle in ref_bundles:
- xmlbundle = "%s.xml" % bundle
- genshibundle = "%s.genshi" % bundle
- if (xmlbundle not in allbundles and
- genshibundle not in allbundles):
+ if bundle not in allbundles:
self.LintError("bundle-not-found",
"Bundle %s referenced, but does not exist" %
bundle)
+ for bundle in allbundles:
+ if bundle not in ref_bundles:
+ self.LintError("unused-bundle",
+ "Bundle %s defined, but is not referenced "
+ "in Metadata" % bundle)
+
def bundle_names(self, bundle):
- """ verify bundle name attribute matches filename """
- fname = os.path.splitext(os.path.basename(bundle.name))[0]
- bname = bundle.xdata.get('name')
- if fname != bname:
- self.LintError("inconsistent-bundle-name",
- "Inconsistent bundle name: filename is %s, "
- "bundle name is %s" % (fname, bname))
+ """ Verify that deprecated bundle .genshi bundles and explicit
+ bundle names aren't used """
+ if bundle.xdata.get('name'):
+ self.LintError("explicit-bundle-name",
+ "Deprecated explicit bundle name in %s" %
+ bundle.name)
+
+ if bundle.name.endswith(".genshi"):
+ self.LintError("genshi-extension-bundle",
+ "Bundle %s uses deprecated .genshi extension" %
+ bundle.name)