Sophie

Sophie

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

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>Writing Bcfg2 Specification &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="Unsorted Docs" href="index.html" />
    <link rel="prev" title="Notes on possible Windows support" href="windows.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="windows.html" title="Notes on possible Windows support"
             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" accesskey="U">Unsorted Docs</a> &raquo;</li> 
      </ul>
    </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="writing-bcfg2-specification">
<span id="unsorted-writing-specification"></span><h1>Writing Bcfg2 Specification<a class="headerlink" href="#writing-bcfg2-specification" title="Permalink to this headline">¶</a></h1>
<p>Bcfg2 specifications are logically divided in to three areas:</p>
<ul class="simple">
<li>Metadata</li>
<li>Abstract</li>
<li>Literal</li>
</ul>
<p>The metadata portion of the configuration assigns a client to its profile
group and to its non-profile groups. The profile group is assigned
in <tt class="docutils literal"><span class="pre">Metadata/clients.xml</span></tt> and the non profile group assignments are in
<tt class="docutils literal"><span class="pre">Metadata/groups.xml</span></tt>.</p>
<p>The group memberships contained in the metadata are then used to constuct
an abstract configuration for the client. An abstract configuration for
a client identifies the configuration entities (packages, configuration
files, service, etc) that a client requires, but it does not identify
them explicitly. For instance an abstract configuration may identify
that a client needs the Bcfg2 package with</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">bcfg2/</span><span class="nt">&gt;</span>
</pre></div>
</div>
<p>but this does not explicitly identify that an RPM package version
0.9.2 should be loaded from <a class="reference external" href="http://rpm.repo.server/bcfg2-0.9.2-0.1.rpm">http://rpm.repo.server/bcfg2-0.9.2-0.1.rpm</a>.
The abstract configuration is defined in the xml configuration files
for the Base and Bundles plugins.</p>
<p>A combination of a clients metadata (group memberships) and abstract
configuration is then used to generate the clients literal configuration.
For instance the above abstract configuration entry may generate a
literal configuration of</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;bcfg2&#39;</span> <span class="na">version=</span><span class="s">&#39;0.9.2-0.1&#39;</span> <span class="na">type=</span><span class="s">&#39;yum&#39;</span><span class="nt">/&gt;</span>
</pre></div>
</div>
<p>A clients literal configuration is generated by a number of plugins that
handle the different configuration entities.</p>
<img alt="../_images/specification_overview.png" src="../_images/specification_overview.png" />
<div class="section" id="dynamic-groups">
<h2>Dynamic Groups<a class="headerlink" href="#dynamic-groups" title="Permalink to this headline">¶</a></h2>
<p>Dynamic groups are likewise complex, and are covered on their own
[wiki:DynamicGroups page]</p>
</div>
<div class="section" id="abstract-configuration-structures">
<h2>Abstract Configuration (Structures)<a class="headerlink" href="#abstract-configuration-structures" title="Permalink to this headline">¶</a></h2>
<p>A clients Abstract Configuration is the inventory of configuration
entities that should be installed on a client. Two plugins provide the
basis for the abstract configuration, the Bundler and Base.</p>
<p>The plugin Bundler builds descriptions of interrelated configuration
entities. These are typically used for the representation of services,
or other complex groups of entities.</p>
<p>The Base provides a laundry list of configuration entities that need to
be installed on hosts. These entities are independent from one another,
and can be installed individually without worrying about the impact on
other entities.</p>
<div class="section" id="usage-of-groups-in-base-and-bundles">
<h3>Usage of Groups in Base and Bundles<a class="headerlink" href="#usage-of-groups-in-base-and-bundles" title="Permalink to this headline">¶</a></h3>
<p>Groups are used by the Base and Bundles plugins for selecting
Configuration Entity Types for inclusion in a clients abstract
configuration.  They can be thought of as:</p>
<div class="highlight-python"><pre>if client is a member of group1 then
    assign to abstract 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 abstract config</pre>
</div>
<p>Group membership maybe negated.  See &#8220;Writing Bundles&#8221; for an example.</p>
</div>
<div class="section" id="configuration-entity-types">
<h3>Configuration Entity Types<a class="headerlink" href="#configuration-entity-types" title="Permalink to this headline">¶</a></h3>
<p>Entities in the abstract configuration (and correspondingly in the
literal configuration) can have one of several types. In the abstract
configuration, each of these entities only has a tag and the name
attribute set.</p>
<p>The types of Configuration Entities that maybe assigned to the abstract
configuration can be seen at <a class="reference internal" href="../server/configurationentries.html#server-configurationentries"><em>Configuration Entries</em></a>.</p>
<p>An example of each entity type is below.</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;bcfg2&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Path</span> <span class="na">name=</span><span class="s">&#39;/etc/bcfg2.conf&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;ntpd&#39;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;Action</span> <span class="na">name=</span><span class="s">&#39;action_name&#39;</span><span class="nt">/&gt;</span>
</pre></div>
</div>
</div>
<div class="section" id="writing-bundles">
<h3>Writing Bundles<a class="headerlink" href="#writing-bundles" title="Permalink to this headline">¶</a></h3>
<p>Bundles consist of a set of configuration entities. These entities
are grouped together due to a configuration-time interdependency.
Basic services tend to be the simplest example of these. They normally
consist of</p>
<ul class="simple">
<li>some software package(s)</li>
<li>some configuration files</li>
<li>an indication that some service should be activated</li>
</ul>
<p>If any of these pieces are installed or updated, all should be rechecked
and any associated services should be restarted.</p>
<p>All files in the Bundles/ subdirectory of the repository are processed.
Each bundle must be defined in its own file and the filename must be the
same as the bundle name with a .xml suffix.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># ls Bundler</span>
<span class="n">Glide3</span><span class="o">.</span><span class="n">xml</span>
<span class="n">LPRng</span><span class="o">.</span><span class="n">xml</span>
<span class="n">Tivoli</span><span class="o">-</span><span class="n">backup</span><span class="o">.</span><span class="n">xml</span>
<span class="n">Tivoli</span><span class="o">.</span><span class="n">xml</span>
<span class="n">a2ps</span><span class="o">.</span><span class="n">xml</span>
<span class="n">abiword</span><span class="o">.</span><span class="n">xml</span>
<span class="n">account</span><span class="o">.</span><span class="n">xml</span>
<span class="n">adsm</span><span class="o">-</span><span class="n">client</span><span class="o">.</span><span class="n">xml</span>
<span class="n">amihappy</span><span class="o">.</span><span class="n">xml</span>
<span class="n">apache</span><span class="o">-</span><span class="n">basic</span><span class="o">.</span><span class="n">xml</span>
<span class="n">apache</span><span class="o">.</span><span class="n">xml</span>
<span class="n">apache2</span><span class="o">-</span><span class="n">basic</span><span class="o">.</span><span class="n">xml</span>
<span class="n">apt</span><span class="o">-</span><span class="n">proxy</span><span class="o">.</span><span class="n">xml</span>
<span class="n">at</span><span class="o">.</span><span class="n">xml</span>
<span class="n">atftp</span><span class="o">-</span><span class="n">server</span><span class="o">.</span><span class="n">xml</span>
<span class="n">atftp</span><span class="o">.</span><span class="n">xml</span>
<span class="o">....</span>
</pre></div>
</div>
<p>Groups can be used inside of bundles to differentiate which entries
particular clients will receive. This is useful for the case where
entries are named differently across systems; for example, one linux
distro may have a package called openssh while another uses the name ssh.
Configuration entries nested inside of Group elements only apply to
clients who are a member of those groups; multiply nested groups must
all apply.</p>
<p>Also, groups may be negated; entries included in such groups will only
apply to clients who are not a member of said group.</p>
<p>When packages in a bundle are verified by the client toolset, the Paths
included in the same bundle are taken into consideration.  That is,
a package will not fail verification from a Bcfg2 perspective if the
package verification only failed because of configuration files that
are defined in the same bundle.</p>
<p>The following is an annotated copy of a bundle:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Bundle</span> <span class="na">name=</span><span class="s">&#39;ssh&#39;</span> <span class="na">version=</span><span class="s">&#39;2.0&#39;</span><span class="nt">&gt;</span>
  <span class="nt">&lt;Path</span> <span class="na">name=</span><span class="s">&#39;/etc/ssh/ssh_host_dsa_key&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Path</span> <span class="na">name=</span><span class="s">&#39;/etc/ssh/ssh_host_rsa_key&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Path</span> <span class="na">name=</span><span class="s">&#39;/etc/ssh/ssh_host_dsa_key.pub&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Path</span> <span class="na">name=</span><span class="s">&#39;/etc/ssh/ssh_host_rsa_key.pub&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Path</span> <span class="na">name=</span><span class="s">&#39;/etc/ssh/ssh_host_key&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Path</span> <span class="na">name=</span><span class="s">&#39;/etc/ssh/ssh_host_key.pub&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Path</span> <span class="na">name=</span><span class="s">&#39;/etc/ssh/sshd_config&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Path</span> <span class="na">name=</span><span class="s">&#39;/etc/ssh/ssh_config&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Path</span> <span class="na">name=</span><span class="s">&#39;/etc/ssh/ssh_known_hosts&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;rpm&#39;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;openssh&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;openssh-askpass&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Service</span> <span class="na">name=</span><span class="s">&#39;sshd&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;fedora&#39;</span> <span class="nt">&gt;</span>
       <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;fc4&#39;</span> <span class="na">negate=</span><span class="s">&#39;true&#39;</span><span class="nt">&gt;</span>
         <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;openssh-clients&#39;</span><span class="nt">/&gt;</span>
       <span class="nt">&lt;/Group&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;/Group&gt;</span>
  <span class="nt">&lt;/Group&gt;</span>
  <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;deb&#39;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Package</span> <span class="na">name=</span><span class="s">&#39;ssh&#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>
  <span class="nt">&lt;/Group&gt;</span>
<span class="nt">&lt;/Bundle&gt;</span>
</pre></div>
</div>
<p>In this bundle, most of the entries are common to all systems. Clients
in group &#8220;deb&#8221; get one extra package and service, while clients in group
&#8220;rpm&#8221; get two extra packages and an extra service. In addition, clients
in group &#8220;fedora&#8221; and group &#8220;rpm&#8221; get one extra package entries, unless
they are not in the fc4 group, in which case, they get an extra package.
Notice that this file doesn&#8217;t describe which versions of these entries
that clients should get, only that they should get them. (Admittedly,
this example is slightly contrived, but demonstrates how group entries
can be used in bundles)</p>
<table border="1" class="docutils">
<colgroup>
<col width="34%" />
<col width="66%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Group</th>
<th class="head">Entry</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>all</td>
<td>/etc/ssh/ssh_host_dsa_key</td>
</tr>
<tr class="row-odd"><td>all</td>
<td>/etc/ssh/ssh_host_rsa_key</td>
</tr>
<tr class="row-even"><td>all</td>
<td>/etc/ssh/ssh_host_dsa_key.pub</td>
</tr>
<tr class="row-odd"><td>all</td>
<td>/etc/ssh/ssh_host_rsa_key.pub</td>
</tr>
<tr class="row-even"><td>all</td>
<td>/etc/ssh/ssh_host_key</td>
</tr>
<tr class="row-odd"><td>all</td>
<td>/etc/ssh/ssh_host_key.pub</td>
</tr>
<tr class="row-even"><td>all</td>
<td>/etc/ssh/sshd_config</td>
</tr>
<tr class="row-odd"><td>all</td>
<td>/etc/ssh/ssh_config</td>
</tr>
<tr class="row-even"><td>all</td>
<td>/etc/ssh/ssh_known_hosts</td>
</tr>
<tr class="row-odd"><td>rpm</td>
<td>Package openssh</td>
</tr>
<tr class="row-even"><td>rpm</td>
<td>Package openssh-askpass</td>
</tr>
<tr class="row-odd"><td>rpm</td>
<td>Service sshd</td>
</tr>
<tr class="row-even"><td>rpm and fedora</td>
<td>Package openssh-server</td>
</tr>
<tr class="row-odd"><td>rpm and fedora
and not fc4</td>
<td>Package openssh-clients</td>
</tr>
<tr class="row-even"><td>deb</td>
<td>Package ssh</td>
</tr>
<tr class="row-odd"><td>deb</td>
<td>Service ssh</td>
</tr>
</tbody>
</table>
<div class="section" id="bundle-tag">
<h4>Bundle Tag<a class="headerlink" href="#bundle-tag" title="Permalink to this headline">¶</a></h4>
<dl class="complexType" id="complexType:BundleType">
<dt id="complexType:BundleType">
<!--[complexType:BundleType]--><em>complexType</em> <strong>BundleType</strong><a class="headerlink" href="#complexType:BundleType" title="Permalink to this definition">¶</a></dt>
</dt>
<dd><p class="first"></p>
<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:BundleType:name"></span><tt class="docutils literal"><span class="pre">name</span></tt></td>
<td><blockquote class="first last">
<div>The name of the bundle.  This must match the bundle
filename, minus the extension.</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>Yes</td>
<td>None</td>
</tr>
<tr class="row-odd"><td><span class="target" id="attribute:BundleType:description"></span><tt class="docutils literal"><span class="pre">description</span></tt></td>
<td><blockquote class="first last">
<div>Freeform description of the bundle.</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:BundleType:origin"></span><tt class="docutils literal"><span class="pre">origin</span></tt></td>
<td><blockquote class="first last">
<div>URL of master version (for common repo)</div></blockquote>
</td>
<td><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#anyURI"><tt class="docutils literal"><span class="pre">anyURI</span></tt></a></td>
<td>No</td>
<td>None</td>
</tr>
<tr class="row-odd"><td><span class="target" id="attribute:BundleType:revision"></span><tt class="docutils literal"><span class="pre">revision</span></tt></td>
<td><blockquote class="first last">
<div>Master version control revision.</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:BundleType:version"></span><tt class="docutils literal"><span class="pre">version</span></tt></td>
<td><blockquote class="first last">
<div>Bundle schema version.</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>Attribute groups:</dt>
<dd><ul class="first last simple">
<li><a class="reference internal" href="../server/genshi-xml.html#attributeGroup:py:genshiAttrs"><tt class="docutils literal"><span class="pre">py:genshiAttrs</span></tt></a></li>
</ul>
</dd>
</dl>
</dd>
</dl>

<p>As mentioned above the Configuration Entity Tags may only have the name
attribute in Bundle definitions.</p>
</div>
<div class="section" id="group-and-client-tags">
<h4>Group and Client Tags<a class="headerlink" href="#group-and-client-tags" title="Permalink to this headline">¶</a></h4>
<dl class="complexType" id="complexType:BundlerGroupType">
<dt id="complexType:BundlerGroupType">
<!--[complexType:BundlerGroupType]--><em>complexType</em> <strong>BundlerGroupType</strong><a class="headerlink" href="#complexType:BundlerGroupType" title="Permalink to this definition">¶</a></dt>
</dt>
<dd><blockquote class="first">
<div>A <strong>BundlerGroupType</strong> is a tag used to provide logic.  Child
entries of a BundlerGroupType tag only apply to machines that
match the condition specified &#8211; either membership in a group,
or a matching client name.
<a class="reference internal" href="#attribute:BundlerGroupType: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:BundlerGroupType:name"></span><tt class="docutils literal"><span class="pre">name</span></tt></td>
<td><blockquote class="first last">
<div>The group name</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>Yes</td>
<td>None</td>
</tr>
<tr class="row-odd"><td><span class="target" id="attribute:BundlerGroupType:negate"></span><tt class="docutils literal"><span class="pre">negate</span></tt></td>
<td><blockquote class="first last">
<div>Negate the sense of this group or client; i.e., entries
within this tag are only used on clients that are not
members of the group, or that have hostnames that do not
match.</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>Attribute groups:</dt>
<dd><ul class="first last simple">
<li><a class="reference internal" href="../server/genshi-xml.html#attributeGroup:py:genshiAttrs"><tt class="docutils literal"><span class="pre">py:genshiAttrs</span></tt></a></li>
</ul>
</dd>
</dl>
</dd>
</dl>

<p>An abstract group may contain any of the Configuration Entity types
and other groups.</p>
</div>
</div>
</div>
<div class="section" id="literal-configuration-generators">
<h2>Literal Configuration (Generators)<a class="headerlink" href="#literal-configuration-generators" title="Permalink to this headline">¶</a></h2>
<p>A Generator is a Bcfg2 piece of code that is run to generate the literal
configuration for a host using a combination of the hosts metadata and
abstract configuration.</p>
<p>A Generator can take care of a particular configuration element. Any time
this element is requested by the client, the server dynamically generates
it either by crunching data and creating new information or by reading
a file off of disk and passes it down to the client for installation.</p>
<div class="section" id="usage-of-groups-in-generators">
<h3>Usage of Groups in Generators<a class="headerlink" href="#usage-of-groups-in-generators" title="Permalink to this headline">¶</a></h3>
<p>Similar to Abstract Configuration plugins, groups are used by generator
plugins for selecting Configuration Entities for inclusion in a 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 abstract 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 abstract config</pre>
</div>
<p>How the groups are configured is specific to the plugin, but here are
two common methods:</p>
<ul class="simple">
<li>xml configuration file (Pkgmgr, Rules)</li>
<li>file name encoding (Cfg, SSHBase)</li>
</ul>
<p>Details are included on each plugin&#8217;s page.</p>
</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="#">Writing Bcfg2 Specification</a><ul>
<li><a class="reference internal" href="#dynamic-groups">Dynamic Groups</a></li>
<li><a class="reference internal" href="#abstract-configuration-structures">Abstract Configuration (Structures)</a><ul>
<li><a class="reference internal" href="#usage-of-groups-in-base-and-bundles">Usage of Groups in Base and Bundles</a></li>
<li><a class="reference internal" href="#configuration-entity-types">Configuration Entity Types</a></li>
<li><a class="reference internal" href="#writing-bundles">Writing Bundles</a><ul>
<li><a class="reference internal" href="#bundle-tag">Bundle Tag</a></li>
<li><a class="reference internal" href="#group-and-client-tags">Group and Client Tags</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#literal-configuration-generators">Literal Configuration (Generators)</a><ul>
<li><a class="reference internal" href="#usage-of-groups-in-generators">Usage of Groups in Generators</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="windows.html"
                        title="previous chapter">Notes on possible Windows support</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/unsorted/writing_specification.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="windows.html" title="Notes on possible Windows support"
             >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" >Unsorted Docs</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>