<!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>Using bcfg2-info — 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="The Bcfg2 Server" href="index.html" /> <link rel="next" title="SELinux" href="selinux.html" /> <link rel="prev" title="Bcfg2 Snapshots" href="snapshots/index.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="selinux.html" title="SELinux" accesskey="N">next</a> |</li> <li class="right" > <a href="snapshots/index.html" title="Bcfg2 Snapshots" 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" accesskey="U">The Bcfg2 Server</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="using-bcfg2-info"> <span id="server-bcfg2-info"></span><h1>Using bcfg2-info<a class="headerlink" href="#using-bcfg2-info" title="Permalink to this headline">¶</a></h1> <p><tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> is a tool for introspecting server functions. It is useful for understanding how the server is interpreting your repository. It consists of the same logic executed by the server to process the repository and produce configuration specifications, just without all of the network communication code. Think of <tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> as <tt class="docutils literal"><span class="pre">bcfg2-server</span></tt> on a stick. It is a useful location to do testing and staging of new configuration rules, prior to deployment. This is particularly useful when developing templates, or developing Bcfg2 plugins.</p> <div class="section" id="getting-started"> <h2>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline">¶</a></h2> <p>First, fire up the <tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> interpreter.</p> <div class="highlight-none"><div class="highlight"><pre>[0:464] bcfg2-info Loading experimental plugin(s): Packages NOTE: Interfaces subject to change Handled 8 events in 0.006s Handled 4 events in 0.035s Welcome to bcfg2-info Type "help" for more information > </pre></div> </div> <p>At this point, the server core has been loaded up, all plugins have been loaded, and the <tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> has both read the initial state of the Bcfg2 repository, as well as begun monitoring it for changes. Like <em>bcfg2-server</em>, <tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> monitors the repository for changes, however, unlike <em>bcfg2-server</em>, it does not process change events automatically. File modification events can be processed by explicitly calling the <strong>update</strong> command. This will process the events, displaying the number of events processed and the amount of time taken by this processing. If no events are available, no message will be displayed. For example, after a change to a file in the repository:</p> <div class="highlight-none"><div class="highlight"><pre>> update Handled 1 events in 0.001s > update > </pre></div> </div> <p>This explicit update process allows you to control the update process, as well as see the precise changes caused by repository modifications.</p> <p><tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> has several builtin commands that display the state of various internal server core state. These are most useful for examining the state of client metadata, either for a single client, or for clients overall.</p> <dl class="docutils"> <dt><strong>clients</strong></dt> <dd>Displays a list of clients, along with their profile groups</dd> <dt><strong>groups</strong></dt> <dd>Displays a list of groups, the inheritance hierarchy, profile status, and category name, if there is one.</dd> <dt><strong>showclient</strong></dt> <dd>Displays full metadata information for a client, including profile group, group memberships, bundle list, and any connector data, like Probe values or Property info.</dd> <dt><strong>config</strong></dt> <dd>Displays the configuration of the Bcfg2 server.</dd> </dl> <p>To leave the interactive shell, just type <tt class="docutils literal"><span class="pre">quit</span></tt> or <tt class="docutils literal"><span class="pre">exit</span></tt>.</p> </div> <div class="section" id="debugging-configuration-rules"> <h2>Debugging Configuration Rules<a class="headerlink" href="#debugging-configuration-rules" title="Permalink to this headline">¶</a></h2> <p>In addition to the commands listed above for viewing client metadata, there are also commands which can shed light on the configuration generation process. Recall that configuration generation occurs in three major steps:</p> <ol class="arabic simple"> <li>Resolve client metadata</li> <li>Build list of entries for the configuration</li> <li>Bind host-specific version of each entry</li> </ol> <p>Step <em>1</em> can be viewed with the commands presented in the previous section. The latter two steps can be examined using the following commands.</p> <dl class="docutils"> <dt><strong>showentries</strong></dt> <dd>displays a list of entries (optionally filtered by type) that appear in a client’s configuration specification</dd> <dt><strong>buildbundle</strong></dt> <dd>Render a single bundle template. This only performs the template rendering step; it does not fully bind all entries in the bundle. This command is very useful when developing bundle templates.</dd> <dt><strong>buildfile</strong></dt> <dd>Perform the entry binding process on a single entry, displaying its results. This command is very useful when developing configuration file templates.</dd> <dt><strong>build</strong></dt> <dd>Build the full configuration specification and write it to a file.</dd> <dt><strong>mappings</strong></dt> <dd>displays the entries handled by the plugins loaded by the server core. This command is useful when the server reports a bind failure for an entry.</dd> </dl> </div> <div class="section" id="debugging-and-developing-bcfg2"> <h2>Debugging and Developing Bcfg2<a class="headerlink" href="#debugging-and-developing-bcfg2" title="Permalink to this headline">¶</a></h2> <p><tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> loads a full Bcfg2 server core, so it provides the ideal environment for developing and debugging Bcfg2. Because it is hard to automate this sort of process, we have only implemented two commands in <tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> to aid in the process.</p> <dl class="docutils"> <dt><strong>profile</strong></dt> <dd>The profile command produces python profiling information for other <tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> commands. This can be used to track performance problems in configuration generation.</dd> <dt><strong>debug</strong></dt> <dd><p class="first">The debug command exits the <tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> interpreter loop and drops to a python interpreter prompt. The Bcfg2 server core is available in this namespace as “self”. Full documentation for the server core is out of scope for this document. This capability is most useful to call into plugin methods, often with setup calls or the enabling of diagnostics.</p> <p>It is possible to return to the <tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> command loop by exiting the python interpreter with ^D.</p> <p class="last">There is built-in support for IPython in <tt class="docutils literal"><span class="pre">bcfg2-info</span></tt>. If IPython is installed, dropping into debug mode in <tt class="docutils literal"><span class="pre">bcfg2-info</span></tt> will use the IPython interpreter by default.</p> </dd> </dl> </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="#">Using bcfg2-info</a><ul> <li><a class="reference internal" href="#getting-started">Getting Started</a></li> <li><a class="reference internal" href="#debugging-configuration-rules">Debugging Configuration Rules</a></li> <li><a class="reference internal" href="#debugging-and-developing-bcfg2">Debugging and Developing Bcfg2</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="snapshots/index.html" title="previous chapter">Bcfg2 Snapshots</a></p> <h4>Next topic</h4> <p class="topless"><a href="selinux.html" title="next chapter">SELinux</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/server/bcfg2-info.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="selinux.html" title="SELinux" >next</a> |</li> <li class="right" > <a href="snapshots/index.html" title="Bcfg2 Snapshots" >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> </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>