Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates > by-pkgid > b50d8ee6d7871fcc13c0677a9364ed59 > files > 321

bcfg2-doc-1.3.0-1.fc17.noarch.rpm



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Fedora &mdash; Bcfg2 1.3.0 documentation</title>
    
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '1.3.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/sidebar.js"></script>
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
    <link rel="top" title="Bcfg2 1.3.0 documentation" href="../../index.html" />
    <link rel="up" title="Guides" href="../guides.html" />
    <link rel="next" title="Gentoo" href="gentoo.html" />
    <link rel="prev" title="Converging on Verification with RHEL 5" href="converging_rhel5.html" />
 
<link rel="stylesheet" href="../../_static/bcfg2.css" type=""/>

  </head>
  <body>

<div style="text-align: left; padding: 10px 10px 15px 15px">
<a href="../../index.html"><img src="../../_static/bcfg2_logo.png" border="0" alt="sampledoc"/></a>
</div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="gentoo.html" title="Gentoo"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="converging_rhel5.html" title="Converging on Verification with RHEL 5"
             accesskey="P">previous</a> |</li>
	<li><a href="../../index.html">home</a> |&nbsp;</li>
	<!--<li><a href="../../search.html">search</a> |&nbsp;</li>-->
	<li><a href="../../help/index.html">help</a> |&nbsp;</li>
	<li><a href="../../contents.html">documentation </a> &raquo;</li>

          <li><a href="../../contents.html" >Bcfg2 documentation 1.3.0</a> &raquo;</li>
          <li><a href="../index.html" >Appendix</a> &raquo;</li>
          <li><a href="../guides.html" accesskey="U">Guides</a> &raquo;</li> 
      </ul>
    </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="fedora">
<span id="guide-fedora"></span><h1>Fedora<a class="headerlink" href="#fedora" title="Permalink to this headline">¶</a></h1>
<p>This guide is work in progess.</p>
<p>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 <tt class="docutils literal"><span class="pre">/etc/motd</span></tt> file on the client.</p>
<div class="section" id="prerequisites">
<h2>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline">¶</a></h2>
<p>To setup a configuration management system based on Bcfg2 only a few
prerequisites need to be fullfilled.</p>
<ul class="simple">
<li>A server machine that can host the Bcfg2</li>
<li>Internet access for the installation process</li>
<li>A working network with DNS</li>
</ul>
</div>
<div class="section" id="install-bcfg2-from-rpm">
<h2>Install Bcfg2 From RPM<a class="headerlink" href="#install-bcfg2-from-rpm" title="Permalink to this headline">¶</a></h2>
<p>The fastest way to get Bcfg2 onto your system is to use <tt class="docutils literal"><span class="pre">yum</span></tt>
or PackageKit. <tt class="docutils literal"><span class="pre">yum</span></tt> will pull all dependencies of Bcfg2
automatically in.</p>
<div class="highlight-python"><pre>$ su -c 'yum install bcfg2-server bcfg2'</pre>
</div>
<p>Your system should now have the necessary software to use Bcfg2.
The next step is to set up your Bcfg2 <a class="reference internal" href="../../glossary.html#term-repository"><em class="xref std std-term">repository</em></a>.</p>
</div>
<div class="section" id="initialize-your-repository">
<h2>Initialize your repository<a class="headerlink" href="#initialize-your-repository" title="Permalink to this headline">¶</a></h2>
<p>Now that you&#8217;re done with the install, you need to initialize your
repository and setup your <tt class="docutils literal"><span class="pre">/etc/bcfg2.conf</span></tt>. <tt class="docutils literal"><span class="pre">bcfg2-admin</span> <span class="pre">init</span></tt>
is a tool which allows you to automate this:</p>
<div class="highlight-sh"><pre># 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</pre>
</div>
<p>Change responses as necessary.</p>
</div>
<div class="section" id="start-the-server">
<h2>Start the server<a class="headerlink" href="#start-the-server" title="Permalink to this headline">¶</a></h2>
<p>You are now ready to start your Bcfg2 server for the first time:</p>
<div class="highlight-python"><pre>$ su -c '/etc/init.d/bcfg2-server start'
Starting Configuration Management Server: bcfg2-server     [  OK  ]</pre>
</div>
<p>To verify that everything started ok, look for the running daemon and
check the logs:</p>
<div class="highlight-sh"><div class="highlight"><pre><span class="nv">$ </span>su -c <span class="s1">&#39;tail /var/log/messages&#39;</span>
May 16 14:14:57 config01 bcfg2-server<span class="o">[</span>2746<span class="o">]</span>: service available at https://config01.local.net:6789
May 16 14:14:57 config01 bcfg2-server<span class="o">[</span>2746<span class="o">]</span>: serving bcfg2-server at https://config01.local.net:6789
May 16 14:14:57 config01 bcfg2-server<span class="o">[</span>2746<span class="o">]</span>: serve_forever<span class="o">()</span> <span class="o">[</span>start<span class="o">]</span>
May 16 14:14:57 config01 bcfg2-server<span class="o">[</span>2746<span class="o">]</span>: Handled 16 events in 0.009s
</pre></div>
</div>
<p>Run <tt class="docutils literal"><span class="pre">bcfg2</span></tt> to be sure you are able to communicate with the server:</p>
<div class="highlight-sh"><div class="highlight"><pre><span class="nv">$ </span>su -c <span class="s1">&#39;bcfg2 -vqne&#39;</span>

/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      YUMng
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
</pre></div>
</div>
<p>The <tt class="docutils literal"><span class="pre">bcfg2.conf</span></tt> file contains only standard plugins so far.</p>
<div class="highlight-sh"><div class="highlight"><pre><span class="nv">$ </span>su -c <span class="s1">&#39;cat /etc/bcfg2.conf&#39;</span>

<span class="o">[</span>server<span class="o">]</span>
<span class="nv">repository</span> <span class="o">=</span> /var/lib/bcfg2
<span class="nv">plugins</span> <span class="o">=</span> SSHbase,Cfg,Pkgmgr,Rules,Metadata,Base,Bundler

<span class="o">[</span>statistics<span class="o">]</span>
<span class="nv">sendmailpath</span> <span class="o">=</span> /usr/lib/sendmail

<span class="o">[</span>database<span class="o">]</span>
<span class="nv">engine</span> <span class="o">=</span> sqlite3
<span class="c"># &#39;postgresql&#39;, &#39;mysql&#39;, &#39;mysql_old&#39;, &#39;sqlite3&#39; or &#39;ado_mssql&#39;.</span>
<span class="nv">name</span> <span class="o">=</span>
<span class="c"># Or path to database file if using sqlite3.</span>
<span class="c">#&lt;repository&gt;/etc/brpt.sqlite is default path if left empty</span>
<span class="nv">user</span> <span class="o">=</span>
<span class="c"># Not used with sqlite3.</span>
<span class="nv">password</span> <span class="o">=</span>
<span class="c"># Not used with sqlite3.</span>
<span class="nv">host</span> <span class="o">=</span>
<span class="c"># Not used with sqlite3.</span>
<span class="nv">port</span> <span class="o">=</span>

<span class="o">[</span>communication<span class="o">]</span>
<span class="nv">protocol</span> <span class="o">=</span> xmlrpc/ssl
<span class="nv">password</span> <span class="o">=</span> test1234
<span class="nv">certificate</span> <span class="o">=</span> /etc/bcfg2.crt
<span class="nv">key</span> <span class="o">=</span> /etc/bcfg2.key
<span class="nv">ca</span> <span class="o">=</span> /etc/bcfg2.crt

<span class="o">[</span>components<span class="o">]</span>
<span class="nv">bcfg2</span> <span class="o">=</span> https://config01.local.net:6789
</pre></div>
</div>
<div class="section" id="add-the-machines-to-bcfg2">
<h3>Add the machines to Bcfg2<a class="headerlink" href="#add-the-machines-to-bcfg2" title="Permalink to this headline">¶</a></h3>
<p><tt class="docutils literal"><span class="pre">bcfg2-admin</span></tt> 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.</p>
<div class="highlight-python"><pre>bcfg2-admin client add &lt;FQDN machine&gt;</pre>
</div>
</div>
<div class="section" id="bring-your-first-machine-under-bcfg2-control">
<h3>Bring your first machine under Bcfg2 control<a class="headerlink" href="#bring-your-first-machine-under-bcfg2-control" title="Permalink to this headline">¶</a></h3>
<p>Now it is time to get the first machine&#8217;s configuration into the
Bcfg2 repository. The server will be the first machine. It&#8217;s
already in the <tt class="docutils literal"><span class="pre">Metadata/client.xml</span></tt>.</p>
<div class="section" id="setup-the-server-plugins-generators-packages-plugin">
<h4>Setup the <a class="reference internal" href="../../server/plugins/generators/packages.html#server-plugins-generators-packages"><em>Packages</em></a> plugin<a class="headerlink" href="#setup-the-server-plugins-generators-packages-plugin" title="Permalink to this headline">¶</a></h4>
<p>First, replace <strong>Pkgmgr</strong> with <strong>Packages</strong> in the plugins
line of <tt class="docutils literal"><span class="pre">bcfg2.conf</span></tt>. Then create a <cite>Packages/</cite> directory in
<tt class="docutils literal"><span class="pre">/var/lib/bcfg2</span></tt></p>
<div class="highlight-python"><pre>$ su -c 'mkdir /var/lib/bcfg2/Packages'</pre>
</div>
<p>Create a <tt class="docutils literal"><span class="pre">packages.conf</span></tt> in the <tt class="docutils literal"><span class="pre">/var/lib/bcfg2/Packages</span></tt> directory
with the following contents:</p>
<div class="highlight-python"><pre>[global]</pre>
</div>
<p>Create a <tt class="docutils literal"><span class="pre">sources.xml</span></tt> file for the packages in
<tt class="docutils literal"><span class="pre">/var/lib/bcfg2/Packages</span></tt> with the following content.  Choose a mirror
near your location according the <a class="reference external" href="http://mirrors.fedoraproject.org/publiclist/">Mirror list</a> .</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Sources&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&quot;fedora-13&quot;</span><span class="nt">&gt;</span>
        <span class="nt">&lt;Source</span> <span class="na">type=</span><span class="s">&quot;yum&quot;</span> <span class="na">url=</span><span class="s">&quot;ftp://fedora.tu-chemnitz.de/pub/linux/fedora/linux/releases/&quot;</span> <span class="na">version=</span><span class="s">&quot;13&quot;</span><span class="nt">&gt;</span>
            <span class="nt">&lt;Component&gt;</span>Fedora<span class="nt">&lt;/Component&gt;</span>
            <span class="nt">&lt;Arch&gt;</span>i386<span class="nt">&lt;/Arch&gt;</span>
            <span class="nt">&lt;Arch&gt;</span>x86_64<span class="nt">&lt;/Arch&gt;</span>
        <span class="nt">&lt;Source&gt;</span>
    <span class="nt">&lt;/Group&gt;</span>
<span class="nt">&lt;/Sources&gt;</span>
</pre></div>
</div>
<p>Due to the <a class="reference internal" href="../../server/plugins/generators/packages.html#server-plugins-generators-packages-magic-groups"><em>&#8220;Magic Groups&#8221;</em></a>,
we need to modify our Metadata. Let&#8217;s add a <strong>fedora13</strong> group which
inherits a <strong>fedora</strong> group (this should replace the existing <strong>redhat</strong>
group) present in <tt class="docutils literal"><span class="pre">/var/lib/bcfg2/Metadata/groups.xml</span></tt>. The resulting
file should look something like this</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">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).</p>
</div>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Groups</span> <span class="na">version=</span><span class="s">&#39;3.0&#39;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">profile=</span><span class="s">&#39;true&#39;</span> <span class="na">public=</span><span class="s">&#39;true&#39;</span> <span class="na">default=</span><span class="s">&#39;true&#39;</span> <span class="na">name=</span><span class="s">&#39;basic&#39;</span><span class="nt">&gt;</span>
       <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;fedora13&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;/Group&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;fedora13&#39;</span><span class="nt">/&gt;</span>
       <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;fedora&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;ubuntu&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;debian&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;freebsd&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;gentoo&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;fedora&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;suse&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;mandrake&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;solaris&#39;</span><span class="nt">/&gt;</span>
 <span class="nt">&lt;/Groups&gt;</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">When editing your xml files by hand, it is useful to occasionally
run <tt class="docutils literal"><span class="pre">bcfg2-lint</span></tt> to ensure that your xml validates properly.</p>
</div>
</div>
<div class="section" id="add-a-probe">
<h4>Add a probe<a class="headerlink" href="#add-a-probe" title="Permalink to this headline">¶</a></h4>
<p>The next step for the client will be to have the proper
arch group membership. For this, we will make use of the
<a class="reference internal" href="../../unsorted/dynamic_groups.html#unsorted-dynamic-groups"><em>Dynamic Groups</em></a> capabilities of the Probes plugin. Add
<strong>Probes</strong> to your plugins line in <tt class="docutils literal"><span class="pre">bcfg2.conf</span></tt> and create the Probe:</p>
<div class="highlight-sh"><div class="highlight"><pre><span class="nv">$ </span>su -c <span class="s1">&#39;mkdir /var/lib/bcfg2/Probes&#39;</span>
<span class="nv">$ </span>su -c <span class="s1">&#39;cat /var/lib/bcfg2/Probes/groups&#39;</span>
<span class="c">#!/bin/sh</span>

<span class="nb">echo</span> <span class="s2">&quot;group:`uname -m`&quot;</span>
</pre></div>
</div>
<p>Now a restart of <tt class="docutils literal"><span class="pre">bcfg2-server</span></tt> is needed:</p>
<div class="highlight-python"><pre>$ su -c '/etc/init.d/bcfg2-server restart'</pre>
</div>
<p>To test the Probe just run <tt class="docutils literal"><span class="pre">bcfg2</span> <span class="pre">-vqn</span></tt>.</p>
<div class="highlight-xml"><div class="highlight"><pre>$ su -c &#39;bcfg2 -vqn&#39;
Running probe group
Probe group has result:
group:i686
...
</pre></div>
</div>
</div>
<div class="section" id="start-managing-packages">
<h4>Start managing packages<a class="headerlink" href="#start-managing-packages" title="Permalink to this headline">¶</a></h4>
<p>Add a base-packages bundle. Let&#8217;s see what happens when we just populate
it with the <em>yum</em> package. Create the <tt class="docutils literal"><span class="pre">base-packages.xml</span></tt> in your
<tt class="docutils literal"><span class="pre">Bundler/</span></tt> directory with a entry for <tt class="docutils literal"><span class="pre">yum</span></tt>.</p>
<div class="highlight-xml"><div class="highlight"><pre>$ cat /var/lib/bcfg2/Bundler/base-packages.xml
<span class="nt">&lt;Bundle</span> <span class="na">name=</span><span class="s">&#39;base-packages&#39;</span><span class="nt">&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;yum&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/Bundle&gt;</span>
</pre></div>
</div>
<p>You need to reference the bundle from your <tt class="docutils literal"><span class="pre">group.xml</span></tt>. The resulting
profile group might look something like this</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Group</span> <span class="na">profile=</span><span class="s">&#39;true&#39;</span> <span class="na">public=</span><span class="s">&#39;true&#39;</span> <span class="na">default=</span><span class="s">&#39;true&#39;</span> <span class="na">name=</span><span class="s">&#39;basic&#39;</span><span class="nt">&gt;</span>
   <span class="nt">&lt;Bundle</span> <span class="na">name=</span><span class="s">&#39;base-packages&#39;</span><span class="nt">/&gt;</span>
   <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;fedora13&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/Group&gt;</span>
</pre></div>
</div>
<p>Now if we run the client, we can see what this has done for us.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">output</span>
</pre></div>
</div>
<p>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 <strong>Unmanaged</strong> entries section
to the <strong>Managed</strong> entries section. So, what exactly <em>are</em> those
Unmanaged entries?:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">output</span>
</pre></div>
</div>
<p>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</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Bundle</span> <span class="na">name=</span><span class="s">&#39;base-packages&#39;</span><span class="nt">&gt;</span>

<span class="nt">&lt;/Bundle&gt;</span>
</pre></div>
</div>
<p>Now when I run the client, you can see I have only one unmanaged
package:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">outout</span>
</pre></div>
</div>
<p>The gpg-pubkey packages are special in that they are not really
packages. Currently, the way to manage them is using
<a class="reference internal" href="../../server/configurationentries.html#boundentries"><em>BoundEntries</em></a>. So, after adding them, our
Bundle now looks like this</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This does not actually control the contents of the files,
you will need to do this part separately (see below).</p>
</div>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Bundle</span> <span class="na">name=</span><span class="s">&#39;base-packages&#39;</span><span class="nt">&gt;</span>
        <span class="nt">&lt;BoundPackage</span> <span class="na">name=</span><span class="s">&quot;gpg-pubkey&quot;</span> <span class="na">type=</span><span class="s">&quot;rpm&quot;</span> <span class="na">version=</span><span class="s">&quot;foo&quot;</span><span class="nt">&gt;</span>
                        <span class="nt">&lt;Instance</span> <span class="na">simplefile=</span><span class="s">&quot;/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5&quot;</span> <span class="na">version=</span><span class="s">&quot;e8562897&quot;</span> <span class="na">release=</span><span class="s">&quot;459f07a4&quot;</span><span class="nt">/&gt;</span>
                        <span class="nt">&lt;Instance</span> <span class="na">simplefile=</span><span class="s">&quot;/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL&quot;</span> <span class="na">version=</span><span class="s">&quot;217521f6&quot;</span> <span class="na">release=</span><span class="s">&quot;45e8a532&quot;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;/BoundPackage&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;bcfg2-server&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;exim&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;grub&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;kernel&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;krb5-workstation&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;m2crypto&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;openssh-clients&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;openssh-server&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;prelink&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;redhat-lsb&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;rpm-build&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;rsync&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;sysklogd&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;vim-enhanced&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;yum&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/Bundle&gt;</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">version=&#8221;foo&#8221; is just a dummy attribute for the gpg-pubkey Package</p>
</div>
<p>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</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Bundle</span> <span class="na">name=</span><span class="s">&#39;base-packages&#39;</span><span class="nt">&gt;</span>
        <span class="nt">&lt;Path</span> <span class="na">name=</span><span class="s">&#39;/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Path</span> <span class="na">name=</span><span class="s">&#39;/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;BoundPackage</span> <span class="na">name=</span><span class="s">&quot;gpg-pubkey&quot;</span> <span class="na">type=</span><span class="s">&quot;rpm&quot;</span> <span class="na">version=</span><span class="s">&quot;foo&quot;</span><span class="nt">&gt;</span>
                        <span class="nt">&lt;Instance</span> <span class="na">simplefile=</span><span class="s">&quot;/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5&quot;</span> <span class="na">version=</span><span class="s">&quot;e8562897&quot;</span> <span class="na">release=</span><span class="s">&quot;459f07a4&quot;</span><span class="nt">/&gt;</span>
                        <span class="nt">&lt;Instance</span> <span class="na">simplefile=</span><span class="s">&quot;/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL&quot;</span> <span class="na">version=</span><span class="s">&quot;217521f6&quot;</span> <span class="na">release=</span><span class="s">&quot;45e8a532&quot;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;/BoundPackage&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;bcfg2-server&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;exim&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;grub&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;kernel&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;krb5-workstation&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;m2crypto&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;openssh-clients&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;openssh-server&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;prelink&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;redhat-lsb&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;rpm-build&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;rsync&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;sysklogd&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;vim-enhanced&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;yum&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/Bundle&gt;</span>
</pre></div>
</div>
<p>Then add the files to Cfg:</p>
<div class="highlight-python"><pre>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</pre>
</div>
<p>Now, running the client shows only unmanaged Service entries. Woohoo!</p>
</div>
<div class="section" id="manage-services">
<h4>Manage services<a class="headerlink" href="#manage-services" title="Permalink to this headline">¶</a></h4>
<p>Now let&#8217;s clear up the unmanaged service entries by adding the
following entries to our bundle...</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="c">&lt;!-- basic services --&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;atd&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;avahi-daemon&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;bcfg2-server&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;crond&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;cups&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;gpm&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;lvm2-monitor&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;mcstrans&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;messagebus&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;netfs&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;network&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;postfix&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;rawdevices&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;sshd&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;syslog&#39;</span><span class="nt">/&gt;</span>
</pre></div>
</div>
<p>...and bind them in Rules</p>
<div class="highlight-xml"><div class="highlight"><pre>[root@centos ~]# cat /var/lib/bcfg2/Rules/services.xml
<span class="nt">&lt;Rules</span> <span class="na">priority=</span><span class="s">&#39;1&#39;</span><span class="nt">&gt;</span>
        <span class="c">&lt;!-- basic services --&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;atd&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;avahi-daemon&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;bcfg2-server&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;crond&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;cups&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;gpm&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;lvm2-monitor&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;mcstrans&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;messagebus&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;netfs&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;network&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;postfix&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;rawdevices&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;sshd&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;chkconfig&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;syslog&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/Rules&gt;</span>
</pre></div>
</div>
<p>Now we run the client and see there are no more unmanaged entries!</p>
<div class="highlight-python"><pre>$ su -c 'bcfg2 -veqn'</pre>
</div>
</div>
<div class="section" id="adding-plugins">
<h4>Adding Plugins<a class="headerlink" href="#adding-plugins" title="Permalink to this headline">¶</a></h4>
</div>
</div>
<div class="section" id="git">
<h3>Git<a class="headerlink" href="#git" title="Permalink to this headline">¶</a></h3>
<p>Adding the <a class="reference internal" href="../../server/plugins/version/git.html#server-plugins-version-git"><em>Git</em></a> plugins can preserve
versioning information. The first step is to add <em>Git</em> to your
plugin line:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">plugins</span> <span class="o">=</span> <span class="n">Base</span><span class="p">,</span><span class="n">Bundler</span><span class="p">,</span><span class="n">Cfg</span><span class="p">,</span><span class="o">...</span><span class="p">,</span><span class="n">Git</span>
</pre></div>
</div>
<p>For tracking the configuration files in the <tt class="docutils literal"><span class="pre">/var/lib/bcfg2</span></tt>
directory a git repository need to be established:</p>
<div class="highlight-python"><pre>git init</pre>
</div>
<p>For more detail about the setup of git please refer to a <a class="reference external" href="http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html">git tutorial</a>.
The first commit can be the empty or the allready populated directory:</p>
<div class="highlight-python"><pre>git add . &amp;&amp; git commit -a</pre>
</div>
<p>While running <tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> the following line will show up:</p>
<div class="highlight-python"><pre>Initialized git plugin with git directory = /var/lib/bcfg2/.git</pre>
</div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Fedora</a><ul>
<li><a class="reference internal" href="#prerequisites">Prerequisites</a></li>
<li><a class="reference internal" href="#install-bcfg2-from-rpm">Install Bcfg2 From RPM</a></li>
<li><a class="reference internal" href="#initialize-your-repository">Initialize your repository</a></li>
<li><a class="reference internal" href="#start-the-server">Start the server</a><ul>
<li><a class="reference internal" href="#add-the-machines-to-bcfg2">Add the machines to Bcfg2</a></li>
<li><a class="reference internal" href="#bring-your-first-machine-under-bcfg2-control">Bring your first machine under Bcfg2 control</a><ul>
<li><a class="reference internal" href="#setup-the-server-plugins-generators-packages-plugin">Setup the <tt class="docutils literal"><span class="pre">server-plugins-generators-packages</span></tt> plugin</a></li>
<li><a class="reference internal" href="#add-a-probe">Add a probe</a></li>
<li><a class="reference internal" href="#start-managing-packages">Start managing packages</a></li>
<li><a class="reference internal" href="#manage-services">Manage services</a></li>
<li><a class="reference internal" href="#adding-plugins">Adding Plugins</a></li>
</ul>
</li>
<li><a class="reference internal" href="#git">Git</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="converging_rhel5.html"
                        title="previous chapter">Converging on Verification with RHEL 5</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="gentoo.html"
                        title="next chapter">Gentoo</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/appendix/guides/fedora.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="gentoo.html" title="Gentoo"
             >next</a> |</li>
        <li class="right" >
          <a href="converging_rhel5.html" title="Converging on Verification with RHEL 5"
             >previous</a> |</li>
	<li><a href="../../index.html">home</a> |&nbsp;</li>
	<!--<li><a href="../../search.html">search</a> |&nbsp;</li>-->
	<li><a href="../../help/index.html">help</a> |&nbsp;</li>
	<li><a href="../../contents.html">documentation </a> &raquo;</li>

          <li><a href="../../contents.html" >Bcfg2 documentation 1.3.0</a> &raquo;</li>
          <li><a href="../index.html" >Appendix</a> &raquo;</li>
          <li><a href="../guides.html" >Guides</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2013, Narayan Desai.
      Last updated on Mar 20, 2013.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>