link module dev guide from modules page
This commit is contained in:
parent
bbc2aca10f
commit
7a8397d60f
5 changed files with 9 additions and 56 deletions
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>ansible-playbook</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible-playbook" lang="en"><a id="id522232"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible-playbook — run an ansible playbook</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible-playbook <filename.yml> … [options]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible playbooks</strong></span> are a configuration and multinode deployment system. Ansible-playbook is the tool
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible-playbook</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible-playbook" lang="en"><a id="id412767"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible-playbook — run an ansible playbook</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible-playbook <filename.yml> … [options]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible playbooks</strong></span> are a configuration and multinode deployment system. Ansible-playbook is the tool
|
||||
used to run them. See the project home page (link below) for more information.</p></div><div class="refsect1" title="ARGUMENTS"><a id="_arguments"></a><h2>ARGUMENTS</h2><div class="variablelist"><dl><dt><span class="term">
|
||||
<span class="strong"><strong>filename.yml</strong></span>
|
||||
</span></dt><dd>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>ansible</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible" lang="en"><a id="id477142"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible — run a command somewhere else</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible <host-pattern> [-f forks] [-m module_name] [-a args]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible</strong></span> is an extra-simple tool/framework/API for doing 'remote things' over
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible" lang="en"><a id="id342828"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible — run a command somewhere else</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible <host-pattern> [-f forks] [-m module_name] [-a args]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible</strong></span> is an extra-simple tool/framework/API for doing 'remote things' over
|
||||
SSH.</p></div><div class="refsect1" title="ARGUMENTS"><a id="_arguments"></a><h2>ARGUMENTS</h2><div class="variablelist"><dl><dt><span class="term">
|
||||
<span class="strong"><strong>host-pattern</strong></span>
|
||||
</span></dt><dd>
|
||||
|
|
29
modules.html
29
modules.html
|
@ -373,32 +373,7 @@ various configuration attributes. Values include ‘installed’, ̵
|
|||
</div>
|
||||
<div class="section" id="writing-your-own-modules">
|
||||
<h2>Writing your own modules<a class="headerlink" href="#writing-your-own-modules" title="Permalink to this headline">¶</a></h2>
|
||||
<p>To write your own modules, simply follow the convention of those
|
||||
already available in /usr/share/ansible. Modules must return JSON but
|
||||
can be written in any language. Modules should return hashes, but
|
||||
hashes can be nested.</p>
|
||||
<p>To support change hooks, modules should return hashes with a changed:
|
||||
True/False element at the top level:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
|
||||
<span class="s">'changed'</span> <span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
|
||||
<span class="s">'something'</span> <span class="p">:</span> <span class="mi">42</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Modules can also choose to indicate a failure scenario by returning a
|
||||
top level <tt class="docutils literal"><span class="pre">failure</span></tt> element with a True value, and a <tt class="docutils literal"><span class="pre">msg</span></tt> element
|
||||
describing the nature of the failure. Other return values are up to
|
||||
the module:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
|
||||
<span class="s">'failure'</span> <span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
|
||||
<span class="s">'msg'</span> <span class="p">:</span> <span class="s">"here is what happened..."</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>When shipping modules, drop them in /usr/share/ansible, or specify the
|
||||
module path to the command line tool or API. It is easy to test
|
||||
modules by running them directly on the command line, passing them
|
||||
arguments just like they would be passed with ansible.</p>
|
||||
<p>See <a class="reference internal" href="moduledev.html"><em>Module Development Guide</em></a>.</p>
|
||||
<div class="admonition-see-also admonition seealso">
|
||||
<p class="first admonition-title">See also</p>
|
||||
<dl class="last docutils">
|
||||
|
@ -406,6 +381,8 @@ arguments just like they would be passed with ansible.</p>
|
|||
<dd>Examples of using modules in /usr/bin/ansible</dd>
|
||||
<dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
|
||||
<dd>Examples of using modules with /usr/bin/ansible-playbook</dd>
|
||||
<dt><a class="reference internal" href="moduledev.html"><em>Module Development Guide</em></a></dt>
|
||||
<dd>How to write your own modules</dd>
|
||||
<dt><a class="reference internal" href="api.html"><em>API & Integrations</em></a></dt>
|
||||
<dd>Examples of using modules with the Python API</dd>
|
||||
<dt><a class="reference external" href="http://groups.google.com/group/ansible-project">Mailing List</a></dt>
|
||||
|
|
|
@ -265,33 +265,7 @@ Will install, upgrade, remove, and list packages with the yum package manager.
|
|||
Writing your own modules
|
||||
````````````````````````
|
||||
|
||||
To write your own modules, simply follow the convention of those
|
||||
already available in /usr/share/ansible. Modules must return JSON but
|
||||
can be written in any language. Modules should return hashes, but
|
||||
hashes can be nested.
|
||||
|
||||
To support change hooks, modules should return hashes with a changed:
|
||||
True/False element at the top level::
|
||||
|
||||
{
|
||||
'changed' : True,
|
||||
'something' : 42
|
||||
}
|
||||
|
||||
Modules can also choose to indicate a failure scenario by returning a
|
||||
top level ``failure`` element with a True value, and a ``msg`` element
|
||||
describing the nature of the failure. Other return values are up to
|
||||
the module::
|
||||
|
||||
{
|
||||
'failure' : True,
|
||||
'msg' : "here is what happened..."
|
||||
}
|
||||
|
||||
When shipping modules, drop them in /usr/share/ansible, or specify the
|
||||
module path to the command line tool or API. It is easy to test
|
||||
modules by running them directly on the command line, passing them
|
||||
arguments just like they would be passed with ansible.
|
||||
See :doc:`moduledev`.
|
||||
|
||||
.. seealso::
|
||||
|
||||
|
@ -299,6 +273,8 @@ arguments just like they would be passed with ansible.
|
|||
Examples of using modules in /usr/bin/ansible
|
||||
:doc:`playbooks`
|
||||
Examples of using modules with /usr/bin/ansible-playbook
|
||||
:doc:`moduledev`
|
||||
How to write your own modules
|
||||
:doc:`api`
|
||||
Examples of using modules with the Python API
|
||||
`Mailing List <http://groups.google.com/group/ansible-project>`_
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue