Sophie

Sophie

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

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>Metadata &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="Plugins" href="../index.html" />
    <link rel="next" title="Bundler" href="../structures/bundler/index.html" />
    <link rel="prev" title="Ldap" href="ldap.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="../structures/bundler/index.html" title="Bundler"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="ldap.html" title="Ldap"
             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" >The Bcfg2 Server</a> &raquo;</li>
          <li><a href="../index.html" accesskey="U">Plugins</a> &raquo;</li> 
      </ul>
    </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="metadata">
<span id="server-plugins-grouping-metadata"></span><h1>Metadata<a class="headerlink" href="#metadata" title="Permalink to this headline">¶</a></h1>
<p>The metadata mechanism has two types of information, client metadata
and group metadata. The client metadata describes which top level
group a client is associated with.The group metadata describes groups
in terms of what bundles and other groups they include. Group data and
clients&#8217; memberships are reflected in the <a class="reference internal" href="#groups-xml">groups.xml</a> and
<a class="reference internal" href="#clients-xml">clients.xml</a> files, respectively.</p>
<div class="section" id="usage-of-groups-in-metadata">
<h2>Usage of Groups in Metadata<a class="headerlink" href="#usage-of-groups-in-metadata" title="Permalink to this headline">¶</a></h2>
<p>Clients are assigned membership of groups in the Metadata
descriptions.  Clients can be directly assigned to <em>&#8216;profile&#8217;</em> or
<em>&#8216;public&#8217;</em> groups.  Client membership of all other groups is by those
groups being associated with the profile or public groups. This file
can be indirectly modified from clients through use of the <tt class="docutils literal"><span class="pre">-p</span></tt> flag
to <tt class="docutils literal"><span class="pre">bcfg2</span></tt>.</p>
<p>Clients are associated with profile groups in <a class="reference internal" href="#clients-xml">clients.xml</a>
as shown below.</p>
</div>
<div class="section" id="clients-xml">
<span id="server-plugins-grouping-metadata-clients-xml"></span><h2>clients.xml<a class="headerlink" href="#clients-xml" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">clients.xml</span></tt> file contains the mappings of Profile Groups
to clients. The file is just a series of <em>&lt;Client /&gt;</em> tags, each of which
describe one host. A sample file is below:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Clients</span> <span class="na">version=</span><span class="s">&quot;3.0&quot;</span><span class="nt">&gt;</span>
  <span class="nt">&lt;Client</span> <span class="na">profile=</span><span class="s">&quot;backup-server&quot;</span> <span class="na">name=</span><span class="s">&quot;backup.example.com&quot;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Client</span> <span class="na">profile=</span><span class="s">&quot;console-server&quot;</span> <span class="na">name=</span><span class="s">&quot;con.example.com&quot;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Client</span> <span class="na">profile=</span><span class="s">&quot;kerberos-master&quot;</span> <span class="na">name=</span><span class="s">&quot;kdc.example.com&quot;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Client</span> <span class="na">profile=</span><span class="s">&quot;mail-server&quot;</span> <span class="na">name=</span><span class="s">&quot;mail.example.com&quot;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;Client</span> <span class="na">name=</span><span class="s">&#39;foo&#39;</span> <span class="na">address=</span><span class="s">&#39;10.0.0.1&#39;</span><span class="nt">&gt;</span>
      <span class="nt">&lt;Alias</span> <span class="na">name=</span><span class="s">&#39;foo-mgmt&#39;</span> <span class="na">address=</span><span class="s">&#39;10.1.0.1&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;/Client&gt;</span>
<span class="nt">&lt;/Clients&gt;</span>
</pre></div>
</div>
<dl class="schema" id="schema:clients.xsd">
<dt id="schema:clients.xsd">
<!--[schema:clients.xsd]--><em>schema</em> <strong>clients.xsd</strong><a class="headerlink" href="#schema:clients.xsd" title="Permalink to this definition">¶</a></dt>
</dt>
<dd><blockquote class="first">
<div>Bcfg2 client list schema</div></blockquote>
<dl class="last element" id="element:Clients">
<dt id="element:Clients">
<!--[element:Clients]--><em>element</em> <strong>Clients</strong><a class="headerlink" href="#element:Clients" title="Permalink to this definition">¶</a></dt>
</dt>
<dd><p class="first"></p>
<dl class="last docutils" id="complexType:ClientsType">
<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:ClientsType:version"></span><tt class="docutils literal"><span class="pre">version</span></tt></td>
<td><blockquote class="first last">
<div>Client 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>Child elements:</dt>
<dd><ul class="first last">
<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>
<dl class="last docutils" id="complexType:ClientType">
<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"><p class="first last">Name</p>
</th>
<th class="head"><p class="first last">Description</p>
</th>
<th class="head"><p class="first last">Values</p>
</th>
<th class="head"><p class="first last">Required</p>
</th>
<th class="head"><p class="first last">Default</p>
</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><p class="first last"><span class="target" id="attribute:ClientType:name"></span><tt class="docutils literal"><span class="pre">name</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Hostname of client.  This needs to be the name (probably
FQDN) returned by a reverse lookup on the connecting IP
address.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">Yes</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
<tr class="row-odd"><td><p class="first last"><span class="target" id="attribute:ClientType:profile"></span><tt class="docutils literal"><span class="pre">profile</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Profile group naem to associate this client with.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">Yes</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
<tr class="row-even"><td><p class="first last"><span class="target" id="attribute:ClientType:address"></span><tt class="docutils literal"><span class="pre">address</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Establishes an extra IP address that resolves to this client.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">No</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
<tr class="row-odd"><td><p class="first last"><span class="target" id="attribute:ClientType:auth"></span><tt class="docutils literal"><span class="pre">auth</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Authentication mode for the client.  See
<a class="reference internal" href="../../../appendix/guides/authentication.html#appendix-guides-authentication"><em>Authentication</em></a> for details on the
values available.</p>
</div></blockquote>
</td>
<td><p class="first last"><p><tt class="docutils literal"><span class="pre">cert+password</span></tt> | <tt class="docutils literal"><span class="pre">bootstrap</span></tt> | <tt class="docutils literal"><span class="pre">cert</span></tt></p>
</p>
</td>
<td><p class="first last">No</p>
</td>
<td><tt class="first last docutils literal"><span class="pre">cert+password</span></tt></td>
</tr>
<tr class="row-even"><td><p class="first last"><span class="target" id="attribute:ClientType:floating"></span><tt class="docutils literal"><span class="pre">floating</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Allows requests to come from any IP address, rather than
requiring requests to come from an IP associated with this
client.  Note that, since this forces the Bcfg2 server to
trust any connection that claims to be from this hostname,
it can introduce security issues.</p>
</div></blockquote>
</td>
<td><p class="first last"><p><tt class="docutils literal"><span class="pre">true</span></tt> | <tt class="docutils literal"><span class="pre">false</span></tt></p>
</p>
</td>
<td><p class="first last">No</p>
</td>
<td><tt class="first last docutils literal"><span class="pre">false</span></tt></td>
</tr>
<tr class="row-odd"><td><p class="first last"><span class="target" id="attribute:ClientType:location"></span><tt class="docutils literal"><span class="pre">location</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Deprecated.  Use <a class="reference internal" href="#attribute:ClientType:floating"><tt class="xref xml xml-attribute docutils literal"><span class="pre">floating</span></tt></a> instead.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">No</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
<tr class="row-even"><td><p class="first last"><span class="target" id="attribute:ClientType:password"></span><tt class="docutils literal"><span class="pre">password</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Establishes a per-client password that can be used instead
of the global password.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">No</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
<tr class="row-odd"><td><p class="first last"><span class="target" id="attribute:ClientType:pingable"></span><tt class="docutils literal"><span class="pre">pingable</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Deprecated.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">No</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
<tr class="row-even"><td><p class="first last"><span class="target" id="attribute:ClientType:pingtime"></span><tt class="docutils literal"><span class="pre">pingtime</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Deprecated.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">No</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
<tr class="row-odd"><td><p class="first last"><span class="target" id="attribute:ClientType:secure"></span><tt class="docutils literal"><span class="pre">secure</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Requires the use of <a class="reference internal" href="#attribute:ClientType:password"><tt class="xref xml xml-attribute docutils literal"><span class="pre">password</span></tt></a> for
this client.</p>
</div></blockquote>
</td>
<td><p class="first last"><p><tt class="docutils literal"><span class="pre">true</span></tt> | <tt class="docutils literal"><span class="pre">false</span></tt></p>
</p>
</td>
<td><p class="first last">No</p>
</td>
<td><tt class="first last docutils literal"><span class="pre">false</span></tt></td>
</tr>
<tr class="row-even"><td><p class="first last"><span class="target" id="attribute:ClientType:uuid"></span><tt class="docutils literal"><span class="pre">uuid</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Establishes a name for this cilent that can be used to
bypass dns-based client resolution.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">No</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
<tr class="row-odd"><td><p class="first last"><span class="target" id="attribute:ClientType:version"></span><tt class="docutils literal"><span class="pre">version</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>The version of the Bcfg2 client running on this machine.
You should not have to set this manually, but can let the
Bcfg2 server set it automatically.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#token"><tt class="docutils literal"><span class="pre">token</span></tt></a></p>
</td>
<td><p class="first last">No</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
</tbody>
</table>
</dd>
<dt>Child elements:</dt>
<dd><ul class="first last">
<li><dl class="element" id="element:Alias">
<dt id="element:Alias">
<!--[element:Alias]--><em>element</em> <strong>Alias</strong><a class="headerlink" href="#element:Alias" title="Permalink to this definition">¶</a></dt>
</dt>
<dd><blockquote class="first">
<div><p><strong>Alias</strong> allows you to set alternative hostname and IP
address pairs that also resolve to this client.</p>
</div></blockquote>
<dl class="last docutils" id="complexType:Alias">
<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"><p class="first last">Name</p>
</th>
<th class="head"><p class="first last">Description</p>
</th>
<th class="head"><p class="first last">Values</p>
</th>
<th class="head"><p class="first last">Required</p>
</th>
<th class="head"><p class="first last">Default</p>
</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><p class="first last"><span class="target" id="attribute:Alias:name"></span><tt class="docutils literal"><span class="pre">name</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Hostname of the alternative client name-address pair.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">Yes</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
<tr class="row-odd"><td><p class="first last"><span class="target" id="attribute:Alias:address"></span><tt class="docutils literal"><span class="pre">address</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>IP address of the alternative client name-address pair.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">No</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
</dd>
</dl>

</li>
</ul>
</dd>
</dl>
</dd>
</dl>

</li>
<li><p class="first"><a class="reference internal" href="#element:Clients"><tt class="docutils literal"><span class="pre">Clients</span></tt></a></p>
</li>
</ul>
</dd>
</dl>
</dd>
</dl>

</dd>
</dl>

<p>For detailed information on client authentication see
<a class="reference internal" href="../../../appendix/guides/authentication.html#appendix-guides-authentication"><em>Authentication</em></a></p>
<div class="section" id="clients-database">
<span id="server-plugins-grouping-metadata-clients-database"></span><h3>Clients Database<a class="headerlink" href="#clients-database" title="Permalink to this headline">¶</a></h3>
<p class="versionadded">
<span class="versionmodified">New in version 1.3.0.</span></p>
<p>It is also possible to store client records in a database rather than
writing back to <a class="reference internal" href="#clients-xml">clients.xml</a>.  This provides several advantages:</p>
<ul class="simple">
<li><a class="reference internal" href="#clients-xml">clients.xml</a> will never be written by the server, removing an
area of contention between the user and server.</li>
<li><a class="reference internal" href="#clients-xml">clients.xml</a> can be removed entirely for many sites.</li>
<li>The Bcfg2 client list can be queried by other machines without
obtaining and parsing <a class="reference internal" href="#clients-xml">clients.xml</a>.</li>
<li>A single client list can be shared amongst multiple Bcfg2 servers.</li>
</ul>
<p>In general, storing clients in the database works almost the same as
<a class="reference internal" href="#clients-xml">clients.xml</a>.  <a class="reference internal" href="#groups-xml">groups.xml</a> is parsed identically.  If
<a class="reference internal" href="#clients-xml">clients.xml</a> is present, it is parsed, but <tt class="docutils literal"><span class="pre">&lt;Client&gt;</span></tt> tags in
<a class="reference internal" href="#clients-xml">clients.xml</a> <em>do not</em> assert client existence; they are only used
to set client options <em>if</em> the client exists (in the database).  That
is, the two purposes of <a class="reference internal" href="#clients-xml">clients.xml</a> &#8211; to track which clients
exist, and to set client options &#8211; have been separated.</p>
<p>With the improvements in <a class="reference internal" href="#groups-xml">groups.xml</a> parsing in 1.3, client groups
can now be set directly in <a class="reference internal" href="#groups-xml">groups.xml</a> with <tt class="docutils literal"><span class="pre">&lt;Client&gt;</span></tt> tags. (See
<a class="reference internal" href="#complexType:clientType"><tt class="xref xml xml-type docutils literal"><span class="pre">clientType</span></tt></a> for more details.)  As a result, <a class="reference internal" href="#clients-xml">clients.xml</a>
is only necessary if you need to set options (e.g., aliases, floating
clients, per-client passwords, etc.) on clients.</p>
<p>To use the database backend instead of <a class="reference internal" href="#clients-xml">clients.xml</a>, set
<tt class="docutils literal"><span class="pre">use_database</span></tt> in the <tt class="docutils literal"><span class="pre">[metadata]</span></tt> section of <tt class="docutils literal"><span class="pre">bcfg2.conf</span></tt> to
<tt class="docutils literal"><span class="pre">true</span></tt>.  You will also need to configure the <a class="reference internal" href="../../database.html#server-database"><em>Global Server
Database Settings</em></a>.</p>
<p>The <a class="reference internal" href="#clients-xml">clients.xml</a>-based model remains the default.</p>
</div>
</div>
<div class="section" id="groups-xml">
<h2>groups.xml<a class="headerlink" href="#groups-xml" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">groups.xml</span></tt> file contains Group and Profile definitions. Here&#8217;s
a simple <tt class="docutils literal"><span class="pre">groups.xml</span></tt> file:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Groups&gt;</span>
  <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;mail-server&#39;</span> <span class="na">profile=</span><span class="s">&#39;true&#39;</span>
                            <span class="na">comment=</span><span class="s">&#39;Top level mail server group&#39;</span> <span class="nt">&gt;</span>
    <span class="nt">&lt;Bundle</span> <span class="na">name=</span><span class="s">&#39;mail-server&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Bundle</span> <span class="na">name=</span><span class="s">&#39;mailman-server&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;apache-server&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;nfs-client&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;server&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;rhel5&#39;</span><span class="nt">&gt;</span>
      <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;sendmail-server&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;/Group&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;rhel6&#39;</span><span class="nt">&gt;</span>
      <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;postfix-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;rhel&#39;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;selinux-enabled&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;/Group&gt;</span>
  <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;oracle-server&#39;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;selinux-enabled&#39;</span> <span class="na">negate=</span><span class="s">&#39;true&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;/Group&gt;</span>
  <span class="nt">&lt;Client</span> <span class="na">name=</span><span class="s">&#39;foo.eample.com&#39;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;oracle-server&#39;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&#39;apache-server&#39;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;/Client&gt;</span>
<span class="nt">&lt;/Groups&gt;</span>
</pre></div>
</div>
<p>A Group or Client tag that does not contain any child tags is a
declaration of membership; a Group or Client tag that does contain
children is a conditional.  So the example above does not assign
either the <tt class="docutils literal"><span class="pre">rhel5</span></tt> or <tt class="docutils literal"><span class="pre">rhel6</span></tt> groups to machines in the
<tt class="docutils literal"><span class="pre">mail-server</span></tt> group, but conditionally assigns the
<tt class="docutils literal"><span class="pre">sendmail-server</span></tt> or <tt class="docutils literal"><span class="pre">postfix-server</span></tt> groups depending on the OS
of the client.  (Presumably in this example the OS groups are set by a
probe.)</p>
<p>Consequently, a client that is RHEL 5 and a member of the
<tt class="docutils literal"><span class="pre">mail-server</span></tt> profile group would also be a member of the
<tt class="docutils literal"><span class="pre">apache-server</span></tt>, <tt class="docutils literal"><span class="pre">nfs-client</span></tt>, <tt class="docutils literal"><span class="pre">server</span></tt>, and <tt class="docutils literal"><span class="pre">sendmail-server</span></tt>
groups; a RHEL 6 client that is a member of the <tt class="docutils literal"><span class="pre">mail-server</span></tt>
profile group would be a member of the <tt class="docutils literal"><span class="pre">apache-server</span></tt>,
<tt class="docutils literal"><span class="pre">nfs-client</span></tt>, <tt class="docutils literal"><span class="pre">server</span></tt>, and <tt class="docutils literal"><span class="pre">postfix-server</span></tt> groups.</p>
<p>Client tags in <a class="reference internal" href="#groups-xml">groups.xml</a> allow you to supplement the profile
group declarations in <a class="reference internal" href="#clients-xml">clients.xml</a> and/or client group assignments
with the <a class="reference internal" href="grouppatterns.html#server-plugins-grouping-grouppatterns"><em>GroupPatterns</em></a> plugin.  They
should be used sparingly.  (They are more useful when you are using
the database backend for client records.)</p>
<p>You can also declare that a group should be negated; this allows you
to set defaults and override them efficiently.  Negation is applied
after other group memberships are calculated, so it doesn&#8217;t matter how
many times a client is assigned to a group or how many times it is
negated; a single group negation is sufficient to remove a client from
that group.  For instance, in the following example,
<tt class="docutils literal"><span class="pre">foo.example.com</span></tt> is <strong>not</strong> a member of <tt class="docutils literal"><span class="pre">selinux-enabled</span></tt>, even
though it is a member of the <tt class="docutils literal"><span class="pre">foo-server</span></tt> and <tt class="docutils literal"><span class="pre">every-server</span></tt>
groups:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Groups&gt;</span>
  <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&quot;foo-server&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&quot;apache-server&quot;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&quot;selinux-enabled&quot;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;/Group&gt;</span>
  <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&quot;apache-server&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&quot;selinux-enabled&quot;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;/Group&gt;</span>
  <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&quot;every-server&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&quot;selinux-enabled&quot;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;/Group&gt;</span>
  <span class="nt">&lt;Client</span> <span class="na">name=</span><span class="s">&quot;foo.example.com&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;Group</span> <span class="na">name=</span><span class="s">&quot;selinux-enabled&quot;</span> <span class="na">negate=</span><span class="s">&quot;true&quot;</span><span class="nt">/&gt;</span>
  <span class="nt">&lt;/Client&gt;</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Nested Group conditionals, Client tags, and negated Group tags are
all new in 1.3.0.</p>
</div>
<dl class="schema" id="schema:metadata.xsd">
<dt id="schema:metadata.xsd">
<!--[schema:metadata.xsd]--><em>schema</em> <strong>metadata.xsd</strong><a class="headerlink" href="#schema:metadata.xsd" title="Permalink to this definition">¶</a></dt>
</dt>
<dd><blockquote class="first">
<div>Bcfg2 schema for declaring groups and associating groups with
bundles.</div></blockquote>
<dl class="last element" id="element:Groups">
<dt id="element:Groups">
<!--[element:Groups]--><em>element</em> <strong>Groups</strong><a class="headerlink" href="#element:Groups" title="Permalink to this definition">¶</a></dt>
</dt>
<dd><p class="first"></p>
<dl class="last docutils" id="complexType:groupsType">
<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:groupsType:origin"></span><tt class="docutils literal"><span class="pre">origin</span></tt></td>
<td><blockquote class="first last">
<div>URI of master version (for common repository)</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:groupsType: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:groupsType:version"></span><tt class="docutils literal"><span class="pre">version</span></tt></td>
<td><blockquote class="first last">
<div>Group 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>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>
<dl class="last docutils" id="complexType:MetadataGroupType">
<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"><p class="first last">Name</p>
</th>
<th class="head"><p class="first last">Description</p>
</th>
<th class="head"><p class="first last">Values</p>
</th>
<th class="head"><p class="first last">Required</p>
</th>
<th class="head"><p class="first last">Default</p>
</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><p class="first last"><span class="target" id="attribute:MetadataGroupType:name"></span><tt class="docutils literal"><span class="pre">name</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Name of the group</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">Yes</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
<tr class="row-odd"><td><p class="first last"><span class="target" id="attribute:MetadataGroupType:category"></span><tt class="docutils literal"><span class="pre">category</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Assign the group to the given category.  A client can only
be a member of one group in a given category.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">No</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
<tr class="row-even"><td><p class="first last"><span class="target" id="attribute:MetadataGroupType:default"></span><tt class="docutils literal"><span class="pre">default</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Set as the profile to use for clients that are not
associated with any profile explicitly in
<a class="reference internal" href="#server-plugins-grouping-metadata-clients-xml"><em>clients.xml</em></a>.
Setting <tt class="docutils literal"><span class="pre">default</span></tt> to <tt class="docutils literal"><span class="pre">true</span></tt> requires setting
<a class="reference internal" href="#attribute:MetadataGroupType:profile"><tt class="xref xml xml-attribute docutils literal"><span class="pre">profile</span></tt></a> to <tt class="docutils literal"><span class="pre">true</span></tt> as
well.</p>
</div></blockquote>
</td>
<td><p class="first last"><p><tt class="docutils literal"><span class="pre">true</span></tt> | <tt class="docutils literal"><span class="pre">false</span></tt></p>
</p>
</td>
<td><p class="first last">No</p>
</td>
<td><tt class="first last docutils literal"><span class="pre">false</span></tt></td>
</tr>
<tr class="row-odd"><td><p class="first last"><span class="target" id="attribute:MetadataGroupType:negate"></span><tt class="docutils literal"><span class="pre">negate</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>When the Group tag is used as a conditional, only apply the
child elements if the named group does not match.  When the
Group tag is used as a declaration, do not apply the named
group to matching clients.</p>
</div></blockquote>
</td>
<td><p class="first last"><p><tt class="docutils literal"><span class="pre">true</span></tt> | <tt class="docutils literal"><span class="pre">false</span></tt></p>
</p>
</td>
<td><p class="first last">No</p>
</td>
<td><tt class="first last docutils literal"><span class="pre">false</span></tt></td>
</tr>
<tr class="row-even"><td><p class="first last"><span class="target" id="attribute:MetadataGroupType:profile"></span><tt class="docutils literal"><span class="pre">profile</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Mark the group as a profile, which allows a client to be
directly associated with this group in
<a class="reference internal" href="#server-plugins-grouping-metadata-clients-xml"><em>clients.xml</em></a>.</p>
</div></blockquote>
</td>
<td><p class="first last"><p><tt class="docutils literal"><span class="pre">true</span></tt> | <tt class="docutils literal"><span class="pre">false</span></tt></p>
</p>
</td>
<td><p class="first last">No</p>
</td>
<td><tt class="first last docutils literal"><span class="pre">false</span></tt></td>
</tr>
<tr class="row-odd"><td><p class="first last"><span class="target" id="attribute:MetadataGroupType:public"></span><tt class="docutils literal"><span class="pre">public</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Mark the group as public, which allows any client to assert
membership in the group with <tt class="docutils literal"><span class="pre">bcfg2</span> <span class="pre">-p</span></tt>.</p>
</div></blockquote>
</td>
<td><p class="first last"><p><tt class="docutils literal"><span class="pre">true</span></tt> | <tt class="docutils literal"><span class="pre">false</span></tt></p>
</p>
</td>
<td><p class="first last">No</p>
</td>
<td><tt class="first last docutils literal"><span class="pre">false</span></tt></td>
</tr>
</tbody>
</table>
</dd>
<dt>Child elements:</dt>
<dd><ul class="first last">
<li><dl class="element" id="element:Bundle">
<dt id="element:Bundle">
<!--[element:Bundle]--><em>element</em> <strong>Bundle</strong><a class="headerlink" href="#element:Bundle" title="Permalink to this definition">¶</a></dt>
</dt>
<dd><p class="first"></p>
<dl class="last docutils" id="complexType:bundleDeclaration">
<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"><p class="first last">Name</p>
</th>
<th class="head"><p class="first last">Description</p>
</th>
<th class="head"><p class="first last">Values</p>
</th>
<th class="head"><p class="first last">Required</p>
</th>
<th class="head"><p class="first last">Default</p>
</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><p class="first last"><span class="target" id="attribute:bundleDeclaration:name"></span><tt class="docutils literal"><span class="pre">name</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>The bundle name</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">Yes</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
</dd>
</dl>

</li>
<li><p class="first"><a class="reference internal" href="../../info.html#element:Group"><tt class="docutils literal"><span class="pre">Group</span></tt></a></p>
</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>
<dl class="last docutils" id="complexType:clientType">
<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"><p class="first last">Name</p>
</th>
<th class="head"><p class="first last">Description</p>
</th>
<th class="head"><p class="first last">Values</p>
</th>
<th class="head"><p class="first last">Required</p>
</th>
<th class="head"><p class="first last">Default</p>
</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><p class="first last"><span class="target" id="attribute:clientType:name"></span><tt class="docutils literal"><span class="pre">name</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>The name of the client.</p>
</div></blockquote>
</td>
<td><p class="first last"><a class="reference external" href="http://www.w3.org/TR/xmlschema-2/#string"><tt class="docutils literal"><span class="pre">string</span></tt></a></p>
</td>
<td><p class="first last">Yes</p>
</td>
<td><p class="first last">None</p>
</td>
</tr>
<tr class="row-odd"><td><p class="first last"><span class="target" id="attribute:clientType:negate"></span><tt class="docutils literal"><span class="pre">negate</span></tt></p>
</td>
<td><blockquote class="first last">
<div><p>Only apply the child tags if the named client does not
match.</p>
</div></blockquote>
</td>
<td><p class="first last"><p><tt class="docutils literal"><span class="pre">true</span></tt> | <tt class="docutils literal"><span class="pre">false</span></tt></p>
</p>
</td>
<td><p class="first last">No</p>
</td>
<td><tt class="first last docutils literal"><span class="pre">false</span></tt></td>
</tr>
</tbody>
</table>
</dd>
<dt>Child elements:</dt>
<dd><ul class="first last simple">
<li><a class="reference internal" href="#element:Bundle"><tt class="docutils literal"><span class="pre">Bundle</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>
<li><a class="reference internal" href="#element:Groups"><tt class="docutils literal"><span class="pre">Groups</span></tt></a></li>
</ul>
</dd>
</dl>
</dd>
</dl>

</li>
<li><p class="first"><a class="reference internal" href="#element:Groups"><tt class="docutils literal"><span class="pre">Groups</span></tt></a></p>
</li>
</ul>
</dd>
</dl>
</dd>
</dl>

</li>
<li><p class="first"><a class="reference internal" href="../../info.html#element:Client"><tt class="docutils literal"><span class="pre">Client</span></tt></a></p>
</li>
<li><p class="first"><a class="reference internal" href="#element:Groups"><tt class="docutils literal"><span class="pre">Groups</span></tt></a></p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">xi:include</span></tt></p>
</li>
</ul>
</dd>
</dl>
</dd>
</dl>

</dd>
</dl>

</div>
<div class="section" id="xinclude">
<h2>XInclude<a class="headerlink" href="#xinclude" title="Permalink to this headline">¶</a></h2>
<p class="versionadded">
<span class="versionmodified">New in version 0.9.0.</span></p>
<p><a class="reference external" href="http://www.w3.org/TR/xinclude/">XInclude</a> is a W3C specification
for the inclusion of external XML documents into XML source files,
allowing complex definitions to be split into smaller, more manageable
pieces. The <a class="reference internal" href="#metadata">Metadata</a> plugin supports the use of XInclude
specifications to split the <a class="reference internal" href="#clients-xml">clients.xml</a> and <a class="reference internal" href="#groups-xml">groups.xml</a>
files. This mechanism allows the following specification to produce
useful results:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;Groups</span> <span class="na">version=</span><span class="s">&#39;3.0&#39;</span> <span class="na">xmlns:xi=</span><span class="s">&quot;http://www.w3.org/2001/XInclude&quot;</span><span class="nt">&gt;</span>
 <span class="nt">&lt;xi:include</span> <span class="na">href=</span><span class="s">&quot;my-groups.xml&quot;</span> <span class="nt">/&gt;</span>
 <span class="nt">&lt;xi:include</span> <span class="na">href=</span><span class="s">&quot;their-groups.xml&quot;</span> <span class="nt">/&gt;</span>
<span class="nt">&lt;/Groups&gt;</span>
</pre></div>
</div>
<p>Each of the included groups files has the same format. These files are
properly validated by <tt class="docutils literal"><span class="pre">bcfg2-lint</span></tt>. This mechanism is useful for
composing group definitions from multiple sources, or setting
different permissions in an svn repository.</p>
</div>
<div class="section" id="probes">
<h2>Probes<a class="headerlink" href="#probes" title="Permalink to this headline">¶</a></h2>
<p>The metadata plugin includes client-side probing functionality. This
is fully documented <a class="reference internal" href="../probes/index.html#server-plugins-probes-index"><em>here</em></a>.</p>
</div>
<div class="section" id="metadata-caching">
<h2>Metadata Caching<a class="headerlink" href="#metadata-caching" title="Permalink to this headline">¶</a></h2>
<p class="versionadded">
<span class="versionmodified">New in version 1.3.0.</span></p>
<p>Client metadata can be cached in order to improve performance.  This
is particularly important if you have lots of templates that use
metadata from other clients (e.g., with the <a class="reference internal" href="#metadataquery">MetadataQuery</a> interface
described below.  See <a class="reference internal" href="../../caching.html#server-caching"><em>Server-side Caching</em></a> for a full description of
the caching features available.</p>
</div>
<div class="section" id="clientmetadata">
<span id="server-plugins-grouping-metadata-clientmetadata"></span><h2>ClientMetadata<a class="headerlink" href="#clientmetadata" title="Permalink to this headline">¶</a></h2>
<p>A special client metadata class is available to
<a class="reference internal" href="../generators/cfg.html#server-plugins-generators-cfg-genshi"><em>Genshi Templates</em></a> and
<a class="reference internal" href="../generators/cfg.html#server-plugins-generators-cfg-cheetah"><em>Cheetah Templates</em></a>.</p>
<table border="1" class="docutils">
<colgroup>
<col width="16%" />
<col width="64%" />
<col width="20%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Attribute</th>
<th class="head">Description</th>
<th class="head">Value</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>hostname</td>
<td>Client hostname</td>
<td>String</td>
</tr>
<tr class="row-odd"><td>profile</td>
<td>Client profile</td>
<td>String</td>
</tr>
<tr class="row-even"><td>aliases</td>
<td>Client aliases</td>
<td>List</td>
</tr>
<tr class="row-odd"><td>addresses</td>
<td>Adresses this client is known by</td>
<td>List</td>
</tr>
<tr class="row-even"><td>groups</td>
<td>Groups this client is a member of</td>
<td>List</td>
</tr>
<tr class="row-odd"><td>categories</td>
<td>Categories of this clients groups</td>
<td>List</td>
</tr>
<tr class="row-even"><td>uuid</td>
<td>uuid identifier for this client</td>
<td>String</td>
</tr>
<tr class="row-odd"><td>password</td>
<td>bcfg password for this client</td>
<td>String</td>
</tr>
<tr class="row-even"><td>connectors</td>
<td>connector plugins known to this client</td>
<td>List</td>
</tr>
<tr class="row-odd"><td>query</td>
<td><a class="reference internal" href="#metadataquery">MetadataQuery</a> object</td>
<td>MetadataQuery</td>
</tr>
</tbody>
</table>
<table border="1" class="docutils">
<colgroup>
<col width="30%" />
<col width="50%" />
<col width="20%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Method</th>
<th class="head">Description</th>
<th class="head">Value</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>inGroup(group)</td>
<td>True if this client is a memnber of &#8216;group&#8217;</td>
<td>Boolean</td>
</tr>
<tr class="row-odd"><td>group_in_category(category)</td>
<td>Returns the group in &#8216;category&#8217; if the client
is a member of &#8216;category&#8217;, otherwise &#8216;&#8217;</td>
<td>String</td>
</tr>
</tbody>
</table>
<div class="section" id="metadataquery">
<h3>MetadataQuery<a class="headerlink" href="#metadataquery" title="Permalink to this headline">¶</a></h3>
<p>This class provides query methods for the metadata of all clients
known to the Bcfg2 server.  Note that <tt class="docutils literal"><span class="pre">*by_groups()</span></tt> and
<tt class="docutils literal"><span class="pre">*by_profiles()</span></tt> behave differently; for a client to be included in
the return value of a <tt class="docutils literal"><span class="pre">by_groups()</span></tt> method, it must be a member of
<em>all</em> groups listed in the argument; for a client to be included in
the return value of a <tt class="docutils literal"><span class="pre">by_profiles()</span></tt> method, it must have any group
listed as its profile group.</p>
<table border="1" class="docutils">
<colgroup>
<col width="31%" />
<col width="49%" />
<col width="20%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Method</th>
<th class="head">Description</th>
<th class="head">Value</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>by_name(client)</td>
<td>Get ClientMetadata object for &#8216;client&#8217;</td>
<td>ClientMetadata</td>
</tr>
<tr class="row-odd"><td>by_groups(groups)</td>
<td>Get ClientMetadata object for clients in all
listed groups</td>
<td>List of
ClientMetadata</td>
</tr>
<tr class="row-even"><td>by_profiles(client)</td>
<td>Get ClientMetadata objects for clients whose
profile matches any listed profile group</td>
<td>List of
ClientMetadata</td>
</tr>
<tr class="row-odd"><td>names_by_groups(groups)</td>
<td>Get the names of all clients in all listed
groups</td>
<td>List of strings</td>
</tr>
<tr class="row-even"><td>names_by_profiles(profiles)</td>
<td>Get the names of clients whose profile matches
any listed profile group</td>
<td>List of strings</td>
</tr>
<tr class="row-odd"><td>all_clients()</td>
<td>All known client hostnames</td>
<td>List of strings</td>
</tr>
<tr class="row-even"><td>all_groups()</td>
<td>All known group names</td>
<td>List of strings</td>
</tr>
<tr class="row-odd"><td>all_groups_in_category(cat)</td>
<td>The names of all groups in category &#8216;cat&#8217;</td>
<td>List of strings</td>
</tr>
<tr class="row-even"><td>all()</td>
<td>Get ClientMetadata for all clients</td>
<td>List of
ClientMetadata</td>
</tr>
</tbody>
</table>
</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="#">Metadata</a><ul>
<li><a class="reference internal" href="#usage-of-groups-in-metadata">Usage of Groups in Metadata</a></li>
<li><a class="reference internal" href="#clients-xml">clients.xml</a><ul>
<li><a class="reference internal" href="#clients-database">Clients Database</a></li>
</ul>
</li>
<li><a class="reference internal" href="#groups-xml">groups.xml</a></li>
<li><a class="reference internal" href="#xinclude">XInclude</a></li>
<li><a class="reference internal" href="#probes">Probes</a></li>
<li><a class="reference internal" href="#metadata-caching">Metadata Caching</a></li>
<li><a class="reference internal" href="#clientmetadata">ClientMetadata</a><ul>
<li><a class="reference internal" href="#metadataquery">MetadataQuery</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="ldap.html"
                        title="previous chapter">Ldap</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../structures/bundler/index.html"
                        title="next chapter">Bundler</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../../_sources/server/plugins/grouping/metadata.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="../structures/bundler/index.html" title="Bundler"
             >next</a> |</li>
        <li class="right" >
          <a href="ldap.html" title="Ldap"
             >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" >The Bcfg2 Server</a> &raquo;</li>
          <li><a href="../index.html" >Plugins</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>