blob: 8fce2f5fd1bc89f3e3df228f06fc609dbeaf4bcd [file] [log] [blame]
martin f. krafft3cd2a332014-10-28 15:58:23 +01001<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4
5<html xmlns="http://www.w3.org/1999/xhtml">
6 <head>
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
9 <title>Using reclass &mdash; reclass 1.4.1 documentation</title>
10
11 <link rel="stylesheet" href="_static/default.css" type="text/css" />
12 <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
13
14 <script type="text/javascript">
15 var DOCUMENTATION_OPTIONS = {
16 URL_ROOT: './',
17 VERSION: '1.4.1',
18 COLLAPSE_INDEX: false,
19 FILE_SUFFIX: '.html',
20 HAS_SOURCE: true
21 };
22 </script>
23 <script type="text/javascript" src="_static/jquery.js"></script>
24 <script type="text/javascript" src="_static/underscore.js"></script>
25 <script type="text/javascript" src="_static/doctools.js"></script>
26 <link rel="top" title="reclass 1.4.1 documentation" href="index.html" />
27 <link rel="next" title="External references" href="refs.html" />
28 <link rel="prev" title="reclass operations" href="operations.html" />
29 </head>
30 <body>
31 <div class="related">
32 <h3>Navigation</h3>
33 <ul>
34 <li class="right" style="margin-right: 10px">
35 <a href="genindex.html" title="General Index"
36 accesskey="I">index</a></li>
37 <li class="right" >
38 <a href="refs.html" title="External references"
39 accesskey="N">next</a> |</li>
40 <li class="right" >
41 <a href="operations.html" title="reclass operations"
42 accesskey="P">previous</a> |</li>
43 <li><a href="index.html">reclass</a> &raquo;</li>
44 </ul>
45 </div>
46
47 <div class="document">
48 <div class="documentwrapper">
49 <div class="bodywrapper">
50 <div class="body">
51
52 <div class="section" id="using-reclass">
53<h1>Using reclass<a class="headerlink" href="#using-reclass" title="Permalink to this headline"></a></h1>
54<p>For information on how to use <strong>reclass</strong> directly, call <tt class="docutils literal"><span class="pre">reclass</span> <span class="pre">--help</span></tt>
55and study the output, or have a look at its <a class="reference internal" href="manpage.html"><em>manual page</em></a>.</p>
56<p>The three options, <tt class="docutils literal"><span class="pre">--inventory-base-uri</span></tt>, <tt class="docutils literal"><span class="pre">--nodes-uri</span></tt>, and
57<tt class="docutils literal"><span class="pre">--classes-uri</span></tt> together specify the location of the inventory. If the base
58URI is specified, then it is prepended to the other two URIs, unless they are
59absolute URIs. If these two URIs are not specified, they default to <tt class="docutils literal"><span class="pre">nodes</span></tt>
60and <tt class="docutils literal"><span class="pre">classes</span></tt>. Therefore, if your inventory is in <tt class="docutils literal"><span class="pre">/etc/reclass/nodes</span></tt> and
61<tt class="docutils literal"><span class="pre">/etc/reclass/classes</span></tt>, all you need to specify is the base URI as
62<tt class="docutils literal"><span class="pre">/etc/reclass</span></tt> — which is actually the default (specified in
63<tt class="docutils literal"><span class="pre">reclass/defaults.py</span></tt>).</p>
64<p>If you&#8217;ve installed <strong>reclass</strong> from source as per the <a class="reference internal" href="install.html"><em>installation
65instructions</em></a>, try to run it from the source directory like this:</p>
66<div class="highlight-python"><div class="highlight"><pre>$ reclass -b examples/ --inventory
67$ reclass -b examples/ --nodeinfo localhost
68</pre></div>
69</div>
70<p>This will make it use the data from <tt class="docutils literal"><span class="pre">examples/nodes</span></tt> and
71<tt class="docutils literal"><span class="pre">examples/classes</span></tt>, and you can surely make your own way from here.</p>
72<p>On Debian-systems, use the following:</p>
73<div class="highlight-python"><div class="highlight"><pre>$ reclass -b /usr/share/doc/reclass/examples/ --inventory
74$ reclass -b /usr/share/doc/reclass/examples/ --nodeinfo localhost
75</pre></div>
76</div>
77<p>More commonly, however, use of <strong>reclass</strong> will happen indirectly, and through
78so-called adapters. The job of an adapter is to translate between different
79invocation paradigms, provide a sane set of default options, and massage the
80data from <strong>reclass</strong> into the format expected by the automation tool in use.
81Please have a look at the respective README files for these adapters, i.e.
82for <a class="reference internal" href="salt.html"><em>Salt</em></a>, for <a class="reference internal" href="ansible.html"><em>Ansible</em></a>, and for <a class="reference internal" href="puppet.html"><em>Puppet</em></a>.</p>
83</div>
84
85
86 </div>
87 </div>
88 </div>
89 <div class="sphinxsidebar">
90 <div class="sphinxsidebarwrapper">
91 <h4>Previous topic</h4>
92 <p class="topless"><a href="operations.html"
93 title="previous chapter">reclass operations</a></p>
94 <h4>Next topic</h4>
95 <p class="topless"><a href="refs.html"
96 title="next chapter">External references</a></p>
97<div id="searchbox" style="display: none">
98 <h3>Quick search</h3>
99 <form class="search" action="search.html" method="get">
100 <input type="text" name="q" />
101 <input type="submit" value="Go" />
102 <input type="hidden" name="check_keywords" value="yes" />
103 <input type="hidden" name="area" value="default" />
104 </form>
105 <p class="searchtip" style="font-size: 90%">
106 Enter search terms or a module, class or function name.
107 </p>
108</div>
109<script type="text/javascript">$('#searchbox').show(0);</script>
110 </div>
111 </div>
112 <div class="clearer"></div>
113 </div>
114 <div class="related">
115 <h3>Navigation</h3>
116 <ul>
117 <li class="right" style="margin-right: 10px">
118 <a href="genindex.html" title="General Index"
119 >index</a></li>
120 <li class="right" >
121 <a href="refs.html" title="External references"
122 >next</a> |</li>
123 <li class="right" >
124 <a href="operations.html" title="reclass operations"
125 >previous</a> |</li>
126 <li><a href="index.html">reclass</a> &raquo;</li>
127 </ul>
128 </div>
129 <div class="footer">
130 &copy; Copyright 2013, martin f. krafft.
131 Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
132 </div>
133 </body>
134</html>