mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Since master branch are named release-XX now, just link to examples on the devel branch.
This commit is contained in:
4
api.html
4
api.html
@@ -269,7 +269,7 @@ command line tools <tt class="docutils literal"><span class="pre">ansible</span>
|
||||
in a different system. Frequent examples include LDAP, <a class="reference external" href="http://cobbler.github.com">Cobbler</a>,
|
||||
or a piece of expensive enterprisey CMDB software. Ansible easily supports all
|
||||
of these options via an external inventory 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, 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 have a data store system where an Ansible external inventory script doesn’t already exist, this may require a little coding, but we have a <a class="reference external" href="https://github.com/ansible/ansible/blob/devel/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>
|
||||
@@ -298,7 +298,7 @@ if the script does not wish to do this, returning an empty hash/dictionary is th
|
||||
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
|
||||
using Cobbler’s XMLRPC API.</p>
|
||||
<p>To tie Ansible’s inventory to Cobbler (optional), copy <cite>this script <https://github.com/ansible/ansible/blob/master/examples/scripts/cobbler_external_inventory.py></cite> to /etc/ansible/hosts and <cite>chmod +x</cite> the file. cobblerd will now need
|
||||
<p>To tie Ansible’s inventory to Cobbler (optional), copy <cite>this script <https://github.com/ansible/ansible/blob/devel/examples/scripts/cobbler_external_inventory.py></cite> to /etc/ansible/hosts and <cite>chmod +x</cite> the file. cobblerd will now need
|
||||
to be running when you are using Ansible.</p>
|
||||
<p>Test the file by running <cite>./etc/ansible/hosts</cite> directly. You should see some JSON data output, but it may not have
|
||||
anything in it just yet.</p>
|
||||
|
||||
Reference in New Issue
Block a user