<!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 — 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> | </li> <!--<li><a href="../../search.html">search</a> | </li>--> <li><a href="../../help/index.html">help</a> | </li> <li><a href="../../contents.html">documentation </a> »</li> <li><a href="../../contents.html" >Bcfg2 documentation 1.3.0</a> »</li> <li><a href="../index.html" >Appendix</a> »</li> <li><a href="../guides.html" accesskey="U">Guides</a> »</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’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’s configuration into your Bcfg2 repository. Let’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. #<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 = 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"><Sources></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">"ubuntu-lucid"</span><span class="nt">></span> <span class="nt"><Source</span> <span class="na">type=</span><span class="s">"apt"</span> <span class="na">url=</span><span class="s">"http://archive.ubuntu.com/ubuntu"</span> <span class="na">version=</span><span class="s">"lucid"</span><span class="nt">></span> <span class="nt"><Component></span>main<span class="nt"></Component></span> <span class="nt"><Component></span>multiverse<span class="nt"></Component></span> <span class="nt"><Component></span>restricted<span class="nt"></Component></span> <span class="nt"><Component></span>universe<span class="nt"></Component></span> <span class="nt"><Arch></span>amd64<span class="nt"></Arch></span> <span class="nt"></Source></span> <span class="nt"><Source</span> <span class="na">type=</span><span class="s">"apt"</span> <span class="na">url=</span><span class="s">"http://archive.ubuntu.com/ubuntu"</span> <span class="na">version=</span><span class="s">"lucid-updates"</span><span class="nt">></span> <span class="nt"><Component></span>main<span class="nt"></Component></span> <span class="nt"><Component></span>multiverse<span class="nt"></Component></span> <span class="nt"><Component></span>restricted<span class="nt"></Component></span> <span class="nt"><Component></span>universe<span class="nt"></Component></span> <span class="nt"><Arch></span>amd64<span class="nt"></Arch></span> <span class="nt"></Source></span> <span class="nt"><Source</span> <span class="na">type=</span><span class="s">"apt"</span> <span class="na">url=</span><span class="s">"http://security.ubuntu.com/ubuntu"</span> <span class="na">version=</span><span class="s">"lucid-security"</span><span class="nt">></span> <span class="nt"><Component></span>main<span class="nt"></Component></span> <span class="nt"><Component></span>multiverse<span class="nt"></Component></span> <span class="nt"><Component></span>restricted<span class="nt"></Component></span> <span class="nt"><Component></span>universe<span class="nt"></Component></span> <span class="nt"><Arch></span>amd64<span class="nt"></Arch></span> <span class="nt"></Source></span> <span class="nt"></Group></span> <span class="nt"></Sources></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>“Magic Groups”</em></a>, we need to modify our Metadata. Let’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"><Groups</span> <span class="na">version=</span><span class="s">'3.0'</span><span class="nt">></span> <span class="nt"><Group</span> <span class="na">profile=</span><span class="s">'true'</span> <span class="na">public=</span><span class="s">'true'</span> <span class="na">default=</span><span class="s">'true'</span> <span class="na">name=</span><span class="s">'basic'</span><span class="nt">></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'ubuntu-lucid'</span><span class="nt">/></span> <span class="nt"></Group></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'ubuntu-lucid'</span><span class="nt">></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'ubuntu'</span><span class="nt">/></span> <span class="nt"></Group></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'ubuntu'</span><span class="nt">/></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'debian'</span><span class="nt">/></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'freebsd'</span><span class="nt">/></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'gentoo'</span><span class="nt">/></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'redhat'</span><span class="nt">/></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'suse'</span><span class="nt">/></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'mandrake'</span><span class="nt">/></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'solaris'</span><span class="nt">/></span> <span class="nt"></Groups></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">"$ARCH"</span> in <span class="s2">"x86_64"</span><span class="o">)</span> <span class="nb">echo</span> <span class="s2">"group:amd64"</span> ;; <span class="s2">"i686"</span><span class="o">)</span> <span class="nb">echo</span> <span class="s2">"group:i386"</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’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"><Bundle</span> <span class="na">name=</span><span class="s">'base-packages'</span><span class="nt">></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'ubuntu-standard'</span><span class="nt">/></span> <span class="nt"></Bundle></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"><Group</span> <span class="na">profile=</span><span class="s">'true'</span> <span class="na">public=</span><span class="s">'true'</span> <span class="na">default=</span><span class="s">'true'</span> <span class="na">name=</span><span class="s">'basic'</span><span class="nt">></span> <span class="nt"><Bundle</span> <span class="na">name=</span><span class="s">'base-packages'</span><span class="nt">/></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'ubuntu-lucid'</span><span class="nt">/></span> <span class="nt"></Group></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"><Bundle</span> <span class="na">name=</span><span class="s">'base-packages'</span><span class="nt">></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'bash-completion'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'bcfg2-server'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'debconf-i18n'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'deborphan'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'diffutils'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'e2fsprogs'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'fam'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'grep'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'grub-pc'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'gzip'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'hostname'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'krb5-config'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'krb5-user'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'language-pack-en-base'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'linux-generic'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'linux-headers-generic'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'login'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'manpages'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'mlocate'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'ncurses-base'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'openssh-server'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'python-fam'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'tar'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'ubuntu-minimal'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'ubuntu-standard'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'vim'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'vim-runtime'</span><span class="nt">/></span> <span class="c"><!-- PreDepends --></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'dash'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'initscripts'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'libdbus-1-3'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'libnih-dbus1'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'lzma'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'mountall'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'sysvinit-utils'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'sysv-rc'</span><span class="nt">/></span> <span class="c"><!-- vim dependencies --></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'libgpm2'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'libpython2.6'</span><span class="nt">/></span> <span class="nt"></Bundle></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’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"><!-- basic services --></span> <span class="nt"><Service</span> <span class="na">name=</span><span class="s">'bcfg2'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">name=</span><span class="s">'bcfg2-server'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">name=</span><span class="s">'fam'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">name=</span><span class="s">'grub-common'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">name=</span><span class="s">'killprocs'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">name=</span><span class="s">'ondemand'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">name=</span><span class="s">'rc.local'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">name=</span><span class="s">'rsync'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">name=</span><span class="s">'single'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">name=</span><span class="s">'ssh'</span><span class="nt">/></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"><Rules</span> <span class="na">priority=</span><span class="s">'1'</span><span class="nt">></span> <span class="c"><!-- basic services --></span> <span class="nt"><Service</span> <span class="na">type=</span><span class="s">'deb'</span> <span class="na">status=</span><span class="s">'on'</span> <span class="na">name=</span><span class="s">'bcfg2'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">type=</span><span class="s">'deb'</span> <span class="na">status=</span><span class="s">'on'</span> <span class="na">name=</span><span class="s">'bcfg2-server'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">type=</span><span class="s">'deb'</span> <span class="na">status=</span><span class="s">'on'</span> <span class="na">name=</span><span class="s">'fam'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">type=</span><span class="s">'deb'</span> <span class="na">status=</span><span class="s">'on'</span> <span class="na">name=</span><span class="s">'grub-common'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">type=</span><span class="s">'deb'</span> <span class="na">status=</span><span class="s">'on'</span> <span class="na">name=</span><span class="s">'killprocs'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">type=</span><span class="s">'deb'</span> <span class="na">status=</span><span class="s">'on'</span> <span class="na">name=</span><span class="s">'ondemand'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">type=</span><span class="s">'deb'</span> <span class="na">status=</span><span class="s">'on'</span> <span class="na">name=</span><span class="s">'rc.local'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">type=</span><span class="s">'deb'</span> <span class="na">status=</span><span class="s">'on'</span> <span class="na">name=</span><span class="s">'rsync'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">type=</span><span class="s">'deb'</span> <span class="na">status=</span><span class="s">'on'</span> <span class="na">name=</span><span class="s">'single'</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">type=</span><span class="s">'deb'</span> <span class="na">status=</span><span class="s">'on'</span> <span class="na">name=</span><span class="s">'ssh'</span><span class="nt">/></span> <span class="nt"></Rules></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"><Service</span> <span class="na">name=</span><span class="s">"cron"</span> <span class="na">status=</span><span class="s">"on"</span> <span class="na">type=</span><span class="s">"upstart"</span><span class="nt">/></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"><Service</span> <span class="na">name=</span><span class="s">"network-interface"</span> <span class="na">status=</span><span class="s">"on"</span> <span class="na">type=</span><span class="s">"upstart"</span> <span class="na">parameters=</span><span class="s">"INTERFACE=eth0"</span><span class="nt">/></span> <span class="nt"><Service</span> <span class="na">name=</span><span class="s">"bridge-network-interface"</span> <span class="na">status=</span><span class="s">"on"</span> <span class="na">type=</span><span class="s">"upstart"</span> <span class="na">parameters=</span><span class="s">"INTERFACE=br0"</span><span class="nt">/></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> | </li> <!--<li><a href="../../search.html">search</a> | </li>--> <li><a href="../../help/index.html">help</a> | </li> <li><a href="../../contents.html">documentation </a> »</li> <li><a href="../../contents.html" >Bcfg2 documentation 1.3.0</a> »</li> <li><a href="../index.html" >Appendix</a> »</li> <li><a href="../guides.html" >Guides</a> »</li> </ul> </div> <div class="footer"> © 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>