<!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>Pkgmgr — 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="Plugins" href="../index.html" /> <link rel="next" title="Rules" href="rules.html" /> <link rel="prev" title="Packages" href="packages.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="rules.html" title="Rules" accesskey="N">next</a> |</li> <li class="right" > <a href="packages.html" title="Packages" 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" >The Bcfg2 Server</a> »</li> <li><a href="../index.html" accesskey="U">Plugins</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="pkgmgr"> <span id="server-plugins-generators-pkgmgr"></span><h1>Pkgmgr<a class="headerlink" href="#pkgmgr" title="Permalink to this headline">¶</a></h1> <p>The Pkgmgr plugin resolves the Abstract Configuration Entity “Package” to a package specification that the client can use to detect, verify and install the specified package.</p> <p>For a package specification to be included in the Literal configuration the name attribute from an Abstract Package Tag (from Base or Bundler) must match the name attribute of a Package tag in Pkgmgr, along with the appropriate group associations of course.</p> <p>Each file in the Pkgmgr directory has a priority. This allows the same package to be served by multiple files. The priorities can be used to break ties in the case that multiple files serve data for the same package.</p> <div class="section" id="usage-of-groups-in-pkgmgr"> <h2>Usage of Groups in Pkgmgr<a class="headerlink" href="#usage-of-groups-in-pkgmgr" title="Permalink to this headline">¶</a></h2> <p>Groups are used by the Pkgmgr plugin, along with host metadata, for selecting the package entries to include in the clients literal configuration. They can be thought of as:</p> <div class="highlight-python"><pre>if client is a member of group1 then assign to literal config</pre> </div> <p>Nested groups are conjunctive (logical and).:</p> <div class="highlight-python"><pre>if client is a member of group1 and group2 then assign to literal config</pre> </div> <p>Group membership may be negated.</p> </div> <div class="section" id="tag-attributes-in-pkgmgr"> <h2>Tag Attributes in Pkgmgr<a class="headerlink" href="#tag-attributes-in-pkgmgr" title="Permalink to this headline">¶</a></h2> <dl class="schema" id="schema:pkglist.xsd"> <dt id="schema:pkglist.xsd"> <!--[schema:pkglist.xsd]--><em>schema</em> <strong>pkglist.xsd</strong><a class="headerlink" href="#schema:pkglist.xsd" title="Permalink to this definition">¶</a></dt> </dt> <dd><blockquote class="first"> <div>package list schema for bcfg2 Narayan Desai, Argonne National Laboratory</div></blockquote> <dl class="last element" id="element:PackageList"> <dt id="element:PackageList"> <!--[element:PackageList]--><em>element</em> <strong>PackageList</strong><a class="headerlink" href="#element:PackageList" title="Permalink to this definition">¶</a></dt> </dt> <dd><blockquote class="first"> <div>The top-level tag in a <a class="reference internal" href="#server-plugins-generators-pkgmgr"><em>Pkgmgr</em></a> XML package list.</div></blockquote> <dl class="last docutils" id="complexType:PackageList"> <dt>Attributes:</dt> <dd><table border="1" class="first last docutils"> <colgroup> <col width="10%" /> <col width="50%" /> <col width="20%" /> <col width="10%" /> <col width="10%" /> </colgroup> <thead valign="bottom"> <tr class="row-odd"><th class="head">Name</th> <th class="head">Description</th> <th class="head">Values</th> <th class="head">Required</th> <th class="head">Default</th> </tr> </thead> <tbody valign="top"> <tr class="row-even"><td><span class="target" id="attribute:PackageList:priority"></span><tt class="docutils literal"><span class="pre">priority</span></tt></td> <td><blockquote class="first last"> <div>Sets the priority for rules in this file for <a class="reference internal" href="rules.html#server-plugins-generators-rules"><em>Rules</em></a>. The higher value wins.</div></blockquote> </td> <td><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#integer"><tt class="docutils literal"><span class="pre">integer</span></tt></a></td> <td>Yes</td> <td>None</td> </tr> <tr class="row-odd"><td><span class="target" id="attribute:PackageList:multiarch"></span><tt class="docutils literal"><span class="pre">multiarch</span></tt></td> <td><blockquote class="first last"> <div>Comma-separated list of architectures of packages in this package list that should be installed.</div></blockquote> </td> <td><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></td> <td>No</td> <td>None</td> </tr> <tr class="row-even"><td><span class="target" id="attribute:PackageList:srcs"></span><tt class="docutils literal"><span class="pre">srcs</span></tt></td> <td><blockquote class="first last"> <div>Filename creation rules for multiarch packages.</div></blockquote> </td> <td><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></td> <td>No</td> <td>None</td> </tr> <tr class="row-odd"><td><span class="target" id="attribute:PackageList:type"></span><tt class="docutils literal"><span class="pre">type</span></tt></td> <td><blockquote class="first last"> <div>The package type, which determines which client driver will handle installation of packages in this package list.</div></blockquote> </td> <td><tt class="docutils literal"><span class="pre">apk</span></tt> | <tt class="docutils literal"><span class="pre">ips</span></tt> | <tt class="docutils literal"><span class="pre">macport</span></tt> | <tt class="docutils literal"><span class="pre">opencsw</span></tt> | <tt class="docutils literal"><span class="pre">pacman</span></tt> | <tt class="docutils literal"><span class="pre">deb</span></tt> | <tt class="docutils literal"><span class="pre">rpm</span></tt> | <tt class="docutils literal"><span class="pre">blast</span></tt> | <tt class="docutils literal"><span class="pre">encap</span></tt> | <tt class="docutils literal"><span class="pre">sysv</span></tt> | <tt class="docutils literal"><span class="pre">ebuild</span></tt> | <tt class="docutils literal"><span class="pre">yum</span></tt> | <tt class="docutils literal"><span class="pre">freebsdpkg</span></tt></td> <td>No</td> <td>None</td> </tr> <tr class="row-even"><td><span class="target" id="attribute:PackageList:uri"></span><tt class="docutils literal"><span class="pre">uri</span></tt></td> <td><blockquote class="first last"> <div>The URI to the repository that data in this package list file was parsed from.</div></blockquote> </td> <td><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></td> <td>No</td> <td>None</td> </tr> </tbody> </table> </dd> <dt>Child elements:</dt> <dd><ul class="first last"> <li><dl class="element" id="element:Group"> <dt id="element:Group"> <!--[element:Group]--><em>element</em> <strong>Group</strong><a class="headerlink" href="#element:Group" title="Permalink to this definition">¶</a></dt> </dt> <dd><p class="first"></p> <p class="last">Type: <a class="reference internal" href="#complexType:PackageContainerType"><tt class="docutils literal"><span class="pre">PackageContainerType</span></tt></a></p> </dd> </dl> </li> <li><dl class="element" id="element:Client"> <dt id="element:Client"> <!--[element:Client]--><em>element</em> <strong>Client</strong><a class="headerlink" href="#element:Client" title="Permalink to this definition">¶</a></dt> </dt> <dd><p class="first"></p> <p class="last">Type: <a class="reference internal" href="#complexType:PackageContainerType"><tt class="docutils literal"><span class="pre">PackageContainerType</span></tt></a></p> </dd> </dl> </li> <li><dl class="element" id="element:Package"> <dt id="element:Package"> <!--[element:Package]--><em>element</em> <strong>Package</strong><a class="headerlink" href="#element:Package" title="Permalink to this definition">¶</a></dt> </dt> <dd><p class="first"></p> <p class="last">Type: <a class="reference internal" href="rules.html#complexType:PackageType"><tt class="docutils literal"><span class="pre">PackageType</span></tt></a></p> </dd> </dl> </li> </ul> </dd> </dl> </dd> </dl> </dd> </dl> <dl class="complexType" id="complexType:PackageContainerType"> <dt id="complexType:PackageContainerType"> <!--[complexType:PackageContainerType]--><em>complexType</em> <strong>PackageContainerType</strong><a class="headerlink" href="#complexType:PackageContainerType" title="Permalink to this definition">¶</a></dt> </dt> <dd><blockquote class="first"> <div>An <strong>PackageContainerType</strong> is a tag used to provide logic. Child entries of an PackageContainerType tag only apply to machines that match the condition specified – either membership in a group, or a matching client name. <a class="reference internal" href="#attribute:PackageContainerType:negate"><tt class="xref xml xml-attribute docutils literal"><span class="pre">negate</span></tt></a> can be set to negate the sense of the match.</div></blockquote> <dl class="last docutils"> <dt>Attributes:</dt> <dd><table border="1" class="first last docutils"> <colgroup> <col width="10%" /> <col width="50%" /> <col width="20%" /> <col width="10%" /> <col width="10%" /> </colgroup> <thead valign="bottom"> <tr class="row-odd"><th class="head">Name</th> <th class="head">Description</th> <th class="head">Values</th> <th class="head">Required</th> <th class="head">Default</th> </tr> </thead> <tbody valign="top"> <tr class="row-even"><td><span class="target" id="attribute:PackageContainerType:name"></span><tt class="docutils literal"><span class="pre">name</span></tt></td> <td><blockquote class="first last"> <div>The name of the client or group to match on. Child entries will only apply to this client or group (unless <a class="reference internal" href="#attribute:PackageContainerType:negate"><tt class="xref xml xml-attribute docutils literal"><span class="pre">negate</span></tt></a> is set).</div></blockquote> </td> <td><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></td> <td>No</td> <td>None</td> </tr> <tr class="row-odd"><td><span class="target" id="attribute:PackageContainerType:negate"></span><tt class="docutils literal"><span class="pre">negate</span></tt></td> <td><blockquote class="first last"> <div>Negate the sense of the match, so that child entries only apply to a client if it is not a member of the given group or does not have the given name.</div></blockquote> </td> <td><tt class="docutils literal"><span class="pre">true</span></tt> | <tt class="docutils literal"><span class="pre">false</span></tt></td> <td>No</td> <td>None</td> </tr> </tbody> </table> </dd> <dt>Child elements:</dt> <dd><ul class="first last simple"> <li><a class="reference internal" href="#element:Package"><tt class="docutils literal"><span class="pre">Package</span></tt></a></li> <li><a class="reference internal" href="../../info.html#element:Group"><tt class="docutils literal"><span class="pre">Group</span></tt></a></li> <li><a class="reference internal" href="../../info.html#element:Client"><tt class="docutils literal"><span class="pre">Client</span></tt></a></li> </ul> </dd> </dl> </dd> </dl> </div> <div class="section" id="pkgmgr-directory"> <h2>Pkgmgr Directory<a class="headerlink" href="#pkgmgr-directory" title="Permalink to this headline">¶</a></h2> <p>The Pkgmgr/ directory keeps the XML files that define what packages are available for a host or image and where to find those packages. All the files in the directory are processed.</p> <p>The names of the XML files have no special meaning to Bcfg2; they are simply named so it’s easy for the administrator to know what the contents hold. All Packages could be kept in a single file if so desired. Bcfg2 simply uses the Groups in the files and priorities to determine how to assign Packages to a host’s literal configuration.</p> <p>Listed detailed below is one possible structure for the Pkgmgr directory.</p> <p>The files are structured to contain particular portions of distribution repositories.</p> <p>The files in the directory are:</p> <div class="highlight-python"><pre>$ ls Pkgmgr/ centos-4-noarch-updates.xml centos-4-x86_64-updates.xml centos-4-x86_64.xml backup.example.com.xml fedora-core-4-noarch-updates.xml fedora-core-4-x86-updates.xml fedora-core-4-x86.xml rhel-as-4-noarch-updates.xml rhel-as-4-x86-updates.xml rhel-as-4-x86.xml rhel-es-4-noarch-updates.xml rhel-es-4-x86-updates.xml rhel-es-4-x86.xml rhel-ws-4-noarch-udpates.xml rhel-ws-4-x86_64-updates.xml rhel-ws-4-x86_64.xml rhel-ws-4-x86-updates.xml rhel-ws-4-x86.xml</pre> </div> <p>As can be seen the file names have been selected to indicate what the contents are and have been split by Vendor, product and repository area.</p> <p>A partial listing of the centos-4-x86_64.xml is below</p> <div class="highlight-xml"><div class="highlight"><pre>$ cat centos-4-x86_64.xml <span class="nt"><PackageList</span> <span class="na">uri=</span><span class="s">'http://www.example.com/yam/Centos44-x86_64/RPMS.os/'</span> <span class="na">type=</span><span class="s">'yum'</span> <span class="na">priority=</span><span class="s">'0'</span><span class="nt">></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'Centos4.4-Standard'</span><span class="nt">></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'x86_64'</span><span class="nt">></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'audit-libs'</span> <span class="na">version=</span><span class="s">'1.0.13-1.EL4'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'audit'</span> <span class="na">version=</span><span class="s">'1.0.13-1.EL4'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'basesystem'</span> <span class="na">version=</span><span class="s">'8.0-2'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'bash'</span> <span class="na">version=</span><span class="s">'3.0-18.1'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'bcfg2'</span> <span class="na">version=</span><span class="s">'0.9.1-0.1'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'beecrypt'</span> <span class="na">version=</span><span class="s">'3.1.0-3'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> ... <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'VMwareTools'</span> <span class="na">version=</span><span class="s">'6530-29996'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'yum'</span> <span class="na">version=</span><span class="s">'2.4.2-1'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'zlib'</span> <span class="na">version=</span><span class="s">'1.2.1.2-1.2'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"></Group></span> <span class="nt"></Group></span> <span class="nt"></PackageList></span> </pre></div> </div> <div class="highlight-xml"><div class="highlight"><pre>$ cat centos-4-x86_64-updates.xml <span class="nt"><PackageList</span> <span class="na">uri=</span><span class="s">'http://www.example.com/yam/Centos44-x86_64/RPMS.updates/'</span> <span class="na">type=</span><span class="s">'yum'</span> <span class="na">priority=</span><span class="s">'5'</span><span class="nt">></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'Centos4.4-Standard'</span><span class="nt">></span> <span class="nt"><Group</span> <span class="na">name=</span><span class="s">'x86_64'</span><span class="nt">></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'audit-libs'</span> <span class="na">version=</span><span class="s">'1.0.14-1.EL4'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'audit'</span> <span class="na">version=</span><span class="s">'1.0.14-1.EL4'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'basesystem'</span> <span class="na">version=</span><span class="s">'8.0-4'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'bash'</span> <span class="na">version=</span><span class="s">'3.0-19.3'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'bcfg2'</span> <span class="na">version=</span><span class="s">'0.9.2-0.1'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'beecrypt'</span> <span class="na">version=</span><span class="s">'3.1.0-6'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> ... <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'VMwareTools'</span> <span class="na">version=</span><span class="s">'6530-29996'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'yum'</span> <span class="na">version=</span><span class="s">'2.4.3-1'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'zlib'</span> <span class="na">version=</span><span class="s">'1.2.1.2-1.2'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"></Group></span> <span class="nt"></Group></span> <span class="nt"></PackageList></span> </pre></div> </div> <p>Here it can be seen that the data is encapsulated in a !PackageList Tag which describes the URI of the files described, the type of package, and the priority of the files in this list.</p> <p>The priority is used to decide which specific file to use when there are multiple files that could be used for a particular host. The highest priority file is the one that is used.</p> <p>Using this system, it is possible to have a file that contains all the Packages from the original installation, centos-4-x86_64.xml in this case, and then create a new file that contains updates that are made available afterwards, centos-4-x86_64-updates.xml and centos-4-noarch-updates.xml in this case. The priority of the update PackageLists just needs to be higher so that they will be selected instead of the original installation Packages.</p> <p>The backup.example.com.xml contains a packalist for a specific host which is qualified by the Client tag. Its Packages have a higher priority than the update Packages. This is because this particular host requires special Packages that are older than the ones available in the updates.</p> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><PackageList</span> <span class="na">uri=</span><span class="s">'http://www.example.com/yam/Centos44-x86_64/RPMS.os/'</span> <span class="na">type=</span><span class="s">'yum'</span> <span class="na">priority=</span><span class="s">'1000'</span><span class="nt">></span> <span class="nt"><Client</span> <span class="na">name=</span><span class="s">'server86.example.com'</span><span class="nt">></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'audit-libs'</span> <span class="na">version=</span><span class="s">'1.0.13-1.EL4'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'audit'</span> <span class="na">version=</span><span class="s">'1.0.13-1.EL4'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'basesystem'</span> <span class="na">version=</span><span class="s">'8.0-2'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'bash'</span> <span class="na">version=</span><span class="s">'3.0-18.1'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'bcfg2'</span> <span class="na">version=</span><span class="s">'0.9.1-0.1'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'beecrypt'</span> <span class="na">version=</span><span class="s">'3.1.0-3'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> ... <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'VMwareTools'</span> <span class="na">version=</span><span class="s">'6530-29996'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'yum'</span> <span class="na">version=</span><span class="s">'2.4.2-1'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'zlib'</span> <span class="na">version=</span><span class="s">'1.2.1.2-1.2'</span> <span class="na">type=</span><span class="s">'yum'</span><span class="nt">/></span> <span class="nt"></Client></span> <span class="nt"></PackageList></span> </pre></div> </div> </div> <div class="section" id="simplifying-multi-architecture-environments-with-altsrc"> <h2>Simplifying Multi-Architecture Environments with <a class="reference internal" href="../structures/altsrc.html#server-plugins-structures-altsrc"><em>Altsrc</em></a><a class="headerlink" href="#simplifying-multi-architecture-environments-with-altsrc" title="Permalink to this headline">¶</a></h2> <p>Frequently multi-architecture environments (typically x86_64) will run into problems needing to specify different architectures on different groups for clients. For example, desktop machines may install 32-bit compatibility packages in addition to 64-bit ones, while servers may install only 64-bit packages. Specifying this in the Pkgmgr was onerous, because different package targets (64bit, 32+64, etc) needed to be specified on a package by group basis. Two features have been implemented that should ease this situation considerably.</p> <ul class="simple"> <li>The <a class="reference internal" href="../structures/altsrc.html#server-plugins-structures-altsrc"><em>Altsrc</em></a> feature adds the ability to add a “bind as” directive to entries. For example, the following entry, in a bundle:</li> </ul> <div class="highlight-xml"><div class="highlight"><pre> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'foo'</span> <span class="na">altsrc=</span><span class="s">'bar'</span><span class="nt">/></span> would bind as if it were named bar, while the entry would still appear named "foo" in the client configuration specification. </pre></div> </div> <ul class="simple"> <li>Pkgmgr now builds virtual package targets for any package with Instance client elements. This means that if a client attempts to bind:</li> </ul> <div class="highlight-xml"><div class="highlight"><pre> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'libfoo:x86_64,i686'</span><span class="nt">/></span> It will only include the instances listed in the package. By using these features together, a bundle can include: </pre></div> </div> <div class="highlight-xml"><div class="highlight"><pre> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'libfoo'</span> <span class="na">altsrc=</span><span class="s">'libfoo:i386,i686'</span><span class="nt">/></span> This in conjunction with a Pkgmgr entry that looks like: </pre></div> </div> <div class="highlight-xml"><div class="highlight"><pre> <span class="nt"><Package</span> <span class="na">name=</span><span class="s">'libfoo'</span><span class="nt">></span> <span class="nt"><Instance</span> <span class="na">arch=</span><span class="s">'i386'</span> <span class="na">version=</span><span class="s">'1.0.4-12'</span><span class="nt">/></span> <span class="nt"><Instance</span> <span class="na">arch=</span><span class="s">'i586'</span> <span class="na">version=</span><span class="s">'1.0.4-12'</span><span class="nt">/></span> <span class="nt"><Instance</span> <span class="na">arch=</span><span class="s">'i686'</span> <span class="na">version=</span><span class="s">'1.0.4-12'</span><span class="nt">/></span> <span class="nt"><Instance</span> <span class="na">arch=</span><span class="s">'x86_64'</span> <span class="na">version=</span><span class="s">'1.0.4-12'</span><span class="nt">/></span> <span class="nt"></Package></span> Will result in a bound entry that looks like: </pre></div> </div> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><Package</span> <span class="na">name=</span><span class="s">'libfoo'</span><span class="nt">></span> <span class="nt"><Instance</span> <span class="na">arch=</span><span class="s">'i386'</span> <span class="na">version=</span><span class="s">'1.0.4-12'</span><span class="nt">/></span> <span class="nt"><Instance</span> <span class="na">arch=</span><span class="s">'i686'</span> <span class="na">version=</span><span class="s">'1.0.4-12'</span><span class="nt">/></span> <span class="nt"></Package></span> </pre></div> </div> <p>Altogether, this should move policy decisions about package architectures to bundles/base.</p> </div> <div class="section" id="automated-generation-of-pkgmgr-configuration-files"> <h2>Automated Generation of Pkgmgr Configuration Files<a class="headerlink" href="#automated-generation-of-pkgmgr-configuration-files" title="Permalink to this headline">¶</a></h2> <p>The two utilities detailed below are provided in the tools directory of the source tarball.</p> <p>Also see the general <a class="reference internal" href="#server-plugins-generators-pkgmgr"><em>Pkgmgr</em></a> and <a class="reference internal" href="../structures/altsrc.html#server-plugins-structures-altsrc"><em>altsrc</em></a> pages.</p> <div class="section" id="pkgmgr-gen-py"> <h3>pkgmgr_gen.py<a class="headerlink" href="#pkgmgr-gen-py" title="Permalink to this headline">¶</a></h3> <p>pkgmgr_gen will generate a Pkgmgr file from a list of directories containing RPMs or from a list of YUM repositories.:</p> <div class="highlight-python"><pre>[root@bcfg2 Pkgmgr]# pkgmgr_gen.py --help usage: pkgmgr_gen.py [options] options: -h, --help show this help message and exit -aARCHS, --archs=ARCHS Comma separated list of subarchitectures to include. The highest subarichitecture required in an architecture group should specified. Lower subarchitecture packages will be loaded if that is all that is available. e.g. The higher of i386, i486 and i586 packages will be loaded if -a i586 is specified. (Default: all). -dRPMDIRS, --rpmdirs=RPMDIRS Comma separated list of directories to scan for RPMS. Wilcards are permitted. -eENDDATE, --enddate=ENDDATE End date for RPM file selection. -fFORMAT, --format=FORMAT Format of the Output. Choices are yum or rpm. (Default: yum) -gGROUPS, --groups=GROUPS List of comma separated groups to nest Package entities in. -iINDENT, --indent=INDENT Number of leading spaces to indent nested entries in the output. (Default:4) -oOUTFILE, --outfile=OUTFILE Output file name. -P, --pkgmgrhdr Include PackageList header in output. -pPRIORITY, --priority=PRIORITY Value to set priority attribute in the PackageList Tag. (Default: 0) -rRELEASE, --release=RELEASE Which releases to include in the output. Choices are all or latest. (Default: latest). -sSTARTDATE, --startdate=STARTDATE Start date for RPM file selection. -uURI, --uri=URI URI for PackageList header required for RPM format ouput. -v, --verbose Enable verbose output. -yYUMREPOS, --yumrepos=YUMREPOS Comma separated list of YUM repository URLs to load. NOTE: Each URL must end in a '/' character.</pre> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">The startdate and enddate options are not yet implemented.</p> </div> </div> <div class="section" id="pkgmgr-update-py"> <h3>pkgmgr_update.py<a class="headerlink" href="#pkgmgr-update-py" title="Permalink to this headline">¶</a></h3> <p>pkgmgr_update will update the release (meaning the epoch, version and release) information in an existing Pkgrmgr file from a list of directories containing RPMs or from a list of YUM repositories. All Tags and other attributes in the existing file will remain unchanged.:</p> <div class="highlight-python"><pre>[root@bcfg2 Pkgmgr]# pkgmgr_update.py --help usage: pkgmgr_update.py [options] options: -h, --help show this help message and exit -cCONFIGFILE, --configfile=CONFIGFILE Existing Pkgmgr configuration file name. -dRPMDIRS, --rpmdirs=RPMDIRS Comma separated list of directories to scan for RPMS. Wilcards are permitted. -oOUTFILE, --outfile=OUTFILE Output file name or new Pkgrmgr file. -v, --verbose Enable verbose output. -yYUMREPOS, --yumrepos=YUMREPOS Comma separated list of YUM repository URLs to load. NOTE: Each URL must end in a '/' character.</pre> </div> </div> </div> <div class="section" id="pkgmgr-configuration-examples"> <h2>Pkgmgr Configuration Examples<a class="headerlink" href="#pkgmgr-configuration-examples" title="Permalink to this headline">¶</a></h2> <div class="section" id="verify-flags"> <h3>verify_flags<a class="headerlink" href="#verify-flags" title="Permalink to this headline">¶</a></h3> <p>This entry was used for the Centos test client used during RPM development.</p> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><Package</span> <span class="na">name=</span><span class="s">'bcfg2'</span> <span class="na">type=</span><span class="s">'rpm'</span><span class="nt">></span> <span class="nt"><Instance</span> <span class="na">simplefile=</span><span class="s">'bcfg2-0.9.3-0.0pre5.noarch.rpm'</span> <span class="na">version=</span><span class="s">'0.9.3'</span> <span class="na">release=</span><span class="s">'0.0pre5'</span> <span class="na">arch=</span><span class="s">'noarch'</span> <span class="na">verify_flags=</span><span class="s">'nomd5,nosize,nomtime'</span><span class="nt">/></span> <span class="nt"></Package></span> </pre></div> </div> </div> <div class="section" id="multiple-instances"> <h3>Multiple Instances<a class="headerlink" href="#multiple-instances" title="Permalink to this headline">¶</a></h3> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><Package</span> <span class="na">name=</span><span class="s">'beecrypt'</span> <span class="na">type=</span><span class="s">'rpm'</span><span class="nt">></span> <span class="nt"><Instance</span> <span class="na">simplefile=</span><span class="s">'beecrypt-3.1.0-6.x86_64.rpm'</span> <span class="na">version=</span><span class="s">'3.1.0'</span> <span class="na">release=</span><span class="s">'6'</span> <span class="na">arch=</span><span class="s">'x86_64'</span><span class="nt">/></span> <span class="nt"><Instance</span> <span class="na">simplefile=</span><span class="s">'beecrypt-3.1.0-6.i386.rpm'</span> <span class="na">version=</span><span class="s">'3.1.0'</span> <span class="na">release=</span><span class="s">'6'</span> <span class="na">arch=</span><span class="s">'i386'</span><span class="nt">/></span> <span class="nt"></Package></span> </pre></div> </div> </div> <div class="section" id="kernel"> <h3>Kernel<a class="headerlink" href="#kernel" title="Permalink to this headline">¶</a></h3> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">Multiple instances with the same architecture must be in the installOnlyPkgs list.</p> </div> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><Package</span> <span class="na">name=</span><span class="s">'kernel'</span> <span class="na">type=</span><span class="s">'rpm'</span><span class="nt">></span> <span class="nt"><Instance</span> <span class="na">simplefile=</span><span class="s">'kernel-2.6.9-42.0.8.EL.x86_64.rpm'</span> <span class="na">version=</span><span class="s">'2.6.9'</span> <span class="na">release=</span><span class="s">'42.0.8.EL'</span> <span class="na">arch=</span><span class="s">'x86_64'</span><span class="nt">/></span> <span class="nt"><Instance</span> <span class="na">simplefile=</span><span class="s">'kernel-2.6.9-42.0.10.EL.x86_64.rpm'</span> <span class="na">version=</span><span class="s">'2.6.9'</span> <span class="na">release=</span><span class="s">'42.0.10.EL'</span> <span class="na">arch=</span><span class="s">'x86_64'</span><span class="nt">/></span> <span class="nt"></Package></span> </pre></div> </div> </div> <div class="section" id="per-instance-ignore"> <h3>Per Instance Ignore<a class="headerlink" href="#per-instance-ignore" title="Permalink to this headline">¶</a></h3> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">In this case a per instance ignore is actually a bad idea as the verify failure is because of multiarch issues where the last package installed wins. So this would be better as a Package level ignore.</p> </div> <p>Ignore tag entries only work with the RPM driver. They do not appear to be supported in YUM as of 1.0pre5.</p> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><Package</span> <span class="na">name=</span><span class="s">'glibc'</span> <span class="na">type=</span><span class="s">'rpm'</span><span class="nt">></span> <span class="nt"><Instance</span> <span class="na">simplefile=</span><span class="s">'glibc-2.3.4-2.25.x86_64.rpm'</span> <span class="na">version=</span><span class="s">'2.3.4'</span> <span class="na">release=</span><span class="s">'2.25'</span> <span class="na">arch=</span><span class="s">'x86_64'</span><span class="nt">></span> <span class="nt"><Ignore</span> <span class="na">name=</span><span class="s">'/etc/rpc'</span><span class="nt">/></span> <span class="nt"></Instance></span> <span class="nt"><Instance</span> <span class="na">simplefile=</span><span class="s">'glibc-2.3.4-2.25.i686.rpm'</span> <span class="na">version=</span><span class="s">'2.3.4'</span> <span class="na">release=</span><span class="s">'2.25'</span> <span class="na">arch=</span><span class="s">'i686'</span><span class="nt">/></span> <span class="nt"></Package></span> </pre></div> </div> </div> <div class="section" id="pkg-checks"> <h3>pkg_checks<a class="headerlink" href="#pkg-checks" title="Permalink to this headline">¶</a></h3> <p>If pkg_checks = false the version information is not required. If pkg_checks = true the full information is needed as normal.</p> <p>For YUM a minimal entry is</p> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><Package</span> <span class="na">name=</span><span class="s">"bcfg2"</span> <span class="na">type=</span><span class="s">"yum"</span> <span class="na">pkg_checks=</span><span class="s">"False"</span><span class="nt">/></span> </pre></div> </div> <p>In fact for YUM, with pkg_checks = false, any combination of the nevra attributes that will build a valid yum package name (see the Misc heading on the yum man page) is valid.</p> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><Package</span> <span class="na">name=</span><span class="s">"bcfg2"</span> <span class="na">type=</span><span class="s">"yum"</span> <span class="na">pkg_checks=</span><span class="s">"False"</span> <span class="na">arch=</span><span class="s">"x86_64"</span><span class="nt">/></span> </pre></div> </div> <p>For RPM a minimal entry is</p> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><Package</span> <span class="na">name=</span><span class="s">"bcfg2"</span> <span class="na">type=</span><span class="s">"rpm"</span> <span class="na">pkg_checks=</span><span class="s">"False"</span> <span class="na">simplefile=</span><span class="s">"bcfg2-0.9.4-0.0pre1.noarch.rpm"</span><span class="nt">/></span> </pre></div> </div> </div> <div class="section" id="verify-fail-action"> <h3>verify_fail_action<a class="headerlink" href="#verify-fail-action" title="Permalink to this headline">¶</a></h3> <p>The way I have Bcfg2 configured for my development systems. This way it reports bad, but doesn’t do anything about it.</p> <div class="highlight-xml"><div class="highlight"><pre><span class="nt"><Package</span> <span class="na">name=</span><span class="s">'bcfg2'</span> <span class="na">type=</span><span class="s">'rpm'</span><span class="nt">></span> <span class="nt"><Instance</span> <span class="na">simplefile=</span><span class="s">'bcfg2-0.9.3-0.0pre5.noarch.rpm'</span> <span class="na">version=</span><span class="s">'0.9.3'</span> <span class="na">release=</span><span class="s">'0.0pre5'</span> <span class="na">arch=</span><span class="s">'noarch'</span> <span class="na">verify_fail_action=</span><span class="s">'none'</span><span class="nt">/></span> <span class="nt"></Package></span> </pre></div> </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="#">Pkgmgr</a><ul> <li><a class="reference internal" href="#usage-of-groups-in-pkgmgr">Usage of Groups in Pkgmgr</a></li> <li><a class="reference internal" href="#tag-attributes-in-pkgmgr">Tag Attributes in Pkgmgr</a></li> <li><a class="reference internal" href="#pkgmgr-directory">Pkgmgr Directory</a></li> <li><a class="reference internal" href="#simplifying-multi-architecture-environments-with-altsrc">Simplifying Multi-Architecture Environments with <tt class="docutils literal"><span class="pre">Altsrc</span></tt></a></li> <li><a class="reference internal" href="#automated-generation-of-pkgmgr-configuration-files">Automated Generation of Pkgmgr Configuration Files</a><ul> <li><a class="reference internal" href="#pkgmgr-gen-py">pkgmgr_gen.py</a></li> <li><a class="reference internal" href="#pkgmgr-update-py">pkgmgr_update.py</a></li> </ul> </li> <li><a class="reference internal" href="#pkgmgr-configuration-examples">Pkgmgr Configuration Examples</a><ul> <li><a class="reference internal" href="#verify-flags">verify_flags</a></li> <li><a class="reference internal" href="#multiple-instances">Multiple Instances</a></li> <li><a class="reference internal" href="#kernel">Kernel</a></li> <li><a class="reference internal" href="#per-instance-ignore">Per Instance Ignore</a></li> <li><a class="reference internal" href="#pkg-checks">pkg_checks</a></li> <li><a class="reference internal" href="#verify-fail-action">verify_fail_action</a></li> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="packages.html" title="previous chapter">Packages</a></p> <h4>Next topic</h4> <p class="topless"><a href="rules.html" title="next chapter">Rules</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../../../_sources/server/plugins/generators/pkgmgr.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="rules.html" title="Rules" >next</a> |</li> <li class="right" > <a href="packages.html" title="Packages" >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" >The Bcfg2 Server</a> »</li> <li><a href="../index.html" >Plugins</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>