Sophie

Sophie

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

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>Ubuntu &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="Using Bcfg2 With CentOS" href="using-bcfg2-with-centos.html" />
    <link rel="prev" title="NAT HOWTO" href="nat_howto.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="using-bcfg2-with-centos.html" title="Using Bcfg2 With CentOS"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="nat_howto.html" title="NAT HOWTO"
             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="ubuntu">
<span id="appendix-guides-ubuntu"></span><h1>Ubuntu<a class="headerlink" href="#ubuntu" title="Permalink to this headline">¶</a></h1>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This particular how to was done on lucid, but should apply to any
other <a class="reference external" href="https://wiki.ubuntu.com/Releases">stable</a> version of Ubuntu.</p>
</div>
<div class="section" id="install-bcfg2">
<h2>Install Bcfg2<a class="headerlink" href="#install-bcfg2" title="Permalink to this headline">¶</a></h2>
<p>We first need to install the server. For this example, we will use the
bcfg2 server package from the bcfg2 <a class="reference external" href="https://launchpad.net/~bcfg2/+archive/ppa">PPA</a> (note that there is also a
version available in the ubuntu archives, but it is not as up to date).</p>
<div class="section" id="add-the-ubuntu-ppa-listing-to-your-apt-sources">
<h3>Add the Ubuntu PPA listing to your APT sources<a class="headerlink" href="#add-the-ubuntu-ppa-listing-to-your-apt-sources" title="Permalink to this headline">¶</a></h3>
<p>See <a class="reference external" href="http://trac.mcs.anl.gov/projects/bcfg2/wiki/PrecompiledPackages#UbuntuLucid">http://trac.mcs.anl.gov/projects/bcfg2/wiki/PrecompiledPackages#UbuntuLucid</a></p>
</div>
<div class="section" id="install-bcfg2-server">
<h3>Install bcfg2-server<a class="headerlink" href="#install-bcfg2-server" title="Permalink to this headline">¶</a></h3>
<div class="highlight-python"><pre>aptitude install bcfg2-server</pre>
</div>
<p>Remove the default configuration preseeded by the ubuntu package:</p>
<div class="highlight-python"><pre>root@lucid:~# rm -rf /etc/bcfg2* /var/lib/bcfg2</pre>
</div>
</div>
</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 intialize your
repository and setup your bcfg2.conf. bcfg2-admin init is a tool which
allows you to automate this process.:</p>
<div class="highlight-python"><pre>root@lucid:~# bcfg2-admin init
Store bcfg2 configuration in [/etc/bcfg2.conf]:
Location of bcfg2 repository [/var/lib/bcfg2]:
Input password used for communication verification (without echoing; leave blank for a random):
What is the server's hostname: [lucid]
Input the server location [https://lucid:6789]:
Input base Operating System for clients:
1: Redhat/Fedora/RHEL/RHAS/Centos
2: SUSE/SLES
3: Mandrake
4: Debian
5: Ubuntu
6: Gentoo
7: FreeBSD
: 5
Generating a 2048 bit RSA private key
......................................................................................+++
...+++
writing new private key to '/etc/bcfg2.key'
-----
Signature ok
subject=/C=US/ST=Illinois/L=Argonne/CN=lucid
Getting Private key
Repository created successfuly in /var/lib/bcfg2</pre>
</div>
<p>Of course, 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>root@lucid:~# /etc/init.d/bcfg2-server start
root@lucid:~# tail /var/log/syslog
Dec 17 22:07:02 lucid bcfg2-server[17523]: serving bcfg2-server at https://lucid:6789
Dec 17 22:07:02 lucid bcfg2-server[17523]: serve_forever() [start]
Dec 17 22:07:02 lucid bcfg2-server[17523]: Processed 16 fam events in 0.502 seconds. 0 coalesced</pre>
</div>
<p>Run bcfg2 to be sure you are able to communicate with the server:</p>
<div class="highlight-python"><pre>root@lucid:~# bcfg2 -vqn
Loaded tool drivers:
 APT      Action   DebInit  POSIX

Phase: initial
Correct entries:        0
Incorrect entries:      0
Total managed entries:  0
Unmanaged entries:      382


Phase: final
Correct entries:        0
Incorrect entries:      0
Total managed entries:  0
Unmanaged entries:      382</pre>
</div>
</div>
<div class="section" id="bring-your-first-machine-under-bcfg2-control">
<h2>Bring your first machine under Bcfg2 control<a class="headerlink" href="#bring-your-first-machine-under-bcfg2-control" title="Permalink to this headline">¶</a></h2>
<p>Now it is time to get your first machine&#8217;s configuration into your Bcfg2
repository. Let&#8217;s start with the server itself.</p>
<div class="section" id="setup-the-server-plugins-generators-packages-plugin">
<h3>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></h3>
<p>Replace Pkgmgr with Packages in the plugins line of <tt class="docutils literal"><span class="pre">bcfg2.conf</span></tt>:</p>
<div class="highlight-python"><pre>root@lucid:~# cat /etc/bcfg2.conf
[server]
repository = /var/lib/bcfg2
plugins = SSHbase,Cfg,Packages,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.
#&lt;repository&gt;/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 = secret
certificate = /etc/bcfg2.crt
key = /etc/bcfg2.key
ca = /etc/bcfg2.crt

[components]
bcfg2 = https://lucid:6789</pre>
</div>
<p>Create Packages layout (as per <a class="reference internal" href="../../server/plugins/generators/packages.html#packages-exampleusage"><em>Example usage</em></a>) in
<tt class="docutils literal"><span class="pre">/var/lib/bcfg2</span></tt></p>
<div class="highlight-xml"><div class="highlight"><pre>root@lucid:~# mkdir /var/lib/bcfg2/Packages
root@lucid:~# cat /var/lib/bcfg2/Packages/packages.conf
[global]
root@lucid:~# cat /var/lib/bcfg2/Packages/sources.xml
<span class="nt">&lt;Sources&gt;</span>
  <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&quot;ubuntu-lucid&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Source</span> <span class="na">type=</span><span class="s">&quot;apt&quot;</span> <span class="na">url=</span><span class="s">&quot;http://archive.ubuntu.com/ubuntu&quot;</span> <span class="na">version=</span><span class="s">&quot;lucid&quot;</span><span class="nt">&gt;</span>
      <span class="nt">&lt;Component&gt;</span>main<span class="nt">&lt;/Component&gt;</span>
      <span class="nt">&lt;Component&gt;</span>multiverse<span class="nt">&lt;/Component&gt;</span>
      <span class="nt">&lt;Component&gt;</span>restricted<span class="nt">&lt;/Component&gt;</span>
      <span class="nt">&lt;Component&gt;</span>universe<span class="nt">&lt;/Component&gt;</span>
      <span class="nt">&lt;Arch&gt;</span>amd64<span class="nt">&lt;/Arch&gt;</span>
    <span class="nt">&lt;/Source&gt;</span>
    <span class="nt">&lt;Source</span> <span class="na">type=</span><span class="s">&quot;apt&quot;</span> <span class="na">url=</span><span class="s">&quot;http://archive.ubuntu.com/ubuntu&quot;</span> <span class="na">version=</span><span class="s">&quot;lucid-updates&quot;</span><span class="nt">&gt;</span>
      <span class="nt">&lt;Component&gt;</span>main<span class="nt">&lt;/Component&gt;</span>
      <span class="nt">&lt;Component&gt;</span>multiverse<span class="nt">&lt;/Component&gt;</span>
      <span class="nt">&lt;Component&gt;</span>restricted<span class="nt">&lt;/Component&gt;</span>
      <span class="nt">&lt;Component&gt;</span>universe<span class="nt">&lt;/Component&gt;</span>
      <span class="nt">&lt;Arch&gt;</span>amd64<span class="nt">&lt;/Arch&gt;</span>
    <span class="nt">&lt;/Source&gt;</span>
    <span class="nt">&lt;Source</span> <span class="na">type=</span><span class="s">&quot;apt&quot;</span> <span class="na">url=</span><span class="s">&quot;http://security.ubuntu.com/ubuntu&quot;</span> <span class="na">version=</span><span class="s">&quot;lucid-security&quot;</span><span class="nt">&gt;</span>
      <span class="nt">&lt;Component&gt;</span>main<span class="nt">&lt;/Component&gt;</span>
      <span class="nt">&lt;Component&gt;</span>multiverse<span class="nt">&lt;/Component&gt;</span>
      <span class="nt">&lt;Component&gt;</span>restricted<span class="nt">&lt;/Component&gt;</span>
      <span class="nt">&lt;Component&gt;</span>universe<span class="nt">&lt;/Component&gt;</span>
      <span class="nt">&lt;Arch&gt;</span>amd64<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 an <strong>ubuntu-lucid</strong>
group which inherits the <strong>ubuntu</strong> group already 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 APTSource above is specific to the lucid release of ubuntu.
That is, it should not apply to other releases (hardy, maverick, 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;ubuntu-lucid&#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;ubuntu-lucid&#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&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;redhat&#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
<cite>bcfg2-lint</cite> to ensure that your xml validates properly.</p>
</div>
<p>The last thing we need is for the client 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
Probes 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>root@lucid:~# grep plugins /etc/bcfg2.conf
<span class="nv">plugins</span> <span class="o">=</span> Base,Bundler,Cfg,...,Probes
root@lucid:~# mkdir /var/lib/bcfg2/Probes
root@lucid:~# cat /var/lib/bcfg2/Probes/groups
<span class="c">#!/bin/sh</span>

<span class="nv">ARCH</span><span class="o">=</span><span class="sb">`</span>uname -m<span class="sb">`</span>
<span class="k">case</span> <span class="s2">&quot;$ARCH&quot;</span> in
    <span class="s2">&quot;x86_64&quot;</span><span class="o">)</span>
        <span class="nb">echo</span> <span class="s2">&quot;group:amd64&quot;</span>
    ;;
    <span class="s2">&quot;i686&quot;</span><span class="o">)</span>
        <span class="nb">echo</span> <span class="s2">&quot;group:i386&quot;</span>
    ;;
<span class="k">esac</span>
</pre></div>
</div>
<p>Now we restart the bcfg2-server:</p>
<div class="highlight-python"><pre>root@lucid:~# /etc/init.d/bcfg2-server restart
Stopping Configuration Management Server:  * bcfg2-server
Starting Configuration Management Server:  * bcfg2-server
root@lucid:~# tail /var/log/syslog
Dec 17 22:36:47 lucid bcfg2-server[17937]: Packages: File read failed; falling back to file download
Dec 17 22:36:47 lucid bcfg2-server[17937]: Packages: Updating http://us.archive.ubuntu.com/ubuntu//dists/lucid/main/binary-amd64/Packages.gz
Dec 17 22:36:54 lucid bcfg2-server[17937]: Packages: Updating http://us.archive.ubuntu.com/ubuntu//dists/lucid/multiverse/binary-amd64/Packages.gz
Dec 17 22:36:55 lucid bcfg2-server[17937]: Packages: Updating http://us.archive.ubuntu.com/ubuntu//dists/lucid/restricted/binary-amd64/Packages.gz
Dec 17 22:36:56 lucid bcfg2-server[17937]: Packages: Updating http://us.archive.ubuntu.com/ubuntu//dists/lucid/universe/binary-amd64/Packages.gz
Dec 17 22:37:27 lucid bcfg2-server[17937]: Failed to read file probed.xml
Dec 17 22:37:27 lucid bcfg2-server[17937]: Loading experimental plugin(s): Packages
Dec 17 22:37:27 lucid bcfg2-server[17937]: NOTE: Interfaces subject to change
Dec 17 22:37:27 lucid bcfg2-server[17937]: service available at https://lucid:6789
Dec 17 22:37:27 lucid bcfg2-server[17937]: serving bcfg2-server at https://lucid:6789
Dec 17 22:37:27 lucid bcfg2-server[17937]: serve_forever() [start]
Dec 17 22:37:28 lucid bcfg2-server[17937]: Processed 17 fam events in 0.502 seconds. 0 coalesced</pre>
</div>
</div>
<div class="section" id="start-managing-packages">
<h3>Start managing packages<a class="headerlink" href="#start-managing-packages" title="Permalink to this headline">¶</a></h3>
<p>Add a base-packages bundle. Let&#8217;s see what happens when we just populate
it with the ubuntu-standard package.</p>
<div class="highlight-xml"><div class="highlight"><pre>root@lucid:~# 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;ubuntu-standard&#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 Metadata. 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;ubuntu-lucid&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/Group&gt;</span>
</pre></div>
</div>
<p>Now if we run the client in debug mode (-d), we can see what this has
done for us.:</p>
<div class="highlight-python"><pre>root@lucid:~# bcfg2 -vqdn
Running probe groups
Probe groups has result:
amd64
Loaded tool drivers:
 APT      Action   DebInit  POSIX
The following packages are specified in bcfg2:
 ubuntu-standard
The following packages are prereqs added by Packages:
 adduser             debconf             hdparm              libdevmapper1.02.1  libk5crypto3        libparted1.8-12     libxml2             passwd              upstart
 apt                 debianutils         info                libdns53            libkeyutils1        libpci3             logrotate           pciutils            usbutils
 aptitude            dmidecode           install-info        libelf1             libkrb5-3           libpopt0            lsb-base            perl-base           wget
 at                  dnsutils            iptables            libept0             libkrb5support0     libreadline5        lshw                popularity-contest  zlib1g
 base-files          dosfstools          libacl1             libgcc1             liblwres50          libreadline6        lsof                psmisc
 base-passwd         dpkg                libattr1            libgdbm3            libmagic1           libselinux1         ltrace              readline-common
 bsdmainutils        ed                  libbind9-50         libgeoip1           libmpfr1ldbl        libsigc++-2.0-0c2a  man-db              rsync
 bsdutils            file                libc-bin            libgmp3c2           libncurses5         libssl0.9.8         memtest86+          sed
 cpio                findutils           libc6               libgssapi-krb5-2    libncursesw5        libstdc++6          mime-support        sensible-utils
 cpp                 ftp                 libcap2             libisc50            libpam-modules      libusb-0.1-4        ncurses-bin         strace
 cpp-4.4             gcc-4.4-base        libcomerr2          libisccc50          libpam-runtime      libuuid1            netbase             time
 cron                groff-base          libcwidget3         libisccfg50         libpam0g            libxapian15         parted              tzdata

Phase: initial
Correct entries:        101
Incorrect entries:      0
Total managed entries:  101
Unmanaged entries:      281


Phase: final
Correct entries:        101
Incorrect entries:      0
Total managed entries:  101
Unmanaged entries:      281</pre>
</div>
<p>As you can see, the Packages plugin has generated the dependencies
required for the ubuntu-standard package for us 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"><pre>root@lucid:~# bcfg2 -vqen
Running probe groups
Probe groups has result:
amd64
Loaded tool drivers:
 APT      Action   DebInit  POSIX

Phase: initial
Correct entries:        101
Incorrect entries:      0
Total managed entries:  101
Unmanaged entries:      281


Phase: final
Correct entries:        101
Incorrect entries:      0
Total managed entries:  101
Unmanaged entries:      281
 Package:apparmor
 Package:apparmor-utils
 Package:apport
 ...</pre>
</div>
<p>Now you can go through these and continue adding the packages you want to
your Bundle. Note that <tt class="docutils literal"><span class="pre">aptitude</span> <span class="pre">why</span></tt> is useful when trying to figure
out the reason for a package being installed. Also, deborphan is helpful
for removing leftover dependencies which are no longer needed. 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;Package</span> <span class="na">name=</span><span class="s">&#39;bash-completion&#39;</span><span class="nt">/&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;debconf-i18n&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;deborphan&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;diffutils&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;e2fsprogs&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;fam&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;grep&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;grub-pc&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;gzip&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;hostname&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;krb5-config&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;krb5-user&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;language-pack-en-base&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;linux-generic&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;linux-headers-generic&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;login&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;manpages&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;mlocate&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;ncurses-base&#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;python-fam&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;tar&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;ubuntu-minimal&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;ubuntu-standard&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;vim&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;vim-runtime&#39;</span><span class="nt">/&gt;</span>

        <span class="c">&lt;!-- PreDepends --&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;dash&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;initscripts&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;libdbus-1-3&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;libnih-dbus1&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;lzma&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;mountall&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;sysvinit-utils&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;sysv-rc&#39;</span><span class="nt">/&gt;</span>

        <span class="c">&lt;!-- vim dependencies --&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;libgpm2&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;libpython2.6&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/Bundle&gt;</span>
</pre></div>
</div>
<p>As you can see below, I no longer have any unmanaged packages.</p>
<div class="highlight-python"><pre>root@lucid:~# bcfg2 -vqen
Running probe groups
Probe groups has result:
amd64
Loaded tool drivers:
 APT      Action   DebInit  POSIX

Phase: initial
Correct entries:        247
Incorrect entries:      0
Total managed entries:  247
Unmanaged entries:      10


Phase: final
Correct entries:        247
Incorrect entries:      0
Total managed entries:  247
Unmanaged entries:      10
 Service:bcfg2         Service:fam           Service:killprocs     Service:rc.local      Service:single
 Service:bcfg2-server  Service:grub-common   Service:ondemand      Service:rsync         Service:ssh</pre>
</div>
</div>
<div class="section" id="manage-services">
<h3>Manage services<a class="headerlink" href="#manage-services" title="Permalink to this headline">¶</a></h3>
<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;bcfg2&#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;fam&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;grub-common&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;killprocs&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;ondemand&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;rc.local&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;rsync&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;single&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;ssh&#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@lucid:~# 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;deb&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;bcfg2&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;deb&#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;deb&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;fam&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;deb&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;grub-common&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;deb&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;killprocs&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;deb&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;ondemand&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;deb&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;rc.local&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;deb&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;rsync&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;deb&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;single&#39;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;Service</span> <span class="na">type=</span><span class="s">&#39;deb&#39;</span> <span class="na">status=</span><span class="s">&#39;on&#39;</span> <span class="na">name=</span><span class="s">&#39;ssh&#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>root@lucid:~# bcfg2 -vqn
Running probe groups
Probe groups has result:
amd64
Loaded tool drivers:
 APT      Action   DebInit  POSIX

Phase: initial
Correct entries:        257
Incorrect entries:      0
Total managed entries:  257
Unmanaged entries:      0

All entries correct.

Phase: final
Correct entries:        257
Incorrect entries:      0
Total managed entries:  257
Unmanaged entries:      0

All entries correct.</pre>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This basic bundle is created mainly for the purposes of getting you
to a completely managed client. It is recommended that you create
bundles for appropriate services due to the way bundle updates are
managed. Please see <a class="reference internal" href="../../unsorted/writing_specification.html#unsorted-writing-specification"><em>Writing Bcfg2 Specification</em></a> for more
details.</p>
</div>
<div class="section" id="upstart">
<h4>Upstart<a class="headerlink" href="#upstart" title="Permalink to this headline">¶</a></h4>
<p>Upstart services are defined like this:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&quot;cron&quot;</span> <span class="na">status=</span><span class="s">&quot;on&quot;</span>  <span class="na">type=</span><span class="s">&quot;upstart&quot;</span><span class="nt">/&gt;</span>
</pre></div>
</div>
<p>Some Upstart services require additional parameters, like network-interface and bridge-network-interface:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&quot;network-interface&quot;</span> <span class="na">status=</span><span class="s">&quot;on&quot;</span> <span class="na">type=</span><span class="s">&quot;upstart&quot;</span> <span class="na">parameters=</span><span class="s">&quot;INTERFACE=eth0&quot;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&quot;bridge-network-interface&quot;</span> <span class="na">status=</span><span class="s">&quot;on&quot;</span> <span class="na">type=</span><span class="s">&quot;upstart&quot;</span> <span class="na">parameters=</span><span class="s">&quot;INTERFACE=br0&quot;</span><span class="nt">/&gt;</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="dynamic-web-reports">
<h2>Dynamic (web) reports<a class="headerlink" href="#dynamic-web-reports" title="Permalink to this headline">¶</a></h2>
<p>See installation instructions at <a class="reference internal" href="web-reports-install.html#appendix-guides-web-reports-install"><em>Web Reporting Quickstart</em></a></p>
</div>
<div class="section" id="next-steps">
<h2>Next Steps<a class="headerlink" href="#next-steps" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="../../getting_started/index.html#getting-started-index-next-steps"><em>Next Steps</em></a></p>
</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="#">Ubuntu</a><ul>
<li><a class="reference internal" href="#install-bcfg2">Install Bcfg2</a><ul>
<li><a class="reference internal" href="#add-the-ubuntu-ppa-listing-to-your-apt-sources">Add the Ubuntu PPA listing to your APT sources</a></li>
<li><a class="reference internal" href="#install-bcfg2-server">Install bcfg2-server</a></li>
</ul>
</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></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="#start-managing-packages">Start managing packages</a></li>
<li><a class="reference internal" href="#manage-services">Manage services</a><ul>
<li><a class="reference internal" href="#upstart">Upstart</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#dynamic-web-reports">Dynamic (web) reports</a></li>
<li><a class="reference internal" href="#next-steps">Next Steps</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="nat_howto.html"
                        title="previous chapter">NAT HOWTO</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="using-bcfg2-with-centos.html"
                        title="next chapter">Using Bcfg2 With CentOS</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/appendix/guides/ubuntu.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="using-bcfg2-with-centos.html" title="Using Bcfg2 With CentOS"
             >next</a> |</li>
        <li class="right" >
          <a href="nat_howto.html" title="NAT HOWTO"
             >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>