mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Add IRC and google groups links to each page
This commit is contained in:
16
api.html
16
api.html
@@ -133,7 +133,11 @@ s.parentNode.insertBefore(ga, s);
|
||||
<li><a class="reference internal" href="#detailed-api-example">Detailed API Example</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#external-inventory">External Inventory</a></li>
|
||||
<li><a class="reference internal" href="#external-inventory">External Inventory</a><ul>
|
||||
<li><a class="reference internal" href="#script-conventions">Script Conventions</a></li>
|
||||
<li><a class="reference internal" href="#example-the-cobbler-external-inventory-script">Example: The Cobbler External Inventory Script</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -243,6 +247,8 @@ of these options via an external interventory system.</p>
|
||||
<p>If you have a data store system where an Ansible external inventory script doesn’t already exist, this may require a little coding,J
|
||||
but we have a <a class="reference external" href="https://github.com/ansible/ansible/blob/master/examples/scripts/cobbler_external_inventory.py">Cobbler example</a> in the main source tree – but it’s pretty simple, as we’ll explain below – that would provide a good starting point. Like with modules, it’s possible to build an external inventory script in any language, as long as it returns JSON.</p>
|
||||
<p>If you are familiar with Puppet terminology, this concept is basically the same as ‘external nodes’, with the slight difference that it also defines which hosts are managed.</p>
|
||||
<div class="section" id="script-conventions">
|
||||
<h3>Script Conventions<a class="headerlink" href="#script-conventions" title="Permalink to this headline">¶</a></h3>
|
||||
<p>When the external node script is called with no arguments, the script must return a JSON hash/dictionary of all the groups to be managed, with a list of each host/IP as the value for each hash/dictionary element, like so:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
|
||||
<span class="s">'databases'</span> <span class="p">:</span> <span class="p">[</span> <span class="s">'host1.example.com'</span><span class="p">,</span> <span class="s">'host2.example.com'</span> <span class="p">],</span>
|
||||
@@ -261,6 +267,9 @@ if the script does not wish to do this, returning an empty hash/dictionary is th
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="example-the-cobbler-external-inventory-script">
|
||||
<h3>Example: The Cobbler External Inventory Script<a class="headerlink" href="#example-the-cobbler-external-inventory-script" title="Permalink to this headline">¶</a></h3>
|
||||
<p>It is expected that many Ansible users will also be <a class="reference external" href="http://cobbler.github.com">Cobbler</a> users. Cobbler has a generic
|
||||
layer that allows it to represent data for multiple configuration management systems (even at the same time), and has
|
||||
been referred to as a ‘lightweight CMDB’ by some admins. This particular script will communicate with Cobbler
|
||||
@@ -304,10 +313,15 @@ a conf.d file appropriately or something similar. Who knows.</p>
|
||||
<dl class="last docutils">
|
||||
<dt><a class="reference internal" href="modules.html"><em>Ansible Modules</em></a></dt>
|
||||
<dd>List of built-in modules</dd>
|
||||
<dt><a class="reference external" href="http://groups.google.com/group/ansible-project">Mailing List</a></dt>
|
||||
<dd>Questions? Help? Ideas? Stop by the list on Google Groups</dd>
|
||||
<dt><a class="reference external" href="http://irc.freenode.net">irc.freenode.net</a></dt>
|
||||
<dd>#ansible IRC chat channel</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user