<h2><aclass="toc-backref"href="#table-of-contents">Plugins Repository</a><aclass="headerlink"href="#plugins-repository"title="Permalink to this headline">¶</a></h2>
<p>The remainder of features in the API docs have components available in the <aclass="reference external"href="http://github.com/ansible/ansible-plugins">ansible-plugins</a> repository. Please consult this repository for more information. Send us a github pull request if you develop any interesting features.</p>
<p>The remainder of features in the API docs have components available in <aclass="reference external"href="https://github.com/ansible/ansible/blob/devel/plugins">ansible-plugins</a>. Send us a github pull request if you develop any interesting features.</p>
<h2><aclass="toc-backref"href="#table-of-contents">External Inventory Scripts</a><aclass="headerlink"href="#external-inventory-scripts"title="Permalink to this headline">¶</a></h2>
<p>Often a user of a configuration management system will want to keep inventory
in a different system. Frequent examples include LDAP, <aclass="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. The ansible-plugins repo contains some of these already – including options for EC2/Eucalyptus and OpenStack, which will be detailed below.</p>
of these options via an external inventory system. The plugins directory contains some of these already – including options for EC2/Eucalyptus and OpenStack, which will be detailed below.</p>
<p>It’s possible to write an external inventory script in any language. 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>
<divclass="section"id="script-conventions">
<h3>Script Conventions<aclass="headerlink"href="#script-conventions"title="Permalink to this headline">¶</a></h3>
...
...
@@ -314,7 +299,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 <aclass="reference external"href="https://github.com/ansible/ansible-plugins/blob/master/inventory/cobbler.py">this script</a> 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 <aclass="reference external"href="https://raw.github.com/ansible/ansible/devel/plugins/inventory/cobbler.py">this script</a> 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>
...
...
@@ -355,7 +340,7 @@ a conf.d file appropriately or something similar. Who knows?</p>
<h3>Example: AWS EC2 External Inventory Script<aclass="headerlink"href="#example-aws-ec2-external-inventory-script"title="Permalink to this headline">¶</a></h3>
<p>If you use Amazon Web Services EC2, maintaining an inventory file might not be the best approach. For this reason, you can use the <aclass="reference external"href="https://github.com/ansible/ansible-plugins/blob/master/inventory/ec2.py">EC2 external inventory</a> script.</p>
<p>If you use Amazon Web Services EC2, maintaining an inventory file might not be the best approach. For this reason, you can use the <aclass="reference external"href="https://raw.github.com/ansible/ansible/devel/plugins/inventory/ec2.py">EC2 external inventory</a> script.</p>
<p>You can use this script in one of two ways. The easiest is to use Ansible’s <ttclass="docutils literal"><spanclass="pre">-i</span></tt> command line option and specify the path to the script.</p>
<h3>Example: OpenStack<aclass="headerlink"href="#example-openstack"title="Permalink to this headline">¶</a></h3>
<p>Though not detailed here in as much depth as the EC2 module, there’s also a OpenStack Nova external inventory source in the ansible-plugins repository. See the inline comments in the module source.</p>
<p>Though not detailed here in as much depth as the EC2 module, there’s also a OpenStack Nova external inventory source in the plugins directory. See the inline comments in the module source.</p>
</div>
</div>
<divclass="section"id="callback-plugins">
<h2><aclass="toc-backref"href="#table-of-contents">Callback Plugins</a><aclass="headerlink"href="#callback-plugins"title="Permalink to this headline">¶</a></h2>
<p>Ansible can be configured via code to respond to external events. This can include enhancing logging, signalling an external software
system, or even (yes, really) making sound effects. Some examples are contained in the ansible-plugins repository.</p>
system, or even (yes, really) making sound effects. Some examples are contained in the plugins directory.</p>
</div>
<divclass="section"id="connection-type-plugins">
<h2><aclass="toc-backref"href="#table-of-contents">Connection Type Plugins</a><aclass="headerlink"href="#connection-type-plugins"title="Permalink to this headline">¶</a></h2>
@@ -468,7 +453,7 @@ JSON is probably the simplest way to go.</p>
<divclass="section"id="sharing-your-module">
<h2><aclass="toc-backref"href="#contents">Sharing Your Module</a><aclass="headerlink"href="#sharing-your-module"title="Permalink to this headline">¶</a></h2>
<p>If you think your module is generally useful to others, a good place to share it
is in <aclass="reference external"href="https://github.com/ansible/ansible-resources">Ansible Resources</a>. This is maintained
is in <aclass="reference external"href="https://github.com/ansible/ansible/tree/devel/contrib">Ansible Resources</a>. This is maintained
as a simple repo with pointers to other github projects.</p>
<p>Contrib modules here can be implemented in a variety of languages.
We would like to build up as many of these as possible in as many languages as possible.</p>
...
...
@@ -486,7 +471,7 @@ the program. Stop by the mailing list to inquire about requirements.</p>
@@ -19,6 +19,13 @@ This is primarily useful when you want to change a single line in a file only. F
<th class="head">comments</th>
</tr>
<tr>
<td>insertafter</td>
<td>no</td>
<td>EOF</td>
<td><ul><li>BOF</li><li>EOF</li></ul></td>
<td>Used with <code>state=present</code>. If specified, the line will be inserted after the specified regular expression. Two special values are available; <code>BOF</code> for inserting the line at the beginning of the file, and <code>EOF</code> for inserting the line at the end of the file.</td>
</tr>
<tr>
<td>state</td>
<td>no</td>
<td>present</td>
...
...
@@ -26,20 +33,13 @@ This is primarily useful when you want to change a single line in a file only. F
<td>Whether the line should be there or not.</td>
</tr>
<tr>
<td>name</td>
<td>dest</td>
<td>yes</td>
<td></td>
<td><ul></ul></td>
<td>The file to modify</td>
</tr>
<tr>
<td>insertafter</td>
<td>no</td>
<td>EOF</td>
<td><ul><li>BOF</li><li>EOF</li></ul></td>
<td>Used with <code>state=present</code>. If specified, the line will be inserted after the specified regular expression. Two special values are available; <code>BOF</code> for inserting the line at the beginning of the file, and <code>EOF</code> for inserting the line at the end of the file.</td>
</tr>
<tr>
<td>regexp</td>
<td>yes</td>
<td></td>
...
...
@@ -65,10 +65,10 @@ This is primarily useful when you want to change a single line in a file only. F
@@ -22,7 +22,7 @@ Controls services on remote hosts.
<td>no</td>
<td></td>
<td><ul></ul></td>
<td>If the service does not respond to the status command, name a substring to look for as would be found in the output of the <em>ps</em> command as a stand-in for a status result. If the string is found, the servie will be assumed to be running. (added in Ansible 0.7)</td>
<td>If the service does not respond to the status command, name a substring to look for as would be found in the output of the <em>ps</em> command as a stand-in for a status result. If the string is found, the service will be assumed to be running. (added in Ansible 0.7)</td>
The shell module takes the command name followed by a list of arguments, space delimited. It is almost exactly like the ``command`` module but runs the command through the user's configured shell on the remote node.
The shell module takes the command name followed by a list of arguments, space delimited. It is almost exactly like the ``command`` module but runs the command through a shell (``/bin/sh``) on the remote node.