Docs updates

pull/1256/head
Michael DeHaan 13 years ago
parent 89a00e6385
commit 12fd193450

@ -1 +1 @@
Subproject commit 8e20ed3714b7a43279ecfd38a7812b28e1533f03 Subproject commit 96d39a0dff9ccba4074479ca42eac0068733b803

@ -20,6 +20,7 @@ __docformat__ = 'restructuredtext'
import os import os
import sys import sys
import traceback
from sphinx.application import Sphinx from sphinx.application import Sphinx
from os import path from os import path
@ -68,12 +69,7 @@ class SphinxBuilder(object):
# print "Run 'make htmlman' to recreate the problem." # print "Run 'make htmlman' to recreate the problem."
#print "Your docs are now in %s" % outdir #print "Your docs are now in %s" % outdir
except ImportError, ie: except ImportError, ie:
print >> sys.stderr, "You don't seem to have the following which" traceback.print_exc()
print >> sys.stderr, "are required to make documentation:"
print >> sys.stderr, "\tsphinx.application.Sphinx"
print >> sys.stderr, "This is usually available from the python-sphinx package"
print >> sys.stderr, "=== Error message received while attempting to build==="
print >> sys.stderr, ie
except Exception, ex: except Exception, ex:
print >> sys.stderr, "FAIL! exiting ... (%s)" % ex print >> sys.stderr, "FAIL! exiting ... (%s)" % ex

@ -23,8 +23,8 @@
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Ansible v0.0.1 documentation" href="index.html" /> <link rel="top" title="Ansible v0.0.1 documentation" href="index.html" />
<link rel="next" title="Patterns" href="patterns.html" /> <link rel="next" title="Playbooks" href="playbooks.html" />
<link rel="prev" title="Getting Started" href="gettingstarted.html" /> <link rel="prev" title="Ansible Modules" href="modules.html" />
</head> </head>
<body> <body>
<div class="related"> <div class="related">
@ -34,10 +34,10 @@
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
accesskey="I">index</a></li> accesskey="I">index</a></li>
<li class="right" > <li class="right" >
<a href="patterns.html" title="Patterns" <a href="playbooks.html" title="Playbooks"
accesskey="N">next</a> |</li> accesskey="N">next</a> |</li>
<li class="right" > <li class="right" >
<a href="gettingstarted.html" title="Getting Started" <a href="modules.html" title="Ansible Modules"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul> </ul>
@ -50,7 +50,9 @@
<div class="section" id="yaml-scripts"> <div class="section" id="yaml-scripts">
<h1>YAML Scripts<a class="headerlink" href="#yaml-scripts" title="Permalink to this headline"></a></h1> <h1>YAML Scripts<a class="headerlink" href="#yaml-scripts" title="Permalink to this headline"></a></h1>
<p>This page provides a basic overview of correct YAML syntax.</p> <p>This page provides a basic overview of correct YAML syntax, which is how Ansible
playbooks (our configuration management language) are expressed.
You may also wish to read playbook examples and will quickly pick this up from those.</p>
<div class="section" id="yaml-basics"> <div class="section" id="yaml-basics">
<h2>YAML Basics<a class="headerlink" href="#yaml-basics" title="Permalink to this headline"></a></h2> <h2>YAML Basics<a class="headerlink" href="#yaml-basics" title="Permalink to this headline"></a></h2>
<p>For <cite>ansible</cite>, every YAML script must be a list at it&#8217;s root-most <p>For <cite>ansible</cite>, every YAML script must be a list at it&#8217;s root-most
@ -111,7 +113,7 @@ languages:
dotnet: Lame</pre> dotnet: Lame</pre>
</div> </div>
<p>That&#8217;s all you really need to know about YAML to get started writing <p>That&#8217;s all you really need to know about YAML to get started writing
<cite>Ansible</cite> scripts.</p> <cite>Ansible</cite> playbooks.</p>
<div class="admonition-see-also admonition seealso"> <div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p> <p class="first admonition-title">See also</p>
<dl class="last docutils"> <dl class="last docutils">
@ -137,11 +139,11 @@ languages:
</ul> </ul>
<h4>Previous topic</h4> <h4>Previous topic</h4>
<p class="topless"><a href="gettingstarted.html" <p class="topless"><a href="modules.html"
title="previous chapter">Getting Started</a></p> title="previous chapter">Ansible Modules</a></p>
<h4>Next topic</h4> <h4>Next topic</h4>
<p class="topless"><a href="patterns.html" <p class="topless"><a href="playbooks.html"
title="next chapter">Patterns</a></p> title="next chapter">Playbooks</a></p>
<h3>This Page</h3> <h3>This Page</h3>
<ul class="this-page-menu"> <ul class="this-page-menu">
<li><a href="_sources/YAMLScripts.txt" <li><a href="_sources/YAMLScripts.txt"
@ -150,7 +152,7 @@ languages:
<div id="searchbox" style="display: none"> <div id="searchbox" style="display: none">
<h3>Quick search</h3> <h3>Quick search</h3>
<form class="search" action="search.html" method="get"> <form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" /> <input type="text" name="q" />
<input type="submit" value="Go" /> <input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" /> <input type="hidden" name="area" value="default" />
@ -171,18 +173,18 @@ languages:
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
>index</a></li> >index</a></li>
<li class="right" > <li class="right" >
<a href="patterns.html" title="Patterns" <a href="playbooks.html" title="Playbooks"
>next</a> |</li> >next</a> |</li>
<li class="right" > <li class="right" >
<a href="gettingstarted.html" title="Getting Started" <a href="modules.html" title="Ansible Modules"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2012 Michael DeHaan. &copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 07, 2012. Last updated on Mar 08, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div> </div>
</body> </body>
</html> </html>

@ -1,8 +1,9 @@
YAML Scripts YAML Scripts
============ ============
This page provides a basic overview of correct YAML syntax. This page provides a basic overview of correct YAML syntax, which is how Ansible
playbooks (our configuration management language) are expressed.
You may also wish to read playbook examples and will quickly pick this up from those.
YAML Basics YAML Basics
----------- -----------
@ -74,7 +75,7 @@ Finally, you can combine these data structures::
dotnet: Lame dotnet: Lame
That's all you really need to know about YAML to get started writing That's all you really need to know about YAML to get started writing
`Ansible` scripts. `Ansible` playbooks.
.. seealso:: .. seealso::

@ -1,55 +1,35 @@
API API
=== ```
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim The Python API is very powerful, and is how the ansible CLI and ansible-playbook
placerat nibh, non feugiat risus varius vitae. Donec eu libero are implemented.
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, It's pretty simple::
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae import ansible.runner
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, runner = ansible.runner.Runner(
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies module_name='ping',
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis module_args='',
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna pattern='web*',
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae forks=10
metus. Fusce nec sapien dolor. )
datastructure = runner.run()
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at,
pretium quis sapien. Duis felis metus, sodales sit amet gravida in, The run method returns results per host, grouped by whether they
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin could be contacted or not. Return types are module specific, as
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, expressed in the 'ansible-modules' documentation.::
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada
molestie, nisi nunc placerat libero, vel vulputate elit tellus et {
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat "dark" : {
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan "web1.example.com" : "failure message"
lorem eget leo dictum viverra. }
"contacted" : {
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean "web2.example.com" : 1
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar }
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis }
dolor. Mauris sodales porta enim, non ultricies dolor luctus
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, A module can return any type of JSON data it wants, so Ansible can
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra be used as a framework to rapidly build powerful applications and scripts.
arcu sem a ante. Praesent nec metus vestibulum augue eleifend
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh
turpis. Proin ac nisi ligula, a pretium augue.
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl,
eget lobortis mi magna sed metus. Cras justo est, tempus quis
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet
lacus. Maecenas interdum viverra laoreet. Quisque elementum
sollicitudin ullamcorper.
Pellentesque mauris sem, malesuada at lobortis in, porta eget
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin
hendrerit mi tincidunt dui fermentum placerat.

@ -1,55 +1,9 @@
Communicate Communicate and Get Involved
=========== ===========================
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim * Join the `ansible-project mailing list <http://groups.google.com/group/ansible-project>`_ on Google Groups
placerat nibh, non feugiat risus varius vitae. Donec eu libero * Join `#ansible <irc://irc.freenode.net/#ansible>`_ on the `freenode IRC network <http://freenode.net/>`_
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in * Visit the `project page <https://github.com/ansible/ansible>`_ on Github
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum,
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa,
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae
metus. Fusce nec sapien dolor.
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, - View the `issue tracker <https://github.com/ansible/ansible/issues>`_
pretium quis sapien. Duis felis metus, sodales sit amet gravida in,
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at,
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada
molestie, nisi nunc placerat libero, vel vulputate elit tellus et
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan
lorem eget leo dictum viverra.
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis
dolor. Mauris sodales porta enim, non ultricies dolor luctus
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate,
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra
arcu sem a ante. Praesent nec metus vestibulum augue eleifend
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh
turpis. Proin ac nisi ligula, a pretium augue.
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl,
eget lobortis mi magna sed metus. Cras justo est, tempus quis
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet
lacus. Maecenas interdum viverra laoreet. Quisque elementum
sollicitudin ullamcorper.
Pellentesque mauris sem, malesuada at lobortis in, porta eget
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin
hendrerit mi tincidunt dui fermentum placerat.

@ -1,71 +1,65 @@
Examples Examples
======== ========
Examples 1 .. seealso::
``````````
:doc:`modules`
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim A list of available modules
placerat nibh, non feugiat risus varius vitae. Donec eu libero :doc:`playbooks`
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in Alternative ways to use ansible
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum,
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae Parallelism and Shell Commands
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis ``````````````````````````````
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa,
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies Reboot all web servers in Atlanta, 10 at a time::
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna ssh-agent bash
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae ssh-add ~/.ssh/id_rsa.pub
metus. Fusce nec sapien dolor.
ansible atlanta -a "/sbin/reboot" -f 10
Examples 2 The -f 10 specifies the usage of 10 simultaneous processes.
``````````
Note that other than the command module, ansible modules do not work like simple scripts. They make the remote system look like you state, and run the commands neccessary to get it there.
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at,
pretium quis sapien. Duis felis metus, sodales sit amet gravida in,
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin Example 2: Time Limited Background Operations
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, `````````````````````````````````````````````
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada
molestie, nisi nunc placerat libero, vel vulputate elit tellus et
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat Long running operations can be backgrounded, and their status can be checked on later. The same job ID is given to the same task on all hosts, so you won't lose track. Polling support is pending in the command line.::
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan
lorem eget leo dictum viverra. ansible all -B 3600 -a "/usr/bin/long_running_operation --do-stuff"
ansible all -n job_status -a jid=123456789
Examples 3
`````````` Any module other than 'copy' or 'template' can be backgrounded.
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar Examples 3: File Transfer & Templating
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis ``````````````````````````````````````
dolor. Mauris sodales porta enim, non ultricies dolor luctus
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, Ansible can SCP lots of files to multiple machines in parallel, and optionally use them as template sources.
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra
arcu sem a ante. Praesent nec metus vestibulum augue eleifend To just transfer a file directly to many different servers::
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh ansible atlanta copy -a "/etc/hosts /tmp/hosts"
turpis. Proin ac nisi ligula, a pretium augue.
To use templating, first run the setup module to put the template variables you would like to use on the remote host. Then use the template module to write the files using the templates. Templates are written in Jinja2 format. Playbooks (covered below) will run the setup module for you, making this even simpler.::
Examples 3
`````````` ansible webservers -m setup -a "favcolor=red ntp_server=192.168.1.1"
ansible webservers -m template -a "src=/srv/motd.j2 dest=/etc/motd"
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed ansible webservers -m template -a "src=/srv/ntp.j2 dest=/etc/ntp.conf"
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl,
eget lobortis mi magna sed metus. Cras justo est, tempus quis Need something like the fqdn in a template? If facter or ohai are installed, data from these projects will also be made available to the template engine, using 'facter' and 'ohai' prefixes for each.
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae Examples 3: Deploying From Source Control
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc `````````````````````````````````````````
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet
lacus. Maecenas interdum viverra laoreet. Quisque elementum Deploy your webapp straight from git::
sollicitudin ullamcorper.
ansible webservers -m git -a "repo=git://foo dest=/srv/myapp version=HEAD"
Examples 4
`````````` Since ansible modules can notify change handlers (see 'Playbooks') it is possible to tell ansible to run specific tasks when the code is updated, such as deploying Perl/Python/PHP/Ruby directly from git and then restarting apache.
Pellentesque mauris sem, malesuada at lobortis in, porta eget
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin
hendrerit mi tincidunt dui fermentum placerat.

@ -1,67 +1,100 @@
Getting Started Getting Started
=============== ===============
How to ansible How to download ansible and get started using it
.. seealso:: .. seealso::
:doc:`examples`
Examples of basic commands
:doc:`YAMLScripts` :doc:`YAMLScripts`
Complete documentation of the YAML syntax `ansible` understands. Complete documentation of the YAML syntax `ansible` understands for playbooks.
:doc:`playbooks`
Learning ansible's configuration management language
What you need :doc:`modules`
------------- Learn about modules that ship with ansible
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim Requirements
placerat nibh, non feugiat risus varius vitae. Donec eu libero ````````````
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, Requirements are extremely minimal.
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae If you are running python 2.6 on the **overlord** machine, you will
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis need:
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa,
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies * ``paramiko``
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis * ``PyYAML``
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna * ``python-jinja2`` (for playbooks)
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae
metus. Fusce nec sapien dolor. If you are running less than Python 2.6, you will also need:
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, * The Python 2.4 or 2.5 backport of the ``multiprocessing`` module
pretium quis sapien. Duis felis metus, sodales sit amet gravida in,
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin - `Installation and Testing Instructions <http://code.google.com/p/python-multiprocessing/wiki/Install>`_
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at,
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada * ``simplejson``
molestie, nisi nunc placerat libero, vel vulputate elit tellus et
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat On the managed nodes, to use templating, you will need:
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan
lorem eget leo dictum viverra. * ``python-jinja2`` (you can install this with ansible)
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean Developer Requirements
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar ``````````````````````
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis
dolor. Mauris sodales porta enim, non ultricies dolor luctus For developers, you may wish to have:
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate,
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra * ``asciidoc`` (for building manpage documentation)
arcu sem a ante. Praesent nec metus vestibulum augue eleifend * ``python-sphinx`` (for building content for ansible.github.com)
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh
turpis. Proin ac nisi ligula, a pretium augue. Getting Ansible
```````````````
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, Tagged releases are available as tar.gz files from the Ansible github
eget lobortis mi magna sed metus. Cras justo est, tempus quis project page:
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae * `Ansible/downloads <https://github.com/ansible/ansible/downloads>`_
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet You can also clone the git repository yourself and install Ansible in
lacus. Maecenas interdum viverra laoreet. Quisque elementum one of two ways:
sollicitudin ullamcorper.
Pellentesque mauris sem, malesuada at lobortis in, porta eget Python Distutils
urna. Duis aliquet quam eget risus elementum quis auctor ligula ++++++++++++++++
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat You can also install Ansible using Python Distutils::
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin $ git clone git://github.com/ansible/ansible.git
hendrerit mi tincidunt dui fermentum placerat. $ cd ./ansible
$ sudo make install
Via RPM
+++++++
In the near future, pre-built RPMs will be available through your distribution. Until that time you
can use the ``make rpm`` command::
$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ make rpm
$ sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/ansible-1.0-1.noarch.rpm
Your first commands
```````````````````
Edit /etc/ansible/hosts and put one or more remote systems in it, for which you have your SSH
key in ``authorized_keys``::
192.168.1.50
aserver.example.org
bserver.example.org
Now try this:
ssh-agent bash
ssh-add ~/.ssh/id_rsa
ansible all -m ping
Congratulations. You've just contacted your nodes with Ansible. It's now time to read some
of the more real-world examples.

@ -5,102 +5,48 @@
Ansible Ansible
======= =======
Ansible is a extra-simple tool/API for doing 'parallel remote things' Ansible is a radically simple deployment, configuration, and command execution framework.
over SSH -- whether executing commands, running "modules", or Other tools in this space have been too complicated for too long, require too much bootstrapping,
executing larger 'playbooks' that can serve as a configuration and have too much learning curve. Ansible is dead simple and painless to extend. For comparison, Puppet and Chef have about 60k lines of code. Ansible's core is a little over 1000 lines.
management or deployment system.
While `Func installation <http://fedorahosted.org/func>`_ which I Ansible isn't just for configuration -- it's also great for Ad-Hoc tasks,
co-wrote, aspired to avoid using SSH and have it's own daemon quickly firing off commands against nodes. Where Ansible excels though, is expressing complex multi-node deployment processes, executing complex sequences of commands on different hosts through the "playbooks" feature.
infrastructure, Ansible aspires to be quite different and more
minimal, but still able to grow more modularly over time. This is
based on talking to a lot of users of various tools and wishing to
eliminate problems with connectivity and long running daemons, or not
picking tool `X` because they preferred to code in `Y`. Further,
playbooks take things a whole step further, building the config and
deployment system I always wanted to build.
Why use Ansible versus something else? (Fabric, Capistrano, Ansible does not require programming in any particular language -- you can write modules
as scripts or programs that return simple JSON.
Why use Ansible versus something else? (Puppet, Chef, Fabric, Capistrano,
mCollective, Func, SaltStack, etc?) It will have far less code, it mCollective, Func, SaltStack, etc?) It will have far less code, it
will be more correct, and it will be the easiest thing to hack on and will be more correct, and it will be the easiest thing to hack on and
use you'll ever see -- regardless of your favorite language of choice. use you'll ever see -- regardless of your favorite language of choice.
Want to only code plugins in bash or clojure? Ansible doesn't care. Systems management doesn't have to be complicated. Ansible's docs will remain
The docs will fit on one page and the source will be blindingly short & simple, and the source will be blindingly obvious.
obvious.
Design Principles Design Goals
````````````````` ````````````
* Dead simple setup * Dead simple setup
* Super fast & parallel by default * Super fast & parallel by default
* No server or client daemons; use existing SSHd * No server or client daemons; use existing SSHd out of the box
* No additional software required on client boxes * No additional software required on client boxes
* Modules can be written in ANY language * Modules can be written in ANY language
* Awesome API for creating very powerful distributed scripts * Awesome API for creating very powerful distributed scripts
* Be usable as non-root * Be usable as non-root
* Create the easiest config management system to use, ever. * Create the easiest config management system to use, ever.
About the Author
````````````````
Requirements Michael DeHaan is a Raleigh, NC based software developer and architect. He created other
```````````` DevOps programs such as Cobbler, the popular Linux install server.
Cobbler is used to deploy mission critical systems all over the planet, in industries
Requirements are extremely minimal. ranging from massively multiplayer gaming, core internet infrastructure, finance,
chip design, and more. Michael also helped co-author of Func, which is used
If you are running python 2.6 on the **overlord** machine, you will to orchestrate systems in lots of diverse places.
need:
* ``paramiko``
* ``PyYAML``
* ``python-jinja2`` (for playbooks)
* ``Asciidoc`` (for building documentation)
If you are running less than Python 2.6, you will also need:
* The Python 2.4 or 2.5 backport of the ``multiprocessing`` module
- `Installation and Testing Instructions <http://code.google.com/p/python-multiprocessing/wiki/Install>`_
* ``simplejson``
On the managed nodes, to use templating, you will need:
* ``python-jinja2`` (you can install this with ansible)
Getting Ansible
```````````````
Tagged releases are available as tar.gz files from the Ansible github
project page:
* `Ansible/downloads <https://github.com/ansible/ansible/downloads>`_
You can also clone the git repository yourself and install Ansible in
one of two ways:
Python Distutils
++++++++++++++++
You can install Ansible using Python Distutils::
$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ sudo make install
Via RPM
+++++++
In the future, pre-built RPMs may be available. Until that time you
can use the ``make rpm`` command::
$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ make rpm
$ sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/ansible-1.0-1.noarch.rpm
Ansible is an GPLv3 licensed open source project, so see the contributions section for how to
get involved.
Contents Contents
======== ========
@ -109,21 +55,11 @@ Contents
:maxdepth: 3 :maxdepth: 3
gettingstarted gettingstarted
YAMLScripts
patterns patterns
modules modules
YAMLScripts
playbooks playbooks
examples examples
api api
communicate communicate
man man
Communicate or Get Involved
===========================
* Join the `ansible-project mailing list <http://groups.google.com/group/ansible-project>`_ on Google Groups
* Join `#ansible <irc://irc.freenode.net/#ansible>`_ on the `freenode IRC network <http://freenode.net/>`_
* Visit the `project page <https://github.com/ansible/ansible>`_ on Github
- View the `issue tracker <https://github.com/ansible/ansible/issues>`_

@ -3,19 +3,10 @@
Man Pages Man Pages
========= =========
Ansile ships with a handfull of manpages to help you on your journey. Ansible's manpage lists available command line options.
ansible(1) ansible(1)
---------- ----------
* `View ansible.1 <man/ansible.1.html>`_ * `View ansible.1 <man/ansible.1.html>`_
ansible-modules(5)
------------------
* `View ansible-modules.5 <man/ansible-modules.5.html>`_
ansible-playbook(5)
-------------------
* `View ansible-playbook.5 <man/ansible-playbook.5.html>`_

@ -1,55 +1,201 @@
Modules Ansible Modules
======= ===============
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim .. seealso::
placerat nibh, non feugiat risus varius vitae. Donec eu libero
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in :doc:`examples`
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, Examples of using modules in /usr/bin/ansible
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus :doc:`playbooks`
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae Examples of using modules with /usr/bin/ansible-playbook
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis :doc:`api`
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, Examples of using modules with the Python API
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna About Modules
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae `````````````
metus. Fusce nec sapien dolor.
Ansible ships with a number of modules that can be executed directly on remote hosts or through
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, ansible playbooks.
pretium quis sapien. Duis felis metus, sodales sit amet gravida in,
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, Idempotence
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada ```````````
molestie, nisi nunc placerat libero, vel vulputate elit tellus et
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat Most modules other than command are idempotent, meaning they will seek to avoid changes
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan unless a change needs to be made. When using ansible playbooks, these modules can
lorem eget leo dictum viverra. trigger change events. Unless otherwise noted, all modules support change hooks.
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar command
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis ```````
dolor. Mauris sodales porta enim, non ultricies dolor luctus
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, The command module takes the command name followed by a list of arguments, space delimited.
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra This is the only module that does not use key=value style parameters.
arcu sem a ante. Praesent nec metus vestibulum augue eleifend
suscipit. In feugiat, sem nec dignissim consequat, velit tortor Example usage::
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh
turpis. Proin ac nisi ligula, a pretium augue. /sbin/shutdown -t now
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed This module does not support change hooks and returns the return code from the program as well as timing information about how long the command was running for.
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl,
eget lobortis mi magna sed metus. Cras justo est, tempus quis
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et copy
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae ````
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet The copy module moves a file on the local box to remote locations.
lacus. Maecenas interdum viverra laoreet. Quisque elementum
sollicitudin ullamcorper. *src*::
Pellentesque mauris sem, malesuada at lobortis in, porta eget Local absolute path to a file to copy to the remote server
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat *dest*::
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin Remote absolute path where the file should end up
hendrerit mi tincidunt dui fermentum placerat.
This module also returns md5sum information about the resultant file.
facter
``````
Runs the discovery program 'facter' on the remote system, returning
JSON data that can be useful for inventory purposes.
Requires that 'facter' and 'ruby-json' be installed on the remote end.
This module is informative only - it takes no parameters & does not support change hooks,
nor does it make any changes on the system.
git
```
Deploys software from git checkouts.
*repo*::
git or http protocol address of the repo to checkout
*dest*::
where to check it out, an absolute directory path
*version*::
what version to check out -- either the git SHA, the literal string 'HEAD', or a tag name
ohai
````
Similar to the facter module, this returns JSON inventory data. Ohai
data is a bit more verbose and nested than facter.
Requires that 'ohai' be installed on the remote end.
This module is information only - it takes no parameters & does not
support change hooks, nor does it make any changes on the system.
ping
````
A trivial test module, this module always returns the integer '1' on
successful contact.
This module does not support change hooks.
This module is informative only - it takes no parameters & does not
support change hooks, nor does it make any changes on the system.
service
```````
Controls services on remote machines.
*state*
Values are 'started', 'stopped', or 'restarted'. Started/stopped
are idempotent actions that will not run commands unless neccessary.
'restarted' will always bounce the service
*name*
The name of the service
setup
`````
Writes a JSON file containing key/value data, for use in templating.
Call this once before using the template modules. Playbooks will
execute this module automatically as the first step in each play.
If facter or ohai are installed, variables from these programs will also
be snapshotted into the JSON file for usage in templating. These variables
are prefixed with 'facter_' and 'ohai_" so it's easy to tell their source.
*metadata*
Optionally overrides the default JSON file location of /etc/ansible/setup or ~/ansible/setup
depending on what remote user has been specified.
If used, also supply the metadata parameter to the template module.
*anything*
any other parameters can be named basically anything, and set a key=value
pair in the JSON file for use in templating.
template
````````
Templates a file out to a remote server. Call the setup module prior to usage.
*src*
path of a Jinja2 formatted template on the local server
*dest*
location to render the template on the remote server
*metadata*
location of a JSON file to use to supply template data. Default is /etc/ansible/setup
which is the same as the default for the setup module. Change if running as a non-root
remote user who does not have permissions on /etc/ansible.
This module also returns md5sum information about the resultant file.
user
````
This module is in plan.
yum
```
This module is in plan.
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. 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 values are up to the module.

@ -1,55 +1,69 @@
Patterns Patterns
======== ========
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim How to select hosts you wish to manage
placerat nibh, non feugiat risus varius vitae. Donec eu libero
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in .. seealso::
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum,
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus :doc:`examples`
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae Examples of basic commands
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis :doc:`playbooks`
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, Learning ansible's configuration management language
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis Ansible works against multiple systems in your infrastructure at the
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna same time. It does this by selecting portions of systems listed in Ansible's inventory file,
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae which defaults to /etc/ansible/hosts, and looks like this::
metus. Fusce nec sapien dolor.
mail.example.com
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at,
pretium quis sapien. Duis felis metus, sodales sit amet gravida in, [webservers]
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin foo.example.com
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, bar.example.com
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada
molestie, nisi nunc placerat libero, vel vulputate elit tellus et [dbservers]
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat one.example.com
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan two.example.com
lorem eget leo dictum viverra. three.example.com
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean Targetting All Systems
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar ``````````````````````
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis
dolor. Mauris sodales porta enim, non ultricies dolor luctus The pattern 'all' or '*' targets all systems in the inventory file.
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate,
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra Specific Hosts
arcu sem a ante. Praesent nec metus vestibulum augue eleifend ``````````````
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh It is possible to address specific hosts:
turpis. Proin ac nisi ligula, a pretium augue.
one.example.com
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed one.example.com:two.example.com
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl,
eget lobortis mi magna sed metus. Cras justo est, tempus quis Groups
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et ``````
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc The following patterns address one or more groups:
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet
lacus. Maecenas interdum viverra laoreet. Quisque elementum webservers
sollicitudin ullamcorper. webservers:dbservers
Pellentesque mauris sem, malesuada at lobortis in, porta eget There is also a magic group 'ungrouped' which selects systems not in a group.
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies Wildcards
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat `````````
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin Individual hosts, but not groups, can also be referenced using wildcards:
hendrerit mi tincidunt dui fermentum placerat.
*.example.com
*.com
Mixing Things Up
````````````````
Specific hosts, wildcards, and groups can all be mixed in the same pattern
one*.com:dbservers
It is not possible to target a host not in the inventory file.

@ -1,55 +1,118 @@
Playbooks Playbooks
========= =========
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim .. seealso::
placerat nibh, non feugiat risus varius vitae. Donec eu libero
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in :doc:`YAMLScripts`
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, Learn about YAML syntax
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus :doc:`modules`
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae Learn about available modules and writing your own
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis :doc:`patterns`
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, Learn about how to select hosts
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna Playbooks are a completely different way to use ansible and are particularly awesome.
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae
metus. Fusce nec sapien dolor. They are the basis for a really simple configuration management and deployment system, unlike any that already exist, and one that is very well suited to deploying complex multi-machine applications. While you might run the main ansible program for ad-hoc tasks, playbooks are more likely to be kept in source control and used to push out your configuration or assure the configurations of your remote systems are in spec.
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at,
pretium quis sapien. Duis felis metus, sodales sit amet gravida in, Playbook Example
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin ````````````````
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at,
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada Playbooks are expressed in YAML format and have a minimum of syntax. Each playbook is composed
molestie, nisi nunc placerat libero, vel vulputate elit tellus et of one or more patterns in a list. By composing a playbook of multiple patterns, it is possible
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat to orchestrate multi-machine deployments, running certain steps on all machines in
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan the webservers group, then certain steps on the database server group, then more commands
lorem eget leo dictum viverra. back on the webservers group, etc::
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean ---
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar - hosts: all
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis vars:
dolor. Mauris sodales porta enim, non ultricies dolor luctus http_port: 80
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, max_clients: 200
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra user: root
arcu sem a ante. Praesent nec metus vestibulum augue eleifend tasks:
suscipit. In feugiat, sem nec dignissim consequat, velit tortor - include: base.yml somevar=3 othervar=4
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh - name: write the apache config file
turpis. Proin ac nisi ligula, a pretium augue. action: template src=/srv/httpd.j2 dest=/etc/httpd.conf
notify:
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed - restart apache
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, - name: ensure apache is running
eget lobortis mi magna sed metus. Cras justo est, tempus quis action: service name=httpd state=started
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et handlers:
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae - include: handlers.yml
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet Hosts line
lacus. Maecenas interdum viverra laoreet. Quisque elementum ``````````
sollicitudin ullamcorper.
The hosts line is alist of one or more groups or host patterns, seperated by colons.
Pellentesque mauris sem, malesuada at lobortis in, porta eget
urna. Duis aliquet quam eget risus elementum quis auctor ligula webservers:dbservers:*.foo.example.com
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat Vars section
tristique lobortis. Suspendisse est enim, tristique eu convallis id, ````````````
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin
hendrerit mi tincidunt dui fermentum placerat. A list of variables that can be used in the 'action' lines of the template, or in
included templates. Variables are deferenced like this::
{{ varname }}
These variables will be pushed down to the managed systems for use in templating operations.
Further, if there are discovered variables about the system (say, if facter or ohai were
installed) these variables bubble up back into the playbook, and can be used on each
system just like explicitly set variables. Facter variables are prefixed with 'facter'
and Ohai variables are prefixed with 'ohai'.
Tasks list
``````````
Tasks are executed in order, one at a time, against all machines matched by the host
pattern, before moving on to the next task. Failed tasks are taken out of the rotation.
Task name and comment
`````````
Each task has a name (required) and optional comment. This is for informational purposes only
Task action
```````````
The action line is the name of an ansible module followed by parameters. Usually these
are expressed in key=value form, except for the command module, which looks just like a Linux/Unix
command line. See the module documentation for more info.
Notify statements
`````````````````
Nearly all modules are written to be 'idempotent' and can signal when they have affected a change
on the remote system. If a notify statement is used, the named handler will be run against
each system where a change was effected, but NOT on systems where no change occurred.
Handlers
````````
Handlers are lists of tasks, not really any different from regular tasks, that are referenced
by name.
Includes
````````
Not all tasks have to be listed directly in the main file. An include file can contain
a list of tasks (in YAML) as well, optionally passing extra variables into the file.
Variables passed in can be deferenced like this:
{{ variable }}
Asynchronous Actions and Polling
````````````````````````````````
(Information on this feature is pending)
Executing A Playbook
````````````````````
To run a playbook::
ansible-playbook playbook.yml

@ -79,6 +79,14 @@ div.sphinxsidebar input {
font-size: 1em; font-size: 1em;
} }
div.sphinxsidebar input[type="text"] {
width: 170px;
}
div.sphinxsidebar input[type="submit"] {
width: 30px;
}
img { img {
border: 0; border: 0;
} }
@ -236,7 +244,6 @@ img.align-center, .figure.align-center, object.align-center {
} }
.align-center { .align-center {
clear: both;
text-align: center; text-align: center;
} }

@ -363,10 +363,13 @@ var Search = {
var fullname = (prefix ? prefix + '.' : '') + name; var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) { if (fullname.toLowerCase().indexOf(object) > -1) {
match = objects[prefix][name]; match = objects[prefix][name];
descr = objnames[match[1]] + _(', in ') + titles[match[0]]; descr = objnames[match[1]][2] + _(', in ') + titles[match[0]];
// XXX the generated anchors are not generally correct anchor = match[3];
// XXX there may be custom prefixes if (anchor == '')
result = [filenames[match[0]], fullname, '#'+fullname, descr]; anchor = fullname;
else if (anchor == '-')
anchor = objnames[match[1]][1] + '-' + fullname;
result = [filenames[match[0]], fullname, '#'+anchor, descr];
switch (match[2]) { switch (match[2]) {
case 1: objectResults.push(result); break; case 1: objectResults.push(result); break;
case 0: importantResults.push(result); break; case 0: importantResults.push(result); break;
@ -489,7 +492,7 @@ var Search = {
listItem.slideDown(5, function() { listItem.slideDown(5, function() {
displayNextItem(); displayNextItem();
}); });
}); }, "text");
} else { } else {
// no source available, just display title // no source available, just display title
Search.output.append(listItem); Search.output.append(listItem);

@ -23,7 +23,7 @@
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Ansible v0.0.1 documentation" href="index.html" /> <link rel="top" title="Ansible v0.0.1 documentation" href="index.html" />
<link rel="next" title="Communicate" href="communicate.html" /> <link rel="next" title="Communicate and Get Involved" href="communicate.html" />
<link rel="prev" title="Examples" href="examples.html" /> <link rel="prev" title="Examples" href="examples.html" />
</head> </head>
<body> <body>
@ -34,7 +34,7 @@
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
accesskey="I">index</a></li> accesskey="I">index</a></li>
<li class="right" > <li class="right" >
<a href="communicate.html" title="Communicate" <a href="communicate.html" title="Communicate and Get Involved"
accesskey="N">next</a> |</li> accesskey="N">next</a> |</li>
<li class="right" > <li class="right" >
<a href="examples.html" title="Examples" <a href="examples.html" title="Examples"
@ -50,54 +50,34 @@
<div class="section" id="api"> <div class="section" id="api">
<h1>API<a class="headerlink" href="#api" title="Permalink to this headline"></a></h1> <h1>API<a class="headerlink" href="#api" title="Permalink to this headline"></a></h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim <p>The Python API is very powerful, and is how the ansible CLI and ansible-playbook
placerat nibh, non feugiat risus varius vitae. Donec eu libero are implemented.</p>
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in <p>It&#8217;s pretty simple:</p>
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, <div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">ansible.runner</span>
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae <span class="n">runner</span> <span class="o">=</span> <span class="n">ansible</span><span class="o">.</span><span class="n">runner</span><span class="o">.</span><span class="n">Runner</span><span class="p">(</span>
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis <span class="n">module_name</span><span class="o">=</span><span class="s">&#39;ping&#39;</span><span class="p">,</span>
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, <span class="n">module_args</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies <span class="n">pattern</span><span class="o">=</span><span class="s">&#39;web*&#39;</span><span class="p">,</span>
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis <span class="n">forks</span><span class="o">=</span><span class="mi">10</span>
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna <span class="p">)</span>
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae <span class="n">datastructure</span> <span class="o">=</span> <span class="n">runner</span><span class="o">.</span><span class="n">run</span><span class="p">()</span>
metus. Fusce nec sapien dolor.</p> </pre></div>
<p>Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, </div>
pretium quis sapien. Duis felis metus, sodales sit amet gravida in, <p>The run method returns results per host, grouped by whether they
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin could be contacted or not. Return types are module specific, as
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, expressed in the &#8216;ansible-modules&#8217; documentation.:</p>
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada <div class="highlight-python"><pre>{
molestie, nisi nunc placerat libero, vel vulputate elit tellus et "dark" : {
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat "web1.example.com" : "failure message"
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan }
lorem eget leo dictum viverra.</p> "contacted" : {
<p>Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean "web2.example.com" : 1
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar }
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis }</pre>
dolor. Mauris sodales porta enim, non ultricies dolor luctus </div>
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, <p>A module can return any type of JSON data it wants, so Ansible can
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra be used as a framework to rapidly build powerful applications and scripts.</p>
arcu sem a ante. Praesent nec metus vestibulum augue eleifend
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh
turpis. Proin ac nisi ligula, a pretium augue.</p>
<p>In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl,
eget lobortis mi magna sed metus. Cras justo est, tempus quis
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet
lacus. Maecenas interdum viverra laoreet. Quisque elementum
sollicitudin ullamcorper.</p>
<p>Pellentesque mauris sem, malesuada at lobortis in, porta eget
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin
hendrerit mi tincidunt dui fermentum placerat.</p>
</div> </div>
@ -111,7 +91,7 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
title="previous chapter">Examples</a></p> title="previous chapter">Examples</a></p>
<h4>Next topic</h4> <h4>Next topic</h4>
<p class="topless"><a href="communicate.html" <p class="topless"><a href="communicate.html"
title="next chapter">Communicate</a></p> title="next chapter">Communicate and Get Involved</a></p>
<h3>This Page</h3> <h3>This Page</h3>
<ul class="this-page-menu"> <ul class="this-page-menu">
<li><a href="_sources/api.txt" <li><a href="_sources/api.txt"
@ -120,7 +100,7 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<div id="searchbox" style="display: none"> <div id="searchbox" style="display: none">
<h3>Quick search</h3> <h3>Quick search</h3>
<form class="search" action="search.html" method="get"> <form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" /> <input type="text" name="q" />
<input type="submit" value="Go" /> <input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" /> <input type="hidden" name="area" value="default" />
@ -141,7 +121,7 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
>index</a></li> >index</a></li>
<li class="right" > <li class="right" >
<a href="communicate.html" title="Communicate" <a href="communicate.html" title="Communicate and Get Involved"
>next</a> |</li> >next</a> |</li>
<li class="right" > <li class="right" >
<a href="examples.html" title="Examples" <a href="examples.html" title="Examples"
@ -151,8 +131,8 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2012 Michael DeHaan. &copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 07, 2012. Last updated on Mar 08, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div> </div>
</body> </body>
</html> </html>

@ -7,7 +7,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Communicate &mdash; Ansible v0.0.1 documentation</title> <title>Communicate and Get Involved &mdash; Ansible v0.0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
@ -48,56 +48,16 @@
<div class="bodywrapper"> <div class="bodywrapper">
<div class="body"> <div class="body">
<div class="section" id="communicate"> <div class="section" id="communicate-and-get-involved">
<h1>Communicate<a class="headerlink" href="#communicate" title="Permalink to this headline"></a></h1> <h1>Communicate and Get Involved<a class="headerlink" href="#communicate-and-get-involved" title="Permalink to this headline"></a></h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim <ul class="simple">
placerat nibh, non feugiat risus varius vitae. Donec eu libero <li>Join the <a class="reference external" href="http://groups.google.com/group/ansible-project">ansible-project mailing list</a> on Google Groups</li>
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in <li>Join <a class="reference external" href="irc://irc.freenode.net/#ansible">#ansible</a> on the <a class="reference external" href="http://freenode.net/">freenode IRC network</a></li>
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, <li>Visit the <a class="reference external" href="https://github.com/ansible/ansible">project page</a> on Github<ul>
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus <li>View the <a class="reference external" href="https://github.com/ansible/ansible/issues">issue tracker</a></li>
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae </ul>
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis </li>
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, </ul>
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae
metus. Fusce nec sapien dolor.</p>
<p>Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at,
pretium quis sapien. Duis felis metus, sodales sit amet gravida in,
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at,
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada
molestie, nisi nunc placerat libero, vel vulputate elit tellus et
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan
lorem eget leo dictum viverra.</p>
<p>Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis
dolor. Mauris sodales porta enim, non ultricies dolor luctus
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate,
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra
arcu sem a ante. Praesent nec metus vestibulum augue eleifend
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh
turpis. Proin ac nisi ligula, a pretium augue.</p>
<p>In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl,
eget lobortis mi magna sed metus. Cras justo est, tempus quis
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet
lacus. Maecenas interdum viverra laoreet. Quisque elementum
sollicitudin ullamcorper.</p>
<p>Pellentesque mauris sem, malesuada at lobortis in, porta eget
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin
hendrerit mi tincidunt dui fermentum placerat.</p>
</div> </div>
@ -120,7 +80,7 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<div id="searchbox" style="display: none"> <div id="searchbox" style="display: none">
<h3>Quick search</h3> <h3>Quick search</h3>
<form class="search" action="search.html" method="get"> <form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" /> <input type="text" name="q" />
<input type="submit" value="Go" /> <input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" /> <input type="hidden" name="area" value="default" />
@ -151,8 +111,8 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2012 Michael DeHaan. &copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 07, 2012. Last updated on Mar 08, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div> </div>
</body> </body>
</html> </html>

@ -50,68 +50,53 @@
<div class="section" id="examples"> <div class="section" id="examples">
<h1>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h1> <h1>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h1>
<div class="section" id="examples-1"> <div class="admonition-see-also admonition seealso">
<h2>Examples 1<a class="headerlink" href="#examples-1" title="Permalink to this headline"></a></h2> <p class="first admonition-title">See also</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim <dl class="last docutils">
placerat nibh, non feugiat risus varius vitae. Donec eu libero <dt><a class="reference internal" href="modules.html"><em>Ansible Modules</em></a></dt>
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in <dd>A list of available modules</dd>
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, <dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus <dd>Alternative ways to use ansible</dd>
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae </dl>
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa,
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae
metus. Fusce nec sapien dolor.</p>
</div> </div>
<div class="section" id="examples-2"> <div class="section" id="parallelism-and-shell-commands">
<h2>Examples 2<a class="headerlink" href="#examples-2" title="Permalink to this headline"></a></h2> <h2>Parallelism and Shell Commands<a class="headerlink" href="#parallelism-and-shell-commands" title="Permalink to this headline"></a></h2>
<p>Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, <p>Reboot all web servers in Atlanta, 10 at a time:</p>
pretium quis sapien. Duis felis metus, sodales sit amet gravida in, <div class="highlight-python"><pre>ssh-agent bash
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin ssh-add ~/.ssh/id_rsa.pub
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at,
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada ansible atlanta -a "/sbin/reboot" -f 10</pre>
molestie, nisi nunc placerat libero, vel vulputate elit tellus et </div>
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat <p>The -f 10 specifies the usage of 10 simultaneous processes.</p>
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan <p>Note that other than the command module, ansible modules do not work like simple scripts. They make the remote system look like you state, and run the commands neccessary to get it there.</p>
lorem eget leo dictum viverra.</p> </div>
<div class="section" id="example-2-time-limited-background-operations">
<h2>Example 2: Time Limited Background Operations<a class="headerlink" href="#example-2-time-limited-background-operations" title="Permalink to this headline"></a></h2>
<p>Long running operations can be backgrounded, and their status can be checked on later. The same job ID is given to the same task on all hosts, so you won&#8217;t lose track. Polling support is pending in the command line.:</p>
<div class="highlight-python"><pre>ansible all -B 3600 -a "/usr/bin/long_running_operation --do-stuff"
ansible all -n job_status -a jid=123456789</pre>
</div>
<p>Any module other than &#8216;copy&#8217; or &#8216;template&#8217; can be backgrounded.</p>
</div>
<div class="section" id="examples-3-file-transfer-templating">
<h2>Examples 3: File Transfer &amp; Templating<a class="headerlink" href="#examples-3-file-transfer-templating" title="Permalink to this headline"></a></h2>
<p>Ansible can SCP lots of files to multiple machines in parallel, and optionally use them as template sources.</p>
<p>To just transfer a file directly to many different servers:</p>
<div class="highlight-python"><pre>ansible atlanta copy -a "/etc/hosts /tmp/hosts"</pre>
</div>
<p>To use templating, first run the setup module to put the template variables you would like to use on the remote host. Then use the template module to write the files using the templates. Templates are written in Jinja2 format. Playbooks (covered below) will run the setup module for you, making this even simpler.:</p>
<div class="highlight-python"><pre>ansible webservers -m setup -a "favcolor=red ntp_server=192.168.1.1"
ansible webservers -m template -a "src=/srv/motd.j2 dest=/etc/motd"
ansible webservers -m template -a "src=/srv/ntp.j2 dest=/etc/ntp.conf"</pre>
</div> </div>
<div class="section" id="examples-3"> <p>Need something like the fqdn in a template? If facter or ohai are installed, data from these projects will also be made available to the template engine, using &#8216;facter&#8217; and &#8216;ohai&#8217; prefixes for each.</p>
<h2>Examples 3<a class="headerlink" href="#examples-3" title="Permalink to this headline"></a></h2>
<p>Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis
dolor. Mauris sodales porta enim, non ultricies dolor luctus
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate,
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra
arcu sem a ante. Praesent nec metus vestibulum augue eleifend
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh
turpis. Proin ac nisi ligula, a pretium augue.</p>
</div> </div>
<div class="section" id="id1"> <div class="section" id="examples-3-deploying-from-source-control">
<h2>Examples 3<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2> <h2>Examples 3: Deploying From Source Control<a class="headerlink" href="#examples-3-deploying-from-source-control" title="Permalink to this headline"></a></h2>
<p>In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed <p>Deploy your webapp straight from git:</p>
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, <div class="highlight-python"><pre>ansible webservers -m git -a "repo=git://foo dest=/srv/myapp version=HEAD"</pre>
eget lobortis mi magna sed metus. Cras justo est, tempus quis
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet
lacus. Maecenas interdum viverra laoreet. Quisque elementum
sollicitudin ullamcorper.</p>
</div> </div>
<div class="section" id="examples-4"> <p>Since ansible modules can notify change handlers (see &#8216;Playbooks&#8217;) it is possible to tell ansible to run specific tasks when the code is updated, such as deploying Perl/Python/PHP/Ruby directly from git and then restarting apache.</p>
<h2>Examples 4<a class="headerlink" href="#examples-4" title="Permalink to this headline"></a></h2>
<p>Pellentesque mauris sem, malesuada at lobortis in, porta eget
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin
hendrerit mi tincidunt dui fermentum placerat.</p>
</div> </div>
</div> </div>
@ -124,11 +109,10 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<h3><a href="index.html">Table Of Contents</a></h3> <h3><a href="index.html">Table Of Contents</a></h3>
<ul> <ul>
<li><a class="reference internal" href="#">Examples</a><ul> <li><a class="reference internal" href="#">Examples</a><ul>
<li><a class="reference internal" href="#examples-1">Examples 1</a></li> <li><a class="reference internal" href="#parallelism-and-shell-commands">Parallelism and Shell Commands</a></li>
<li><a class="reference internal" href="#examples-2">Examples 2</a></li> <li><a class="reference internal" href="#example-2-time-limited-background-operations">Example 2: Time Limited Background Operations</a></li>
<li><a class="reference internal" href="#examples-3">Examples 3</a></li> <li><a class="reference internal" href="#examples-3-file-transfer-templating">Examples 3: File Transfer &amp; Templating</a></li>
<li><a class="reference internal" href="#id1">Examples 3</a></li> <li><a class="reference internal" href="#examples-3-deploying-from-source-control">Examples 3: Deploying From Source Control</a></li>
<li><a class="reference internal" href="#examples-4">Examples 4</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -147,7 +131,7 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<div id="searchbox" style="display: none"> <div id="searchbox" style="display: none">
<h3>Quick search</h3> <h3>Quick search</h3>
<form class="search" action="search.html" method="get"> <form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" /> <input type="text" name="q" />
<input type="submit" value="Go" /> <input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" /> <input type="hidden" name="area" value="default" />
@ -178,8 +162,8 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2012 Michael DeHaan. &copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 07, 2012. Last updated on Mar 08, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div> </div>
</body> </body>
</html> </html>

@ -59,7 +59,7 @@
<div id="searchbox" style="display: none"> <div id="searchbox" style="display: none">
<h3>Quick search</h3> <h3>Quick search</h3>
<form class="search" action="search.html" method="get"> <form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" /> <input type="text" name="q" />
<input type="submit" value="Go" /> <input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" /> <input type="hidden" name="area" value="default" />
@ -84,8 +84,8 @@
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2012 Michael DeHaan. &copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 07, 2012. Last updated on Mar 08, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div> </div>
</body> </body>
</html> </html>

@ -23,7 +23,7 @@
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Ansible v0.0.1 documentation" href="index.html" /> <link rel="top" title="Ansible v0.0.1 documentation" href="index.html" />
<link rel="next" title="YAML Scripts" href="YAMLScripts.html" /> <link rel="next" title="Patterns" href="patterns.html" />
<link rel="prev" title="Ansible" href="index.html" /> <link rel="prev" title="Ansible" href="index.html" />
</head> </head>
<body> <body>
@ -34,7 +34,7 @@
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
accesskey="I">index</a></li> accesskey="I">index</a></li>
<li class="right" > <li class="right" >
<a href="YAMLScripts.html" title="YAML Scripts" <a href="patterns.html" title="Patterns"
accesskey="N">next</a> |</li> accesskey="N">next</a> |</li>
<li class="right" > <li class="right" >
<a href="index.html" title="Ansible" <a href="index.html" title="Ansible"
@ -50,64 +50,94 @@
<div class="section" id="getting-started"> <div class="section" id="getting-started">
<h1>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline"></a></h1> <h1>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline"></a></h1>
<p>How to ansible</p> <p>How to download ansible and get started using it</p>
<div class="admonition-see-also admonition seealso"> <div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p> <p class="first admonition-title">See also</p>
<dl class="last docutils"> <dl class="last docutils">
<dt><a class="reference internal" href="examples.html"><em>Examples</em></a></dt>
<dd>Examples of basic commands</dd>
<dt><a class="reference internal" href="YAMLScripts.html"><em>YAML Scripts</em></a></dt> <dt><a class="reference internal" href="YAMLScripts.html"><em>YAML Scripts</em></a></dt>
<dd>Complete documentation of the YAML syntax <cite>ansible</cite> understands.</dd> <dd>Complete documentation of the YAML syntax <cite>ansible</cite> understands for playbooks.</dd>
<dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
<dd>Learning ansible&#8217;s configuration management language</dd>
<dt><a class="reference internal" href="modules.html"><em>Ansible Modules</em></a></dt>
<dd>Learn about modules that ship with ansible</dd>
</dl> </dl>
</div> </div>
<div class="section" id="what-you-need"> <div class="section" id="requirements">
<h2>What you need<a class="headerlink" href="#what-you-need" title="Permalink to this headline"></a></h2> <h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline"></a></h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim <p>Requirements are extremely minimal.</p>
placerat nibh, non feugiat risus varius vitae. Donec eu libero <p>If you are running python 2.6 on the <strong>overlord</strong> machine, you will
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in need:</p>
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, <ul class="simple">
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus <li><tt class="docutils literal"><span class="pre">paramiko</span></tt></li>
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae <li><tt class="docutils literal"><span class="pre">PyYAML</span></tt></li>
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis <li><tt class="docutils literal"><span class="pre">python-jinja2</span></tt> (for playbooks)</li>
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, </ul>
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies <p>If you are running less than Python 2.6, you will also need:</p>
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis <ul class="simple">
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna <li>The Python 2.4 or 2.5 backport of the <tt class="docutils literal"><span class="pre">multiprocessing</span></tt> module<ul>
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae <li><a class="reference external" href="http://code.google.com/p/python-multiprocessing/wiki/Install">Installation and Testing Instructions</a></li>
metus. Fusce nec sapien dolor.</p> </ul>
<p>Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, </li>
pretium quis sapien. Duis felis metus, sodales sit amet gravida in, <li><tt class="docutils literal"><span class="pre">simplejson</span></tt></li>
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin </ul>
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, <p>On the managed nodes, to use templating, you will need:</p>
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada <ul class="simple">
molestie, nisi nunc placerat libero, vel vulputate elit tellus et <li><tt class="docutils literal"><span class="pre">python-jinja2</span></tt> (you can install this with ansible)</li>
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat </ul>
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan </div>
lorem eget leo dictum viverra.</p> <div class="section" id="developer-requirements">
<p>Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean <h2>Developer Requirements<a class="headerlink" href="#developer-requirements" title="Permalink to this headline"></a></h2>
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar <p>For developers, you may wish to have:</p>
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis <ul class="simple">
dolor. Mauris sodales porta enim, non ultricies dolor luctus <li><tt class="docutils literal"><span class="pre">asciidoc</span></tt> (for building manpage documentation)</li>
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, <li><tt class="docutils literal"><span class="pre">python-sphinx</span></tt> (for building content for ansible.github.com)</li>
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra </ul>
arcu sem a ante. Praesent nec metus vestibulum augue eleifend </div>
suscipit. In feugiat, sem nec dignissim consequat, velit tortor <div class="section" id="getting-ansible">
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh <h2>Getting Ansible<a class="headerlink" href="#getting-ansible" title="Permalink to this headline"></a></h2>
turpis. Proin ac nisi ligula, a pretium augue.</p> <p>Tagged releases are available as tar.gz files from the Ansible github
<p>In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed project page:</p>
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, <ul class="simple">
eget lobortis mi magna sed metus. Cras justo est, tempus quis <li><a class="reference external" href="https://github.com/ansible/ansible/downloads">Ansible/downloads</a></li>
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et </ul>
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae <p>You can also clone the git repository yourself and install Ansible in
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc one of two ways:</p>
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet <div class="section" id="python-distutils">
lacus. Maecenas interdum viverra laoreet. Quisque elementum <h3>Python Distutils<a class="headerlink" href="#python-distutils" title="Permalink to this headline"></a></h3>
sollicitudin ullamcorper.</p> <p>You can also install Ansible using Python Distutils:</p>
<p>Pellentesque mauris sem, malesuada at lobortis in, porta eget <div class="highlight-python"><pre>$ git clone git://github.com/ansible/ansible.git
urna. Duis aliquet quam eget risus elementum quis auctor ligula $ cd ./ansible
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies $ sudo make install</pre>
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat </div>
tristique lobortis. Suspendisse est enim, tristique eu convallis id, </div>
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin <div class="section" id="via-rpm">
hendrerit mi tincidunt dui fermentum placerat.</p> <h3>Via RPM<a class="headerlink" href="#via-rpm" title="Permalink to this headline"></a></h3>
<p>In the near future, pre-built RPMs will be available through your distribution. Until that time you
can use the <tt class="docutils literal"><span class="pre">make</span> <span class="pre">rpm</span></tt> command:</p>
<div class="highlight-python"><pre>$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ make rpm
$ sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/ansible-1.0-1.noarch.rpm</pre>
</div>
</div>
</div>
<div class="section" id="your-first-commands">
<h2>Your first commands<a class="headerlink" href="#your-first-commands" title="Permalink to this headline"></a></h2>
<p>Edit /etc/ansible/hosts and put one or more remote systems in it, for which you have your SSH
key in <tt class="docutils literal"><span class="pre">authorized_keys</span></tt>:</p>
<div class="highlight-python"><pre>192.168.1.50
aserver.example.org
bserver.example.org</pre>
</div>
<p>Now try this:</p>
<blockquote>
<div>ssh-agent bash
ssh-add ~/.ssh/id_rsa
ansible all -m ping</div></blockquote>
<p>Congratulations. You&#8217;ve just contacted your nodes with Ansible. It&#8217;s now time to read some
of the more real-world examples.</p>
</div> </div>
</div> </div>
@ -120,7 +150,14 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<h3><a href="index.html">Table Of Contents</a></h3> <h3><a href="index.html">Table Of Contents</a></h3>
<ul> <ul>
<li><a class="reference internal" href="#">Getting Started</a><ul> <li><a class="reference internal" href="#">Getting Started</a><ul>
<li><a class="reference internal" href="#what-you-need">What you need</a></li> <li><a class="reference internal" href="#requirements">Requirements</a></li>
<li><a class="reference internal" href="#developer-requirements">Developer Requirements</a></li>
<li><a class="reference internal" href="#getting-ansible">Getting Ansible</a><ul>
<li><a class="reference internal" href="#python-distutils">Python Distutils</a></li>
<li><a class="reference internal" href="#via-rpm">Via RPM</a></li>
</ul>
</li>
<li><a class="reference internal" href="#your-first-commands">Your first commands</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -129,8 +166,8 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<p class="topless"><a href="index.html" <p class="topless"><a href="index.html"
title="previous chapter">Ansible</a></p> title="previous chapter">Ansible</a></p>
<h4>Next topic</h4> <h4>Next topic</h4>
<p class="topless"><a href="YAMLScripts.html" <p class="topless"><a href="patterns.html"
title="next chapter">YAML Scripts</a></p> title="next chapter">Patterns</a></p>
<h3>This Page</h3> <h3>This Page</h3>
<ul class="this-page-menu"> <ul class="this-page-menu">
<li><a href="_sources/gettingstarted.txt" <li><a href="_sources/gettingstarted.txt"
@ -139,7 +176,7 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<div id="searchbox" style="display: none"> <div id="searchbox" style="display: none">
<h3>Quick search</h3> <h3>Quick search</h3>
<form class="search" action="search.html" method="get"> <form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" /> <input type="text" name="q" />
<input type="submit" value="Go" /> <input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" /> <input type="hidden" name="area" value="default" />
@ -160,7 +197,7 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
>index</a></li> >index</a></li>
<li class="right" > <li class="right" >
<a href="YAMLScripts.html" title="YAML Scripts" <a href="patterns.html" title="Patterns"
>next</a> |</li> >next</a> |</li>
<li class="right" > <li class="right" >
<a href="index.html" title="Ansible" <a href="index.html" title="Ansible"
@ -170,8 +207,8 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2012 Michael DeHaan. &copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 07, 2012. Last updated on Mar 08, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div> </div>
</body> </body>
</html> </html>

@ -46,32 +46,25 @@
<div class="section" id="ansible"> <div class="section" id="ansible">
<h1>Ansible<a class="headerlink" href="#ansible" title="Permalink to this headline"></a></h1> <h1>Ansible<a class="headerlink" href="#ansible" title="Permalink to this headline"></a></h1>
<p>Ansible is a extra-simple tool/API for doing &#8216;parallel remote things&#8217; <p>Ansible is a radically simple deployment, configuration, and command execution framework.
over SSH &#8211; whether executing commands, running &#8220;modules&#8221;, or Other tools in this space have been too complicated for too long, require too much bootstrapping,
executing larger &#8216;playbooks&#8217; that can serve as a configuration and have too much learning curve. Ansible is dead simple and painless to extend. For comparison, Puppet and Chef have about 60k lines of code. Ansible&#8217;s core is a little over 1000 lines.</p>
management or deployment system.</p> <p>Ansible isn&#8217;t just for configuration &#8211; it&#8217;s also great for Ad-Hoc tasks,
<p>While <a class="reference external" href="http://fedorahosted.org/func">Func installation</a> which I quickly firing off commands against nodes. Where Ansible excels though, is expressing complex multi-node deployment processes, executing complex sequences of commands on different hosts through the &#8220;playbooks&#8221; feature.</p>
co-wrote, aspired to avoid using SSH and have it&#8217;s own daemon <p>Ansible does not require programming in any particular language &#8211; you can write modules
infrastructure, Ansible aspires to be quite different and more as scripts or programs that return simple JSON.</p>
minimal, but still able to grow more modularly over time. This is <p>Why use Ansible versus something else? (Puppet, Chef, Fabric, Capistrano,
based on talking to a lot of users of various tools and wishing to
eliminate problems with connectivity and long running daemons, or not
picking tool <cite>X</cite> because they preferred to code in <cite>Y</cite>. Further,
playbooks take things a whole step further, building the config and
deployment system I always wanted to build.</p>
<p>Why use Ansible versus something else? (Fabric, Capistrano,
mCollective, Func, SaltStack, etc?) It will have far less code, it mCollective, Func, SaltStack, etc?) It will have far less code, it
will be more correct, and it will be the easiest thing to hack on and will be more correct, and it will be the easiest thing to hack on and
use you&#8217;ll ever see &#8211; regardless of your favorite language of choice. use you&#8217;ll ever see &#8211; regardless of your favorite language of choice.
Want to only code plugins in bash or clojure? Ansible doesn&#8217;t care. Systems management doesn&#8217;t have to be complicated. Ansible&#8217;s docs will remain
The docs will fit on one page and the source will be blindingly short &amp; simple, and the source will be blindingly obvious.</p>
obvious.</p> <div class="section" id="design-goals">
<div class="section" id="design-principles"> <h2>Design Goals<a class="headerlink" href="#design-goals" title="Permalink to this headline"></a></h2>
<h2>Design Principles<a class="headerlink" href="#design-principles" title="Permalink to this headline"></a></h2>
<ul class="simple"> <ul class="simple">
<li>Dead simple setup</li> <li>Dead simple setup</li>
<li>Super fast &amp; parallel by default</li> <li>Super fast &amp; parallel by default</li>
<li>No server or client daemons; use existing SSHd</li> <li>No server or client daemons; use existing SSHd out of the box</li>
<li>No additional software required on client boxes</li> <li>No additional software required on client boxes</li>
<li>Modules can be written in ANY language</li> <li>Modules can be written in ANY language</li>
<li>Awesome API for creating very powerful distributed scripts</li> <li>Awesome API for creating very powerful distributed scripts</li>
@ -79,57 +72,16 @@ obvious.</p>
<li>Create the easiest config management system to use, ever.</li> <li>Create the easiest config management system to use, ever.</li>
</ul> </ul>
</div> </div>
<div class="section" id="requirements"> <div class="section" id="about-the-author">
<h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline"></a></h2> <h2>About the Author<a class="headerlink" href="#about-the-author" title="Permalink to this headline"></a></h2>
<p>Requirements are extremely minimal.</p> <p>Michael DeHaan is a Raleigh, NC based software developer and architect. He created other
<p>If you are running python 2.6 on the <strong>overlord</strong> machine, you will DevOps programs such as Cobbler, the popular Linux install server.
need:</p> Cobbler is used to deploy mission critical systems all over the planet, in industries
<ul class="simple"> ranging from massively multiplayer gaming, core internet infrastructure, finance,
<li><tt class="docutils literal"><span class="pre">paramiko</span></tt></li> chip design, and more. Michael also helped co-author of Func, which is used
<li><tt class="docutils literal"><span class="pre">PyYAML</span></tt></li> to orchestrate systems in lots of diverse places.</p>
<li><tt class="docutils literal"><span class="pre">python-jinja2</span></tt> (for playbooks)</li> <p>Ansible is an GPLv3 licensed open source project, so see the contributions section for how to
<li><tt class="docutils literal"><span class="pre">Asciidoc</span></tt> (for building documentation)</li> get involved.</p>
</ul>
<p>If you are running less than Python 2.6, you will also need:</p>
<ul class="simple">
<li>The Python 2.4 or 2.5 backport of the <tt class="docutils literal"><span class="pre">multiprocessing</span></tt> module<ul>
<li><a class="reference external" href="http://code.google.com/p/python-multiprocessing/wiki/Install">Installation and Testing Instructions</a></li>
</ul>
</li>
<li><tt class="docutils literal"><span class="pre">simplejson</span></tt></li>
</ul>
<p>On the managed nodes, to use templating, you will need:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">python-jinja2</span></tt> (you can install this with ansible)</li>
</ul>
</div>
<div class="section" id="getting-ansible">
<h2>Getting Ansible<a class="headerlink" href="#getting-ansible" title="Permalink to this headline"></a></h2>
<p>Tagged releases are available as tar.gz files from the Ansible github
project page:</p>
<ul class="simple">
<li><a class="reference external" href="https://github.com/ansible/ansible/downloads">Ansible/downloads</a></li>
</ul>
<p>You can also clone the git repository yourself and install Ansible in
one of two ways:</p>
<div class="section" id="python-distutils">
<h3>Python Distutils<a class="headerlink" href="#python-distutils" title="Permalink to this headline"></a></h3>
<p>You can install Ansible using Python Distutils:</p>
<div class="highlight-python"><pre>$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ sudo make install</pre>
</div>
</div>
<div class="section" id="via-rpm">
<h3>Via RPM<a class="headerlink" href="#via-rpm" title="Permalink to this headline"></a></h3>
<p>In the future, pre-built RPMs may be available. Until that time you
can use the <tt class="docutils literal"><span class="pre">make</span> <span class="pre">rpm</span></tt> command:</p>
<div class="highlight-python"><pre>$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ make rpm
$ sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/ansible-1.0-1.noarch.rpm</pre>
</div>
</div>
</div> </div>
</div> </div>
<div class="section" id="contents"> <div class="section" id="contents">
@ -137,45 +89,74 @@ $ sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/ansible-1.0-1.noarch.rpm</pre>
<div class="toctree-wrapper compound"> <div class="toctree-wrapper compound">
<ul> <ul>
<li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a><ul> <li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="gettingstarted.html#what-you-need">What you need</a></li> <li class="toctree-l2"><a class="reference internal" href="gettingstarted.html#requirements">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="gettingstarted.html#developer-requirements">Developer Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="gettingstarted.html#getting-ansible">Getting Ansible</a><ul>
<li class="toctree-l3"><a class="reference internal" href="gettingstarted.html#python-distutils">Python Distutils</a></li>
<li class="toctree-l3"><a class="reference internal" href="gettingstarted.html#via-rpm">Via RPM</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="gettingstarted.html#your-first-commands">Your first commands</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="patterns.html">Patterns</a><ul>
<li class="toctree-l2"><a class="reference internal" href="patterns.html#targetting-all-systems">Targetting All Systems</a></li>
<li class="toctree-l2"><a class="reference internal" href="patterns.html#specific-hosts">Specific Hosts</a></li>
<li class="toctree-l2"><a class="reference internal" href="patterns.html#groups">Groups</a></li>
<li class="toctree-l2"><a class="reference internal" href="patterns.html#wildcards">Wildcards</a></li>
<li class="toctree-l2"><a class="reference internal" href="patterns.html#mixing-things-up">Mixing Things Up</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a><ul>
<li class="toctree-l2"><a class="reference internal" href="modules.html#about-modules">About Modules</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#idempotence">Idempotence</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#command">command</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#copy">copy</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#facter">facter</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#git">git</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#ohai">ohai</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#ping">ping</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#service">service</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#setup">setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#template">template</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#user">user</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#yum">yum</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#writing-your-own-modules">WRITING YOUR OWN MODULES</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="YAMLScripts.html">YAML Scripts</a><ul> <li class="toctree-l1"><a class="reference internal" href="YAMLScripts.html">YAML Scripts</a><ul>
<li class="toctree-l2"><a class="reference internal" href="YAMLScripts.html#yaml-basics">YAML Basics</a></li> <li class="toctree-l2"><a class="reference internal" href="YAMLScripts.html#yaml-basics">YAML Basics</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="patterns.html">Patterns</a></li> <li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a><ul>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Modules</a></li> <li class="toctree-l2"><a class="reference internal" href="playbooks.html#playbook-example">Playbook Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li> <li class="toctree-l2"><a class="reference internal" href="playbooks.html#hosts-line">Hosts line</a></li>
<li class="toctree-l2"><a class="reference internal" href="playbooks.html#vars-section">Vars section</a></li>
<li class="toctree-l2"><a class="reference internal" href="playbooks.html#tasks-list">Tasks list</a></li>
<li class="toctree-l2"><a class="reference internal" href="playbooks.html#task-name-and-comment">Task name and comment</a></li>
<li class="toctree-l2"><a class="reference internal" href="playbooks.html#task-action">Task action</a></li>
<li class="toctree-l2"><a class="reference internal" href="playbooks.html#notify-statements">Notify statements</a></li>
<li class="toctree-l2"><a class="reference internal" href="playbooks.html#handlers">Handlers</a></li>
<li class="toctree-l2"><a class="reference internal" href="playbooks.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="playbooks.html#asynchronous-actions-and-polling">Asynchronous Actions and Polling</a></li>
<li class="toctree-l2"><a class="reference internal" href="playbooks.html#executing-a-playbook">Executing A Playbook</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a><ul> <li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a><ul>
<li class="toctree-l2"><a class="reference internal" href="examples.html#examples-1">Examples 1</a></li> <li class="toctree-l2"><a class="reference internal" href="examples.html#parallelism-and-shell-commands">Parallelism and Shell Commands</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#examples-2">Examples 2</a></li> <li class="toctree-l2"><a class="reference internal" href="examples.html#example-2-time-limited-background-operations">Example 2: Time Limited Background Operations</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#examples-3">Examples 3</a></li> <li class="toctree-l2"><a class="reference internal" href="examples.html#examples-3-file-transfer-templating">Examples 3: File Transfer &amp; Templating</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#id1">Examples 3</a></li> <li class="toctree-l2"><a class="reference internal" href="examples.html#examples-3-deploying-from-source-control">Examples 3: Deploying From Source Control</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#examples-4">Examples 4</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li> <li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
<li class="toctree-l1"><a class="reference internal" href="communicate.html">Communicate</a></li> <li class="toctree-l1"><a class="reference internal" href="communicate.html">Communicate and Get Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="man.html">Man Pages</a><ul> <li class="toctree-l1"><a class="reference internal" href="man.html">Man Pages</a><ul>
<li class="toctree-l2"><a class="reference internal" href="man.html#ansible-1">ansible(1)</a></li> <li class="toctree-l2"><a class="reference internal" href="man.html#ansible-1">ansible(1)</a></li>
<li class="toctree-l2"><a class="reference internal" href="man.html#ansible-modules-5">ansible-modules(5)</a></li>
<li class="toctree-l2"><a class="reference internal" href="man.html#ansible-playbook-5">ansible-playbook(5)</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
</div>
<div class="section" id="communicate-or-get-involved">
<h1>Communicate or Get Involved<a class="headerlink" href="#communicate-or-get-involved" title="Permalink to this headline"></a></h1>
<ul class="simple">
<li>Join the <a class="reference external" href="http://groups.google.com/group/ansible-project">ansible-project mailing list</a> on Google Groups</li>
<li>Join <a class="reference external" href="irc://irc.freenode.net/#ansible">#ansible</a> on the <a class="reference external" href="http://freenode.net/">freenode IRC network</a></li>
<li>Visit the <a class="reference external" href="https://github.com/ansible/ansible">project page</a> on Github<ul>
<li>View the <a class="reference external" href="https://github.com/ansible/ansible/issues">issue tracker</a></li>
</ul>
</li>
</ul>
</div> </div>
@ -187,19 +168,13 @@ $ sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/ansible-1.0-1.noarch.rpm</pre>
<h3><a href="#">Table Of Contents</a></h3> <h3><a href="#">Table Of Contents</a></h3>
<ul> <ul>
<li><a class="reference internal" href="#">Ansible</a><ul> <li><a class="reference internal" href="#">Ansible</a><ul>
<li><a class="reference internal" href="#design-principles">Design Principles</a></li> <li><a class="reference internal" href="#design-goals">Design Goals</a></li>
<li><a class="reference internal" href="#requirements">Requirements</a></li> <li><a class="reference internal" href="#about-the-author">About the Author</a></li>
<li><a class="reference internal" href="#getting-ansible">Getting Ansible</a><ul>
<li><a class="reference internal" href="#python-distutils">Python Distutils</a></li>
<li><a class="reference internal" href="#via-rpm">Via RPM</a></li>
</ul>
</li>
</ul> </ul>
</li> </li>
<li><a class="reference internal" href="#contents">Contents</a><ul> <li><a class="reference internal" href="#contents">Contents</a><ul>
</ul> </ul>
</li> </li>
<li><a class="reference internal" href="#communicate-or-get-involved">Communicate or Get Involved</a></li>
</ul> </ul>
<h4>Next topic</h4> <h4>Next topic</h4>
@ -213,7 +188,7 @@ $ sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/ansible-1.0-1.noarch.rpm</pre>
<div id="searchbox" style="display: none"> <div id="searchbox" style="display: none">
<h3>Quick search</h3> <h3>Quick search</h3>
<form class="search" action="search.html" method="get"> <form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" /> <input type="text" name="q" />
<input type="submit" value="Go" /> <input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" /> <input type="hidden" name="area" value="default" />
@ -241,8 +216,8 @@ $ sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/ansible-1.0-1.noarch.rpm</pre>
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2012 Michael DeHaan. &copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 07, 2012. Last updated on Mar 08, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div> </div>
</body> </body>
</html> </html>

@ -23,7 +23,7 @@
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Ansible v0.0.1 documentation" href="index.html" /> <link rel="top" title="Ansible v0.0.1 documentation" href="index.html" />
<link rel="prev" title="Communicate" href="communicate.html" /> <link rel="prev" title="Communicate and Get Involved" href="communicate.html" />
</head> </head>
<body> <body>
<div class="related"> <div class="related">
@ -33,7 +33,7 @@
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
accesskey="I">index</a></li> accesskey="I">index</a></li>
<li class="right" > <li class="right" >
<a href="communicate.html" title="Communicate" <a href="communicate.html" title="Communicate and Get Involved"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul> </ul>
@ -46,25 +46,13 @@
<div class="section" id="man-pages"> <div class="section" id="man-pages">
<span id="man"></span><h1>Man Pages<a class="headerlink" href="#man-pages" title="Permalink to this headline"></a></h1> <span id="man"></span><h1>Man Pages<a class="headerlink" href="#man-pages" title="Permalink to this headline"></a></h1>
<p>Ansile ships with a handfull of manpages to help you on your journey.</p> <p>Ansible&#8217;s manpage lists available command line options.</p>
<div class="section" id="ansible-1"> <div class="section" id="ansible-1">
<h2>ansible(1)<a class="headerlink" href="#ansible-1" title="Permalink to this headline"></a></h2> <h2>ansible(1)<a class="headerlink" href="#ansible-1" title="Permalink to this headline"></a></h2>
<ul class="simple"> <ul class="simple">
<li><a class="reference external" href="man/ansible.1.html">View ansible.1</a></li> <li><a class="reference external" href="man/ansible.1.html">View ansible.1</a></li>
</ul> </ul>
</div> </div>
<div class="section" id="ansible-modules-5">
<h2>ansible-modules(5)<a class="headerlink" href="#ansible-modules-5" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li><a class="reference external" href="man/ansible-modules.5.html">View ansible-modules.5</a></li>
</ul>
</div>
<div class="section" id="ansible-playbook-5">
<h2>ansible-playbook(5)<a class="headerlink" href="#ansible-playbook-5" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li><a class="reference external" href="man/ansible-playbook.5.html">View ansible-playbook.5</a></li>
</ul>
</div>
</div> </div>
@ -77,15 +65,13 @@
<ul> <ul>
<li><a class="reference internal" href="#">Man Pages</a><ul> <li><a class="reference internal" href="#">Man Pages</a><ul>
<li><a class="reference internal" href="#ansible-1">ansible(1)</a></li> <li><a class="reference internal" href="#ansible-1">ansible(1)</a></li>
<li><a class="reference internal" href="#ansible-modules-5">ansible-modules(5)</a></li>
<li><a class="reference internal" href="#ansible-playbook-5">ansible-playbook(5)</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
<h4>Previous topic</h4> <h4>Previous topic</h4>
<p class="topless"><a href="communicate.html" <p class="topless"><a href="communicate.html"
title="previous chapter">Communicate</a></p> title="previous chapter">Communicate and Get Involved</a></p>
<h3>This Page</h3> <h3>This Page</h3>
<ul class="this-page-menu"> <ul class="this-page-menu">
<li><a href="_sources/man.txt" <li><a href="_sources/man.txt"
@ -94,7 +80,7 @@
<div id="searchbox" style="display: none"> <div id="searchbox" style="display: none">
<h3>Quick search</h3> <h3>Quick search</h3>
<form class="search" action="search.html" method="get"> <form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" /> <input type="text" name="q" />
<input type="submit" value="Go" /> <input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" /> <input type="hidden" name="area" value="default" />
@ -115,15 +101,15 @@
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
>index</a></li> >index</a></li>
<li class="right" > <li class="right" >
<a href="communicate.html" title="Communicate" <a href="communicate.html" title="Communicate and Get Involved"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2012 Michael DeHaan. &copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 07, 2012. Last updated on Mar 08, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div> </div>
</body> </body>
</html> </html>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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-modules</title><link rel="stylesheet" type="text/css" href="./docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /></head><body><div xml:lang="en" class="refentry" title="ansible-modules" lang="en"><a id="id327073"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible-modules — stock modules shipped with ansible</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p>Ansible ships with a number of modules that can be executed directly on remote hosts or through <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible-modules</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-modules" lang="en"><a id="id326412"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible-modules — stock modules shipped with ansible</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p>Ansible ships with a number of modules that can be executed directly on remote hosts or through
ansible playbooks.</p></div><div class="refsect1" title="IDEMPOTENCE"><a id="_idempotence"></a><h2>IDEMPOTENCE</h2><p>Most modules other than command are idempotent, meaning they will seek to avoid changes ansible playbooks.</p></div><div class="refsect1" title="IDEMPOTENCE"><a id="_idempotence"></a><h2>IDEMPOTENCE</h2><p>Most modules other than command are idempotent, meaning they will seek to avoid changes
unless a change needs to be made. When using ansible playbooks, these modules can unless a change needs to be made. When using ansible playbooks, these modules can
trigger change events, as described in <span class="strong"><strong>ansible-playbooks</strong></span>(5).</p><p>Unless otherwise noted, all modules support change hooks.</p></div><div class="refsect1" title="command"><a id="_command"></a><h2>command</h2><p>The command module takes the command name followed by a list of arguments, space delimited. trigger change events, as described in <span class="strong"><strong>ansible-playbooks</strong></span>(5).</p><p>Unless otherwise noted, all modules support change hooks.</p></div><div class="refsect1" title="command"><a id="_command"></a><h2>command</h2><p>The command module takes the command name followed by a list of arguments, space delimited.

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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-modules</title><link rel="stylesheet" type="text/css" href="./docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /></head><body><div xml:lang="en" class="refentry" title="ansible-modules" lang="en"><a id="id458930"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible-playbook — format and function of an ansible playbook file</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p>Ansible ships with <span class="emphasis"><em>ansible-playbook</em></span>, a tool for running playbooks. <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible-modules</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-modules" lang="en"><a id="id532031"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible-playbook — format and function of an ansible playbook file</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p>Ansible ships with <span class="emphasis"><em>ansible-playbook</em></span>, a tool for running playbooks.
Playbooks can represent frequent tasks, desired system configurations, Playbooks can represent frequent tasks, desired system configurations,
or deployment processes.</p></div><div class="refsect1" title="FORMAT"><a id="_format"></a><h2>FORMAT</h2><p>Playbooks are written in YAML.</p></div><div class="refsect1" title="EXAMPLE"><a id="_example"></a><h2>EXAMPLE</h2><p>See:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"> or deployment processes.</p></div><div class="refsect1" title="FORMAT"><a id="_format"></a><h2>FORMAT</h2><p>Playbooks are written in YAML.</p></div><div class="refsect1" title="EXAMPLE"><a id="_example"></a><h2>EXAMPLE</h2><p>See:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
<a class="ulink" href="https://github.com/mpdehaan/ansible/blob/master/examples/playbook.yml" target="_top">https://github.com/mpdehaan/ansible/blob/master/examples/playbook.yml</a> <a class="ulink" href="https://github.com/mpdehaan/ansible/blob/master/examples/playbook.yml" target="_top">https://github.com/mpdehaan/ansible/blob/master/examples/playbook.yml</a>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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" type="text/css" href="./docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /></head><body><div xml:lang="en" class="refentry" title="ansible" lang="en"><a id="id355813"></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 &lt;host-pattern&gt; [-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="id320915"></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 &lt;host-pattern&gt; [-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"> 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 class="strong"><strong>host-pattern</strong></span>
</span></dt><dd> </span></dt><dd>

@ -7,7 +7,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Modules &mdash; Ansible v0.0.1 documentation</title> <title>Ansible Modules &mdash; Ansible v0.0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
@ -23,7 +23,7 @@
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Ansible v0.0.1 documentation" href="index.html" /> <link rel="top" title="Ansible v0.0.1 documentation" href="index.html" />
<link rel="next" title="Playbooks" href="playbooks.html" /> <link rel="next" title="YAML Scripts" href="YAMLScripts.html" />
<link rel="prev" title="Patterns" href="patterns.html" /> <link rel="prev" title="Patterns" href="patterns.html" />
</head> </head>
<body> <body>
@ -34,7 +34,7 @@
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
accesskey="I">index</a></li> accesskey="I">index</a></li>
<li class="right" > <li class="right" >
<a href="playbooks.html" title="Playbooks" <a href="YAMLScripts.html" title="YAML Scripts"
accesskey="N">next</a> |</li> accesskey="N">next</a> |</li>
<li class="right" > <li class="right" >
<a href="patterns.html" title="Patterns" <a href="patterns.html" title="Patterns"
@ -48,56 +48,139 @@
<div class="bodywrapper"> <div class="bodywrapper">
<div class="body"> <div class="body">
<div class="section" id="modules"> <div class="section" id="ansible-modules">
<h1>Modules<a class="headerlink" href="#modules" title="Permalink to this headline"></a></h1> <h1>Ansible Modules<a class="headerlink" href="#ansible-modules" title="Permalink to this headline"></a></h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim <div class="admonition-see-also admonition seealso">
placerat nibh, non feugiat risus varius vitae. Donec eu libero <p class="first admonition-title">See also</p>
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in <dl class="last docutils">
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, <dt><a class="reference internal" href="examples.html"><em>Examples</em></a></dt>
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus <dd>Examples of using modules in /usr/bin/ansible</dd>
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae <dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis <dd>Examples of using modules with /usr/bin/ansible-playbook</dd>
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, <dt><a class="reference internal" href="api.html"><em>API</em></a></dt>
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies <dd>Examples of using modules with the Python API</dd>
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis </dl>
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna </div>
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae <div class="section" id="about-modules">
metus. Fusce nec sapien dolor.</p> <h2>About Modules<a class="headerlink" href="#about-modules" title="Permalink to this headline"></a></h2>
<p>Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, <p>Ansible ships with a number of modules that can be executed directly on remote hosts or through
pretium quis sapien. Duis felis metus, sodales sit amet gravida in, ansible playbooks.</p>
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin </div>
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, <div class="section" id="idempotence">
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada <h2>Idempotence<a class="headerlink" href="#idempotence" title="Permalink to this headline"></a></h2>
molestie, nisi nunc placerat libero, vel vulputate elit tellus et <p>Most modules other than command are idempotent, meaning they will seek to avoid changes
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat unless a change needs to be made. When using ansible playbooks, these modules can
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan trigger change events. Unless otherwise noted, all modules support change hooks.</p>
lorem eget leo dictum viverra.</p> </div>
<p>Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean <div class="section" id="command">
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar <h2>command<a class="headerlink" href="#command" title="Permalink to this headline"></a></h2>
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis <p>The command module takes the command name followed by a list of arguments, space delimited.
dolor. Mauris sodales porta enim, non ultricies dolor luctus This is the only module that does not use key=value style parameters.</p>
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, <p>Example usage:</p>
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra <div class="highlight-python"><pre>/sbin/shutdown -t now</pre>
arcu sem a ante. Praesent nec metus vestibulum augue eleifend </div>
suscipit. In feugiat, sem nec dignissim consequat, velit tortor <p>This module does not support change hooks and returns the return code from the program as well as timing information about how long the command was running for.</p>
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh </div>
turpis. Proin ac nisi ligula, a pretium augue.</p> <div class="section" id="copy">
<p>In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed <h2>copy<a class="headerlink" href="#copy" title="Permalink to this headline"></a></h2>
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, <p>The copy module moves a file on the local box to remote locations.</p>
eget lobortis mi magna sed metus. Cras justo est, tempus quis <p><em>src</em>:</p>
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et <p>Local absolute path to a file to copy to the remote server</p>
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae <p><em>dest</em>:</p>
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc <p>Remote absolute path where the file should end up</p>
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet <p>This module also returns md5sum information about the resultant file.</p>
lacus. Maecenas interdum viverra laoreet. Quisque elementum </div>
sollicitudin ullamcorper.</p> <div class="section" id="facter">
<p>Pellentesque mauris sem, malesuada at lobortis in, porta eget <h2>facter<a class="headerlink" href="#facter" title="Permalink to this headline"></a></h2>
urna. Duis aliquet quam eget risus elementum quis auctor ligula <p>Runs the discovery program &#8216;facter&#8217; on the remote system, returning
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies JSON data that can be useful for inventory purposes.</p>
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat <p>Requires that &#8216;facter&#8217; and &#8216;ruby-json&#8217; be installed on the remote end.</p>
tristique lobortis. Suspendisse est enim, tristique eu convallis id, <p>This module is informative only - it takes no parameters &amp; does not support change hooks,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin nor does it make any changes on the system.</p>
hendrerit mi tincidunt dui fermentum placerat.</p> </div>
<div class="section" id="git">
<h2>git<a class="headerlink" href="#git" title="Permalink to this headline"></a></h2>
<p>Deploys software from git checkouts.</p>
<p><em>repo</em>:</p>
<p>git or http protocol address of the repo to checkout</p>
<p><em>dest</em>:</p>
<p>where to check it out, an absolute directory path</p>
<p><em>version</em>:</p>
<p>what version to check out &#8211; either the git SHA, the literal string &#8216;HEAD&#8217;, or a tag name</p>
</div>
<div class="section" id="ohai">
<h2>ohai<a class="headerlink" href="#ohai" title="Permalink to this headline"></a></h2>
<p>Similar to the facter module, this returns JSON inventory data. Ohai
data is a bit more verbose and nested than facter.</p>
<p>Requires that &#8216;ohai&#8217; be installed on the remote end.</p>
<p>This module is information only - it takes no parameters &amp; does not
support change hooks, nor does it make any changes on the system.</p>
</div>
<div class="section" id="ping">
<h2>ping<a class="headerlink" href="#ping" title="Permalink to this headline"></a></h2>
<p>A trivial test module, this module always returns the integer &#8216;1&#8217; on
successful contact.</p>
<p>This module does not support change hooks.</p>
<p>This module is informative only - it takes no parameters &amp; does not
support change hooks, nor does it make any changes on the system.</p>
</div>
<div class="section" id="service">
<h2>service<a class="headerlink" href="#service" title="Permalink to this headline"></a></h2>
<p>Controls services on remote machines.</p>
<p><em>state</em></p>
<p>Values are &#8216;started&#8217;, &#8216;stopped&#8217;, or &#8216;restarted&#8217;. Started/stopped
are idempotent actions that will not run commands unless neccessary.
&#8216;restarted&#8217; will always bounce the service</p>
<p><em>name</em></p>
<p>The name of the service</p>
</div>
<div class="section" id="setup">
<h2>setup<a class="headerlink" href="#setup" title="Permalink to this headline"></a></h2>
<p>Writes a JSON file containing key/value data, for use in templating.
Call this once before using the template modules. Playbooks will
execute this module automatically as the first step in each play.</p>
<p>If facter or ohai are installed, variables from these programs will also
be snapshotted into the JSON file for usage in templating. These variables
are prefixed with &#8216;<a class="reference internal" href="#facter">facter</a>&#8216; and &#8216;<a class="reference internal" href="#ohai">ohai</a>&#8221; so it&#8217;s easy to tell their source.</p>
<p><em>metadata</em></p>
<p>Optionally overrides the default JSON file location of /etc/ansible/setup or ~/ansible/setup
depending on what remote user has been specified.</p>
<p>If used, also supply the metadata parameter to the template module.</p>
<p><em>anything</em></p>
<p>any other parameters can be named basically anything, and set a key=value
pair in the JSON file for use in templating.</p>
</div>
<div class="section" id="template">
<h2>template<a class="headerlink" href="#template" title="Permalink to this headline"></a></h2>
<p>Templates a file out to a remote server. Call the setup module prior to usage.</p>
<p><em>src</em></p>
<p>path of a Jinja2 formatted template on the local server</p>
<p><em>dest</em></p>
<p>location to render the template on the remote server</p>
<p><em>metadata</em></p>
<p>location of a JSON file to use to supply template data. Default is /etc/ansible/setup
which is the same as the default for the setup module. Change if running as a non-root
remote user who does not have permissions on /etc/ansible.</p>
<p>This module also returns md5sum information about the resultant file.</p>
</div>
<div class="section" id="user">
<h2>user<a class="headerlink" href="#user" title="Permalink to this headline"></a></h2>
<p>This module is in plan.</p>
</div>
<div class="section" id="yum">
<h2>yum<a class="headerlink" href="#yum" title="Permalink to this headline"></a></h2>
<p>This module is in plan.</p>
</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.
To support change hooks, modules should return hashes with a changed: True/False
element at the top level. Modules can also choose to indicate a failure scenario
by returning a top level &#8216;failure&#8217; element with a True value, and a &#8216;msg&#8217; element
describing the nature of the failure. Other values are up to the module.</p>
</div>
</div> </div>
@ -106,12 +189,33 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
</div> </div>
<div class="sphinxsidebar"> <div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"> <div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Ansible Modules</a><ul>
<li><a class="reference internal" href="#about-modules">About Modules</a></li>
<li><a class="reference internal" href="#idempotence">Idempotence</a></li>
<li><a class="reference internal" href="#command">command</a></li>
<li><a class="reference internal" href="#copy">copy</a></li>
<li><a class="reference internal" href="#facter">facter</a></li>
<li><a class="reference internal" href="#git">git</a></li>
<li><a class="reference internal" href="#ohai">ohai</a></li>
<li><a class="reference internal" href="#ping">ping</a></li>
<li><a class="reference internal" href="#service">service</a></li>
<li><a class="reference internal" href="#setup">setup</a></li>
<li><a class="reference internal" href="#template">template</a></li>
<li><a class="reference internal" href="#user">user</a></li>
<li><a class="reference internal" href="#yum">yum</a></li>
<li><a class="reference internal" href="#writing-your-own-modules">WRITING YOUR OWN MODULES</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4> <h4>Previous topic</h4>
<p class="topless"><a href="patterns.html" <p class="topless"><a href="patterns.html"
title="previous chapter">Patterns</a></p> title="previous chapter">Patterns</a></p>
<h4>Next topic</h4> <h4>Next topic</h4>
<p class="topless"><a href="playbooks.html" <p class="topless"><a href="YAMLScripts.html"
title="next chapter">Playbooks</a></p> title="next chapter">YAML Scripts</a></p>
<h3>This Page</h3> <h3>This Page</h3>
<ul class="this-page-menu"> <ul class="this-page-menu">
<li><a href="_sources/modules.txt" <li><a href="_sources/modules.txt"
@ -120,7 +224,7 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<div id="searchbox" style="display: none"> <div id="searchbox" style="display: none">
<h3>Quick search</h3> <h3>Quick search</h3>
<form class="search" action="search.html" method="get"> <form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" /> <input type="text" name="q" />
<input type="submit" value="Go" /> <input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" /> <input type="hidden" name="area" value="default" />
@ -141,7 +245,7 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
>index</a></li> >index</a></li>
<li class="right" > <li class="right" >
<a href="playbooks.html" title="Playbooks" <a href="YAMLScripts.html" title="YAML Scripts"
>next</a> |</li> >next</a> |</li>
<li class="right" > <li class="right" >
<a href="patterns.html" title="Patterns" <a href="patterns.html" title="Patterns"
@ -151,8 +255,8 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2012 Michael DeHaan. &copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 07, 2012. Last updated on Mar 08, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div> </div>
</body> </body>
</html> </html>

@ -23,8 +23,8 @@
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Ansible v0.0.1 documentation" href="index.html" /> <link rel="top" title="Ansible v0.0.1 documentation" href="index.html" />
<link rel="next" title="Modules" href="modules.html" /> <link rel="next" title="Ansible Modules" href="modules.html" />
<link rel="prev" title="YAML Scripts" href="YAMLScripts.html" /> <link rel="prev" title="Getting Started" href="gettingstarted.html" />
</head> </head>
<body> <body>
<div class="related"> <div class="related">
@ -34,10 +34,10 @@
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
accesskey="I">index</a></li> accesskey="I">index</a></li>
<li class="right" > <li class="right" >
<a href="modules.html" title="Modules" <a href="modules.html" title="Ansible Modules"
accesskey="N">next</a> |</li> accesskey="N">next</a> |</li>
<li class="right" > <li class="right" >
<a href="YAMLScripts.html" title="YAML Scripts" <a href="gettingstarted.html" title="Getting Started"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul> </ul>
@ -50,54 +50,64 @@
<div class="section" id="patterns"> <div class="section" id="patterns">
<h1>Patterns<a class="headerlink" href="#patterns" title="Permalink to this headline"></a></h1> <h1>Patterns<a class="headerlink" href="#patterns" title="Permalink to this headline"></a></h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim <p>How to select hosts you wish to manage</p>
placerat nibh, non feugiat risus varius vitae. Donec eu libero <div class="admonition-see-also admonition seealso">
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in <p class="first admonition-title">See also</p>
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, <dl class="last docutils">
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus <dt><a class="reference internal" href="examples.html"><em>Examples</em></a></dt>
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae <dd>Examples of basic commands</dd>
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis <dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, <dd>Learning ansible&#8217;s configuration management language</dd>
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies </dl>
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis </div>
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna <p>Ansible works against multiple systems in your infrastructure at the
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae same time. It does this by selecting portions of systems listed in Ansible&#8217;s inventory file,
metus. Fusce nec sapien dolor.</p> which defaults to /etc/ansible/hosts, and looks like this:</p>
<p>Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, <div class="highlight-python"><div class="highlight"><pre><span class="n">mail</span><span class="o">.</span><span class="n">example</span><span class="o">.</span><span class="n">com</span>
pretium quis sapien. Duis felis metus, sodales sit amet gravida in,
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin <span class="p">[</span><span class="n">webservers</span><span class="p">]</span>
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, <span class="n">foo</span><span class="o">.</span><span class="n">example</span><span class="o">.</span><span class="n">com</span>
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada <span class="n">bar</span><span class="o">.</span><span class="n">example</span><span class="o">.</span><span class="n">com</span>
molestie, nisi nunc placerat libero, vel vulputate elit tellus et
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat <span class="p">[</span><span class="n">dbservers</span><span class="p">]</span>
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan <span class="n">one</span><span class="o">.</span><span class="n">example</span><span class="o">.</span><span class="n">com</span>
lorem eget leo dictum viverra.</p> <span class="n">two</span><span class="o">.</span><span class="n">example</span><span class="o">.</span><span class="n">com</span>
<p>Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean <span class="n">three</span><span class="o">.</span><span class="n">example</span><span class="o">.</span><span class="n">com</span>
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar </pre></div>
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis </div>
dolor. Mauris sodales porta enim, non ultricies dolor luctus <div class="section" id="targetting-all-systems">
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, <h2>Targetting All Systems<a class="headerlink" href="#targetting-all-systems" title="Permalink to this headline"></a></h2>
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra <p>The pattern &#8216;all&#8217; or &#8216;*&#8217; targets all systems in the inventory file.</p>
arcu sem a ante. Praesent nec metus vestibulum augue eleifend </div>
suscipit. In feugiat, sem nec dignissim consequat, velit tortor <div class="section" id="specific-hosts">
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh <h2>Specific Hosts<a class="headerlink" href="#specific-hosts" title="Permalink to this headline"></a></h2>
turpis. Proin ac nisi ligula, a pretium augue.</p> <p>It is possible to address specific hosts:</p>
<p>In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed <blockquote>
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, <div>one.example.com
eget lobortis mi magna sed metus. Cras justo est, tempus quis one.example.com:two.example.com</div></blockquote>
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et </div>
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae <div class="section" id="groups">
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc <h2>Groups<a class="headerlink" href="#groups" title="Permalink to this headline"></a></h2>
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet <p>The following patterns address one or more groups:</p>
lacus. Maecenas interdum viverra laoreet. Quisque elementum <blockquote>
sollicitudin ullamcorper.</p> <div>webservers
<p>Pellentesque mauris sem, malesuada at lobortis in, porta eget webservers:dbservers</div></blockquote>
urna. Duis aliquet quam eget risus elementum quis auctor ligula <p>There is also a magic group &#8216;ungrouped&#8217; which selects systems not in a group.</p>
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies </div>
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat <div class="section" id="wildcards">
tristique lobortis. Suspendisse est enim, tristique eu convallis id, <h2>Wildcards<a class="headerlink" href="#wildcards" title="Permalink to this headline"></a></h2>
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin <p>Individual hosts, but not groups, can also be referenced using wildcards:</p>
hendrerit mi tincidunt dui fermentum placerat.</p> <blockquote>
<div><a href="#id1"><span class="problematic" id="id2">*</span></a>.example.com
<a href="#id3"><span class="problematic" id="id4">*</span></a>.com</div></blockquote>
</div>
<div class="section" id="mixing-things-up">
<h2>Mixing Things Up<a class="headerlink" href="#mixing-things-up" title="Permalink to this headline"></a></h2>
<p>Specific hosts, wildcards, and groups can all be mixed in the same pattern</p>
<blockquote>
<div>one*.com:dbservers</div></blockquote>
<p>It is not possible to target a host not in the inventory file.</p>
</div>
</div> </div>
@ -106,12 +116,24 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
</div> </div>
<div class="sphinxsidebar"> <div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"> <div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Patterns</a><ul>
<li><a class="reference internal" href="#targetting-all-systems">Targetting All Systems</a></li>
<li><a class="reference internal" href="#specific-hosts">Specific Hosts</a></li>
<li><a class="reference internal" href="#groups">Groups</a></li>
<li><a class="reference internal" href="#wildcards">Wildcards</a></li>
<li><a class="reference internal" href="#mixing-things-up">Mixing Things Up</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4> <h4>Previous topic</h4>
<p class="topless"><a href="YAMLScripts.html" <p class="topless"><a href="gettingstarted.html"
title="previous chapter">YAML Scripts</a></p> title="previous chapter">Getting Started</a></p>
<h4>Next topic</h4> <h4>Next topic</h4>
<p class="topless"><a href="modules.html" <p class="topless"><a href="modules.html"
title="next chapter">Modules</a></p> title="next chapter">Ansible Modules</a></p>
<h3>This Page</h3> <h3>This Page</h3>
<ul class="this-page-menu"> <ul class="this-page-menu">
<li><a href="_sources/patterns.txt" <li><a href="_sources/patterns.txt"
@ -120,7 +142,7 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<div id="searchbox" style="display: none"> <div id="searchbox" style="display: none">
<h3>Quick search</h3> <h3>Quick search</h3>
<form class="search" action="search.html" method="get"> <form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" /> <input type="text" name="q" />
<input type="submit" value="Go" /> <input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" /> <input type="hidden" name="area" value="default" />
@ -141,18 +163,18 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
>index</a></li> >index</a></li>
<li class="right" > <li class="right" >
<a href="modules.html" title="Modules" <a href="modules.html" title="Ansible Modules"
>next</a> |</li> >next</a> |</li>
<li class="right" > <li class="right" >
<a href="YAMLScripts.html" title="YAML Scripts" <a href="gettingstarted.html" title="Getting Started"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2012 Michael DeHaan. &copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 07, 2012. Last updated on Mar 08, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div> </div>
</body> </body>
</html> </html>

@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Ansible v0.0.1 documentation" href="index.html" /> <link rel="top" title="Ansible v0.0.1 documentation" href="index.html" />
<link rel="next" title="Examples" href="examples.html" /> <link rel="next" title="Examples" href="examples.html" />
<link rel="prev" title="Modules" href="modules.html" /> <link rel="prev" title="YAML Scripts" href="YAMLScripts.html" />
</head> </head>
<body> <body>
<div class="related"> <div class="related">
@ -37,7 +37,7 @@
<a href="examples.html" title="Examples" <a href="examples.html" title="Examples"
accesskey="N">next</a> |</li> accesskey="N">next</a> |</li>
<li class="right" > <li class="right" >
<a href="modules.html" title="Modules" <a href="YAMLScripts.html" title="YAML Scripts"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul> </ul>
@ -50,54 +50,118 @@
<div class="section" id="playbooks"> <div class="section" id="playbooks">
<h1>Playbooks<a class="headerlink" href="#playbooks" title="Permalink to this headline"></a></h1> <h1>Playbooks<a class="headerlink" href="#playbooks" title="Permalink to this headline"></a></h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim <div class="admonition-see-also admonition seealso">
placerat nibh, non feugiat risus varius vitae. Donec eu libero <p class="first admonition-title">See also</p>
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in <dl class="last docutils">
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, <dt><a class="reference internal" href="YAMLScripts.html"><em>YAML Scripts</em></a></dt>
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus <dd>Learn about YAML syntax</dd>
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae <dt><a class="reference internal" href="modules.html"><em>Ansible Modules</em></a></dt>
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis <dd>Learn about available modules and writing your own</dd>
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, <dt><a class="reference internal" href="patterns.html"><em>Patterns</em></a></dt>
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies <dd>Learn about how to select hosts</dd>
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis </dl>
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna </div>
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae <p>Playbooks are a completely different way to use ansible and are particularly awesome.</p>
metus. Fusce nec sapien dolor.</p> <p>They are the basis for a really simple configuration management and deployment system, unlike any that already exist, and one that is very well suited to deploying complex multi-machine applications. While you might run the main ansible program for ad-hoc tasks, playbooks are more likely to be kept in source control and used to push out your configuration or assure the configurations of your remote systems are in spec.</p>
<p>Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, <div class="section" id="playbook-example">
pretium quis sapien. Duis felis metus, sodales sit amet gravida in, <h2>Playbook Example<a class="headerlink" href="#playbook-example" title="Permalink to this headline"></a></h2>
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin <p>Playbooks are expressed in YAML format and have a minimum of syntax. Each playbook is composed
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, of one or more patterns in a list. By composing a playbook of multiple patterns, it is possible
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada to orchestrate multi-machine deployments, running certain steps on all machines in
molestie, nisi nunc placerat libero, vel vulputate elit tellus et the webservers group, then certain steps on the database server group, then more commands
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat back on the webservers group, etc:</p>
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan <div class="highlight-python"><pre>---
lorem eget leo dictum viverra.</p> - hosts: all</pre>
<p>Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean </div>
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar <blockquote>
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis <div><dl class="docutils">
dolor. Mauris sodales porta enim, non ultricies dolor luctus <dt>vars:</dt>
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, <dd>http_port: 80
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra max_clients: 200</dd>
arcu sem a ante. Praesent nec metus vestibulum augue eleifend </dl>
suscipit. In feugiat, sem nec dignissim consequat, velit tortor <p>user: root
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh tasks:
turpis. Proin ac nisi ligula, a pretium augue.</p> - include: base.yml somevar=3 othervar=4
<p>In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed - name: write the apache config file</p>
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, <blockquote>
eget lobortis mi magna sed metus. Cras justo est, tempus quis <div>action: template src=/srv/httpd.j2 dest=/etc/httpd.conf
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et notify:
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae - restart apache</div></blockquote>
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc <ul class="simple">
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet <li>name: ensure apache is running
lacus. Maecenas interdum viverra laoreet. Quisque elementum action: service name=httpd state=started</li>
sollicitudin ullamcorper.</p> </ul>
<p>Pellentesque mauris sem, malesuada at lobortis in, porta eget <dl class="docutils">
urna. Duis aliquet quam eget risus elementum quis auctor ligula <dt>handlers:</dt>
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies <dd><ul class="first last simple">
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat <li>include: handlers.yml</li>
tristique lobortis. Suspendisse est enim, tristique eu convallis id, </ul>
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin </dd>
hendrerit mi tincidunt dui fermentum placerat.</p> </dl>
</div></blockquote>
</div>
<div class="section" id="hosts-line">
<h2>Hosts line<a class="headerlink" href="#hosts-line" title="Permalink to this headline"></a></h2>
<p>The hosts line is alist of one or more groups or host patterns, seperated by colons.</p>
<blockquote>
<div>webservers:dbservers:<a href="#id1"><span class="problematic" id="id2">*</span></a>.foo.example.com</div></blockquote>
</div>
<div class="section" id="vars-section">
<h2>Vars section<a class="headerlink" href="#vars-section" title="Permalink to this headline"></a></h2>
<p>A list of variables that can be used in the &#8216;action&#8217; lines of the template, or in
included templates. Variables are deferenced like this:</p>
<div class="highlight-python"><pre>{{ varname }}</pre>
</div>
<p>These variables will be pushed down to the managed systems for use in templating operations.</p>
<p>Further, if there are discovered variables about the system (say, if facter or ohai were
installed) these variables bubble up back into the playbook, and can be used on each
system just like explicitly set variables. Facter variables are prefixed with &#8216;facter&#8217;
and Ohai variables are prefixed with &#8216;ohai&#8217;.</p>
</div>
<div class="section" id="tasks-list">
<h2>Tasks list<a class="headerlink" href="#tasks-list" title="Permalink to this headline"></a></h2>
<p>Tasks are executed in order, one at a time, against all machines matched by the host
pattern, before moving on to the next task. Failed tasks are taken out of the rotation.</p>
</div>
<div class="section" id="task-name-and-comment">
<h2>Task name and comment<a class="headerlink" href="#task-name-and-comment" title="Permalink to this headline"></a></h2>
<p>Each task has a name (required) and optional comment. This is for informational purposes only</p>
</div>
<div class="section" id="task-action">
<h2>Task action<a class="headerlink" href="#task-action" title="Permalink to this headline"></a></h2>
<p>The action line is the name of an ansible module followed by parameters. Usually these
are expressed in key=value form, except for the command module, which looks just like a Linux/Unix
command line. See the module documentation for more info.</p>
</div>
<div class="section" id="notify-statements">
<h2>Notify statements<a class="headerlink" href="#notify-statements" title="Permalink to this headline"></a></h2>
<p>Nearly all modules are written to be &#8216;idempotent&#8217; and can signal when they have affected a change
on the remote system. If a notify statement is used, the named handler will be run against
each system where a change was effected, but NOT on systems where no change occurred.</p>
</div>
<div class="section" id="handlers">
<h2>Handlers<a class="headerlink" href="#handlers" title="Permalink to this headline"></a></h2>
<p>Handlers are lists of tasks, not really any different from regular tasks, that are referenced
by name.</p>
</div>
<div class="section" id="includes">
<h2>Includes<a class="headerlink" href="#includes" title="Permalink to this headline"></a></h2>
<p>Not all tasks have to be listed directly in the main file. An include file can contain
a list of tasks (in YAML) as well, optionally passing extra variables into the file.
Variables passed in can be deferenced like this:</p>
<blockquote>
<div>{{ variable }}</div></blockquote>
</div>
<div class="section" id="asynchronous-actions-and-polling">
<h2>Asynchronous Actions and Polling<a class="headerlink" href="#asynchronous-actions-and-polling" title="Permalink to this headline"></a></h2>
<p>(Information on this feature is pending)</p>
</div>
<div class="section" id="executing-a-playbook">
<h2>Executing A Playbook<a class="headerlink" href="#executing-a-playbook" title="Permalink to this headline"></a></h2>
<p>To run a playbook:</p>
<div class="highlight-python"><pre>ansible-playbook playbook.yml</pre>
</div>
</div>
</div> </div>
@ -106,9 +170,27 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
</div> </div>
<div class="sphinxsidebar"> <div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"> <div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Playbooks</a><ul>
<li><a class="reference internal" href="#playbook-example">Playbook Example</a></li>
<li><a class="reference internal" href="#hosts-line">Hosts line</a></li>
<li><a class="reference internal" href="#vars-section">Vars section</a></li>
<li><a class="reference internal" href="#tasks-list">Tasks list</a></li>
<li><a class="reference internal" href="#task-name-and-comment">Task name and comment</a></li>
<li><a class="reference internal" href="#task-action">Task action</a></li>
<li><a class="reference internal" href="#notify-statements">Notify statements</a></li>
<li><a class="reference internal" href="#handlers">Handlers</a></li>
<li><a class="reference internal" href="#includes">Includes</a></li>
<li><a class="reference internal" href="#asynchronous-actions-and-polling">Asynchronous Actions and Polling</a></li>
<li><a class="reference internal" href="#executing-a-playbook">Executing A Playbook</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4> <h4>Previous topic</h4>
<p class="topless"><a href="modules.html" <p class="topless"><a href="YAMLScripts.html"
title="previous chapter">Modules</a></p> title="previous chapter">YAML Scripts</a></p>
<h4>Next topic</h4> <h4>Next topic</h4>
<p class="topless"><a href="examples.html" <p class="topless"><a href="examples.html"
title="next chapter">Examples</a></p> title="next chapter">Examples</a></p>
@ -120,7 +202,7 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<div id="searchbox" style="display: none"> <div id="searchbox" style="display: none">
<h3>Quick search</h3> <h3>Quick search</h3>
<form class="search" action="search.html" method="get"> <form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" /> <input type="text" name="q" />
<input type="submit" value="Go" /> <input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" /> <input type="hidden" name="area" value="default" />
@ -144,15 +226,15 @@ hendrerit mi tincidunt dui fermentum placerat.</p>
<a href="examples.html" title="Examples" <a href="examples.html" title="Examples"
>next</a> |</li> >next</a> |</li>
<li class="right" > <li class="right" >
<a href="modules.html" title="Modules" <a href="YAMLScripts.html" title="YAML Scripts"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2012 Michael DeHaan. &copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 07, 2012. Last updated on Mar 08, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div> </div>
</body> </body>
</html> </html>

@ -90,8 +90,8 @@
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2012 Michael DeHaan. &copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 07, 2012. Last updated on Mar 08, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div> </div>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

@ -1,8 +1,9 @@
YAML Scripts YAML Scripts
============ ============
This page provides a basic overview of correct YAML syntax. This page provides a basic overview of correct YAML syntax, which is how Ansible
playbooks (our configuration management language) are expressed.
You may also wish to read playbook examples and will quickly pick this up from those.
YAML Basics YAML Basics
----------- -----------
@ -74,7 +75,7 @@ Finally, you can combine these data structures::
dotnet: Lame dotnet: Lame
That's all you really need to know about YAML to get started writing That's all you really need to know about YAML to get started writing
`Ansible` scripts. `Ansible` playbooks.
.. seealso:: .. seealso::

@ -1,55 +1,35 @@
API API
=== ```
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim The Python API is very powerful, and is how the ansible CLI and ansible-playbook
placerat nibh, non feugiat risus varius vitae. Donec eu libero are implemented.
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, It's pretty simple::
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae import ansible.runner
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, runner = ansible.runner.Runner(
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies module_name='ping',
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis module_args='',
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna pattern='web*',
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae forks=10
metus. Fusce nec sapien dolor. )
datastructure = runner.run()
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at,
pretium quis sapien. Duis felis metus, sodales sit amet gravida in, The run method returns results per host, grouped by whether they
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin could be contacted or not. Return types are module specific, as
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, expressed in the 'ansible-modules' documentation.::
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada
molestie, nisi nunc placerat libero, vel vulputate elit tellus et {
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat "dark" : {
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan "web1.example.com" : "failure message"
lorem eget leo dictum viverra. }
"contacted" : {
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean "web2.example.com" : 1
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar }
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis }
dolor. Mauris sodales porta enim, non ultricies dolor luctus
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, A module can return any type of JSON data it wants, so Ansible can
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra be used as a framework to rapidly build powerful applications and scripts.
arcu sem a ante. Praesent nec metus vestibulum augue eleifend
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh
turpis. Proin ac nisi ligula, a pretium augue.
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl,
eget lobortis mi magna sed metus. Cras justo est, tempus quis
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet
lacus. Maecenas interdum viverra laoreet. Quisque elementum
sollicitudin ullamcorper.
Pellentesque mauris sem, malesuada at lobortis in, porta eget
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin
hendrerit mi tincidunt dui fermentum placerat.

@ -1,55 +1,9 @@
Communicate Communicate and Get Involved
=========== ===========================
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim * Join the `ansible-project mailing list <http://groups.google.com/group/ansible-project>`_ on Google Groups
placerat nibh, non feugiat risus varius vitae. Donec eu libero * Join `#ansible <irc://irc.freenode.net/#ansible>`_ on the `freenode IRC network <http://freenode.net/>`_
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in * Visit the `project page <https://github.com/ansible/ansible>`_ on Github
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum,
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa,
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae
metus. Fusce nec sapien dolor.
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, - View the `issue tracker <https://github.com/ansible/ansible/issues>`_
pretium quis sapien. Duis felis metus, sodales sit amet gravida in,
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at,
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada
molestie, nisi nunc placerat libero, vel vulputate elit tellus et
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan
lorem eget leo dictum viverra.
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis
dolor. Mauris sodales porta enim, non ultricies dolor luctus
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate,
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra
arcu sem a ante. Praesent nec metus vestibulum augue eleifend
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh
turpis. Proin ac nisi ligula, a pretium augue.
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl,
eget lobortis mi magna sed metus. Cras justo est, tempus quis
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet
lacus. Maecenas interdum viverra laoreet. Quisque elementum
sollicitudin ullamcorper.
Pellentesque mauris sem, malesuada at lobortis in, porta eget
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin
hendrerit mi tincidunt dui fermentum placerat.

@ -1,71 +1,65 @@
Examples Examples
======== ========
Examples 1 .. seealso::
``````````
:doc:`modules`
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim A list of available modules
placerat nibh, non feugiat risus varius vitae. Donec eu libero :doc:`playbooks`
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in Alternative ways to use ansible
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum,
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae Parallelism and Shell Commands
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis ``````````````````````````````
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa,
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies Reboot all web servers in Atlanta, 10 at a time::
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna ssh-agent bash
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae ssh-add ~/.ssh/id_rsa.pub
metus. Fusce nec sapien dolor.
ansible atlanta -a "/sbin/reboot" -f 10
Examples 2 The -f 10 specifies the usage of 10 simultaneous processes.
``````````
Note that other than the command module, ansible modules do not work like simple scripts. They make the remote system look like you state, and run the commands neccessary to get it there.
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at,
pretium quis sapien. Duis felis metus, sodales sit amet gravida in,
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin Example 2: Time Limited Background Operations
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, `````````````````````````````````````````````
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada
molestie, nisi nunc placerat libero, vel vulputate elit tellus et
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat Long running operations can be backgrounded, and their status can be checked on later. The same job ID is given to the same task on all hosts, so you won't lose track. Polling support is pending in the command line.::
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan
lorem eget leo dictum viverra. ansible all -B 3600 -a "/usr/bin/long_running_operation --do-stuff"
ansible all -n job_status -a jid=123456789
Examples 3
`````````` Any module other than 'copy' or 'template' can be backgrounded.
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar Examples 3: File Transfer & Templating
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis ``````````````````````````````````````
dolor. Mauris sodales porta enim, non ultricies dolor luctus
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, Ansible can SCP lots of files to multiple machines in parallel, and optionally use them as template sources.
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra
arcu sem a ante. Praesent nec metus vestibulum augue eleifend To just transfer a file directly to many different servers::
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh ansible atlanta copy -a "/etc/hosts /tmp/hosts"
turpis. Proin ac nisi ligula, a pretium augue.
To use templating, first run the setup module to put the template variables you would like to use on the remote host. Then use the template module to write the files using the templates. Templates are written in Jinja2 format. Playbooks (covered below) will run the setup module for you, making this even simpler.::
Examples 3
`````````` ansible webservers -m setup -a "favcolor=red ntp_server=192.168.1.1"
ansible webservers -m template -a "src=/srv/motd.j2 dest=/etc/motd"
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed ansible webservers -m template -a "src=/srv/ntp.j2 dest=/etc/ntp.conf"
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl,
eget lobortis mi magna sed metus. Cras justo est, tempus quis Need something like the fqdn in a template? If facter or ohai are installed, data from these projects will also be made available to the template engine, using 'facter' and 'ohai' prefixes for each.
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae Examples 3: Deploying From Source Control
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc `````````````````````````````````````````
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet
lacus. Maecenas interdum viverra laoreet. Quisque elementum Deploy your webapp straight from git::
sollicitudin ullamcorper.
ansible webservers -m git -a "repo=git://foo dest=/srv/myapp version=HEAD"
Examples 4
`````````` Since ansible modules can notify change handlers (see 'Playbooks') it is possible to tell ansible to run specific tasks when the code is updated, such as deploying Perl/Python/PHP/Ruby directly from git and then restarting apache.
Pellentesque mauris sem, malesuada at lobortis in, porta eget
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin
hendrerit mi tincidunt dui fermentum placerat.

@ -1,67 +1,100 @@
Getting Started Getting Started
=============== ===============
How to ansible How to download ansible and get started using it
.. seealso:: .. seealso::
:doc:`examples`
Examples of basic commands
:doc:`YAMLScripts` :doc:`YAMLScripts`
Complete documentation of the YAML syntax `ansible` understands. Complete documentation of the YAML syntax `ansible` understands for playbooks.
:doc:`playbooks`
Learning ansible's configuration management language
What you need :doc:`modules`
------------- Learn about modules that ship with ansible
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim Requirements
placerat nibh, non feugiat risus varius vitae. Donec eu libero ````````````
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, Requirements are extremely minimal.
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae If you are running python 2.6 on the **overlord** machine, you will
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis need:
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa,
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies * ``paramiko``
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis * ``PyYAML``
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna * ``python-jinja2`` (for playbooks)
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae
metus. Fusce nec sapien dolor. If you are running less than Python 2.6, you will also need:
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, * The Python 2.4 or 2.5 backport of the ``multiprocessing`` module
pretium quis sapien. Duis felis metus, sodales sit amet gravida in,
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin - `Installation and Testing Instructions <http://code.google.com/p/python-multiprocessing/wiki/Install>`_
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at,
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada * ``simplejson``
molestie, nisi nunc placerat libero, vel vulputate elit tellus et
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat On the managed nodes, to use templating, you will need:
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan
lorem eget leo dictum viverra. * ``python-jinja2`` (you can install this with ansible)
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean Developer Requirements
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar ``````````````````````
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis
dolor. Mauris sodales porta enim, non ultricies dolor luctus For developers, you may wish to have:
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate,
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra * ``asciidoc`` (for building manpage documentation)
arcu sem a ante. Praesent nec metus vestibulum augue eleifend * ``python-sphinx`` (for building content for ansible.github.com)
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh
turpis. Proin ac nisi ligula, a pretium augue. Getting Ansible
```````````````
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, Tagged releases are available as tar.gz files from the Ansible github
eget lobortis mi magna sed metus. Cras justo est, tempus quis project page:
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae * `Ansible/downloads <https://github.com/ansible/ansible/downloads>`_
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet You can also clone the git repository yourself and install Ansible in
lacus. Maecenas interdum viverra laoreet. Quisque elementum one of two ways:
sollicitudin ullamcorper.
Pellentesque mauris sem, malesuada at lobortis in, porta eget Python Distutils
urna. Duis aliquet quam eget risus elementum quis auctor ligula ++++++++++++++++
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat You can also install Ansible using Python Distutils::
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin $ git clone git://github.com/ansible/ansible.git
hendrerit mi tincidunt dui fermentum placerat. $ cd ./ansible
$ sudo make install
Via RPM
+++++++
In the near future, pre-built RPMs will be available through your distribution. Until that time you
can use the ``make rpm`` command::
$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ make rpm
$ sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/ansible-1.0-1.noarch.rpm
Your first commands
```````````````````
Edit /etc/ansible/hosts and put one or more remote systems in it, for which you have your SSH
key in ``authorized_keys``::
192.168.1.50
aserver.example.org
bserver.example.org
Now try this:
ssh-agent bash
ssh-add ~/.ssh/id_rsa
ansible all -m ping
Congratulations. You've just contacted your nodes with Ansible. It's now time to read some
of the more real-world examples.

@ -5,102 +5,48 @@
Ansible Ansible
======= =======
Ansible is a extra-simple tool/API for doing 'parallel remote things' Ansible is a radically simple deployment, configuration, and command execution framework.
over SSH -- whether executing commands, running "modules", or Other tools in this space have been too complicated for too long, require too much bootstrapping,
executing larger 'playbooks' that can serve as a configuration and have too much learning curve. Ansible is dead simple and painless to extend. For comparison, Puppet and Chef have about 60k lines of code. Ansible's core is a little over 1000 lines.
management or deployment system.
While `Func installation <http://fedorahosted.org/func>`_ which I Ansible isn't just for configuration -- it's also great for Ad-Hoc tasks,
co-wrote, aspired to avoid using SSH and have it's own daemon quickly firing off commands against nodes. Where Ansible excels though, is expressing complex multi-node deployment processes, executing complex sequences of commands on different hosts through the "playbooks" feature.
infrastructure, Ansible aspires to be quite different and more
minimal, but still able to grow more modularly over time. This is
based on talking to a lot of users of various tools and wishing to
eliminate problems with connectivity and long running daemons, or not
picking tool `X` because they preferred to code in `Y`. Further,
playbooks take things a whole step further, building the config and
deployment system I always wanted to build.
Why use Ansible versus something else? (Fabric, Capistrano, Ansible does not require programming in any particular language -- you can write modules
as scripts or programs that return simple JSON.
Why use Ansible versus something else? (Puppet, Chef, Fabric, Capistrano,
mCollective, Func, SaltStack, etc?) It will have far less code, it mCollective, Func, SaltStack, etc?) It will have far less code, it
will be more correct, and it will be the easiest thing to hack on and will be more correct, and it will be the easiest thing to hack on and
use you'll ever see -- regardless of your favorite language of choice. use you'll ever see -- regardless of your favorite language of choice.
Want to only code plugins in bash or clojure? Ansible doesn't care. Systems management doesn't have to be complicated. Ansible's docs will remain
The docs will fit on one page and the source will be blindingly short & simple, and the source will be blindingly obvious.
obvious.
Design Principles Design Goals
````````````````` ````````````
* Dead simple setup * Dead simple setup
* Super fast & parallel by default * Super fast & parallel by default
* No server or client daemons; use existing SSHd * No server or client daemons; use existing SSHd out of the box
* No additional software required on client boxes * No additional software required on client boxes
* Modules can be written in ANY language * Modules can be written in ANY language
* Awesome API for creating very powerful distributed scripts * Awesome API for creating very powerful distributed scripts
* Be usable as non-root * Be usable as non-root
* Create the easiest config management system to use, ever. * Create the easiest config management system to use, ever.
About the Author
````````````````
Requirements Michael DeHaan is a Raleigh, NC based software developer and architect. He created other
```````````` DevOps programs such as Cobbler, the popular Linux install server.
Cobbler is used to deploy mission critical systems all over the planet, in industries
Requirements are extremely minimal. ranging from massively multiplayer gaming, core internet infrastructure, finance,
chip design, and more. Michael also helped co-author of Func, which is used
If you are running python 2.6 on the **overlord** machine, you will to orchestrate systems in lots of diverse places.
need:
* ``paramiko``
* ``PyYAML``
* ``python-jinja2`` (for playbooks)
* ``Asciidoc`` (for building documentation)
If you are running less than Python 2.6, you will also need:
* The Python 2.4 or 2.5 backport of the ``multiprocessing`` module
- `Installation and Testing Instructions <http://code.google.com/p/python-multiprocessing/wiki/Install>`_
* ``simplejson``
On the managed nodes, to use templating, you will need:
* ``python-jinja2`` (you can install this with ansible)
Getting Ansible
```````````````
Tagged releases are available as tar.gz files from the Ansible github
project page:
* `Ansible/downloads <https://github.com/ansible/ansible/downloads>`_
You can also clone the git repository yourself and install Ansible in
one of two ways:
Python Distutils
++++++++++++++++
You can install Ansible using Python Distutils::
$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ sudo make install
Via RPM
+++++++
In the future, pre-built RPMs may be available. Until that time you
can use the ``make rpm`` command::
$ git clone git://github.com/ansible/ansible.git
$ cd ./ansible
$ make rpm
$ sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/ansible-1.0-1.noarch.rpm
Ansible is an GPLv3 licensed open source project, so see the contributions section for how to
get involved.
Contents Contents
======== ========
@ -109,21 +55,11 @@ Contents
:maxdepth: 3 :maxdepth: 3
gettingstarted gettingstarted
YAMLScripts
patterns patterns
modules modules
YAMLScripts
playbooks playbooks
examples examples
api api
communicate communicate
man man
Communicate or Get Involved
===========================
* Join the `ansible-project mailing list <http://groups.google.com/group/ansible-project>`_ on Google Groups
* Join `#ansible <irc://irc.freenode.net/#ansible>`_ on the `freenode IRC network <http://freenode.net/>`_
* Visit the `project page <https://github.com/ansible/ansible>`_ on Github
- View the `issue tracker <https://github.com/ansible/ansible/issues>`_

@ -3,19 +3,10 @@
Man Pages Man Pages
========= =========
Ansile ships with a handfull of manpages to help you on your journey. Ansible's manpage lists available command line options.
ansible(1) ansible(1)
---------- ----------
* `View ansible.1 <man/ansible.1.html>`_ * `View ansible.1 <man/ansible.1.html>`_
ansible-modules(5)
------------------
* `View ansible-modules.5 <man/ansible-modules.5.html>`_
ansible-playbook(5)
-------------------
* `View ansible-playbook.5 <man/ansible-playbook.5.html>`_

@ -1,55 +1,201 @@
Modules Ansible Modules
======= ===============
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim .. seealso::
placerat nibh, non feugiat risus varius vitae. Donec eu libero
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in :doc:`examples`
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, Examples of using modules in /usr/bin/ansible
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus :doc:`playbooks`
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae Examples of using modules with /usr/bin/ansible-playbook
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis :doc:`api`
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, Examples of using modules with the Python API
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna About Modules
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae `````````````
metus. Fusce nec sapien dolor.
Ansible ships with a number of modules that can be executed directly on remote hosts or through
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, ansible playbooks.
pretium quis sapien. Duis felis metus, sodales sit amet gravida in,
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, Idempotence
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada ```````````
molestie, nisi nunc placerat libero, vel vulputate elit tellus et
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat Most modules other than command are idempotent, meaning they will seek to avoid changes
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan unless a change needs to be made. When using ansible playbooks, these modules can
lorem eget leo dictum viverra. trigger change events. Unless otherwise noted, all modules support change hooks.
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar command
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis ```````
dolor. Mauris sodales porta enim, non ultricies dolor luctus
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, The command module takes the command name followed by a list of arguments, space delimited.
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra This is the only module that does not use key=value style parameters.
arcu sem a ante. Praesent nec metus vestibulum augue eleifend
suscipit. In feugiat, sem nec dignissim consequat, velit tortor Example usage::
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh
turpis. Proin ac nisi ligula, a pretium augue. /sbin/shutdown -t now
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed This module does not support change hooks and returns the return code from the program as well as timing information about how long the command was running for.
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl,
eget lobortis mi magna sed metus. Cras justo est, tempus quis
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et copy
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae ````
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet The copy module moves a file on the local box to remote locations.
lacus. Maecenas interdum viverra laoreet. Quisque elementum
sollicitudin ullamcorper. *src*::
Pellentesque mauris sem, malesuada at lobortis in, porta eget Local absolute path to a file to copy to the remote server
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat *dest*::
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin Remote absolute path where the file should end up
hendrerit mi tincidunt dui fermentum placerat.
This module also returns md5sum information about the resultant file.
facter
``````
Runs the discovery program 'facter' on the remote system, returning
JSON data that can be useful for inventory purposes.
Requires that 'facter' and 'ruby-json' be installed on the remote end.
This module is informative only - it takes no parameters & does not support change hooks,
nor does it make any changes on the system.
git
```
Deploys software from git checkouts.
*repo*::
git or http protocol address of the repo to checkout
*dest*::
where to check it out, an absolute directory path
*version*::
what version to check out -- either the git SHA, the literal string 'HEAD', or a tag name
ohai
````
Similar to the facter module, this returns JSON inventory data. Ohai
data is a bit more verbose and nested than facter.
Requires that 'ohai' be installed on the remote end.
This module is information only - it takes no parameters & does not
support change hooks, nor does it make any changes on the system.
ping
````
A trivial test module, this module always returns the integer '1' on
successful contact.
This module does not support change hooks.
This module is informative only - it takes no parameters & does not
support change hooks, nor does it make any changes on the system.
service
```````
Controls services on remote machines.
*state*
Values are 'started', 'stopped', or 'restarted'. Started/stopped
are idempotent actions that will not run commands unless neccessary.
'restarted' will always bounce the service
*name*
The name of the service
setup
`````
Writes a JSON file containing key/value data, for use in templating.
Call this once before using the template modules. Playbooks will
execute this module automatically as the first step in each play.
If facter or ohai are installed, variables from these programs will also
be snapshotted into the JSON file for usage in templating. These variables
are prefixed with 'facter_' and 'ohai_" so it's easy to tell their source.
*metadata*
Optionally overrides the default JSON file location of /etc/ansible/setup or ~/ansible/setup
depending on what remote user has been specified.
If used, also supply the metadata parameter to the template module.
*anything*
any other parameters can be named basically anything, and set a key=value
pair in the JSON file for use in templating.
template
````````
Templates a file out to a remote server. Call the setup module prior to usage.
*src*
path of a Jinja2 formatted template on the local server
*dest*
location to render the template on the remote server
*metadata*
location of a JSON file to use to supply template data. Default is /etc/ansible/setup
which is the same as the default for the setup module. Change if running as a non-root
remote user who does not have permissions on /etc/ansible.
This module also returns md5sum information about the resultant file.
user
````
This module is in plan.
yum
```
This module is in plan.
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. 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 values are up to the module.

@ -1,55 +1,69 @@
Patterns Patterns
======== ========
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim How to select hosts you wish to manage
placerat nibh, non feugiat risus varius vitae. Donec eu libero
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in .. seealso::
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum,
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus :doc:`examples`
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae Examples of basic commands
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis :doc:`playbooks`
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, Learning ansible's configuration management language
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis Ansible works against multiple systems in your infrastructure at the
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna same time. It does this by selecting portions of systems listed in Ansible's inventory file,
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae which defaults to /etc/ansible/hosts, and looks like this::
metus. Fusce nec sapien dolor.
mail.example.com
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at,
pretium quis sapien. Duis felis metus, sodales sit amet gravida in, [webservers]
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin foo.example.com
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, bar.example.com
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada
molestie, nisi nunc placerat libero, vel vulputate elit tellus et [dbservers]
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat one.example.com
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan two.example.com
lorem eget leo dictum viverra. three.example.com
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean Targetting All Systems
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar ``````````````````````
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis
dolor. Mauris sodales porta enim, non ultricies dolor luctus The pattern 'all' or '*' targets all systems in the inventory file.
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate,
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra Specific Hosts
arcu sem a ante. Praesent nec metus vestibulum augue eleifend ``````````````
suscipit. In feugiat, sem nec dignissim consequat, velit tortor
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh It is possible to address specific hosts:
turpis. Proin ac nisi ligula, a pretium augue.
one.example.com
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed one.example.com:two.example.com
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl,
eget lobortis mi magna sed metus. Cras justo est, tempus quis Groups
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et ``````
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc The following patterns address one or more groups:
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet
lacus. Maecenas interdum viverra laoreet. Quisque elementum webservers
sollicitudin ullamcorper. webservers:dbservers
Pellentesque mauris sem, malesuada at lobortis in, porta eget There is also a magic group 'ungrouped' which selects systems not in a group.
urna. Duis aliquet quam eget risus elementum quis auctor ligula
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies Wildcards
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat `````````
tristique lobortis. Suspendisse est enim, tristique eu convallis id,
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin Individual hosts, but not groups, can also be referenced using wildcards:
hendrerit mi tincidunt dui fermentum placerat.
*.example.com
*.com
Mixing Things Up
````````````````
Specific hosts, wildcards, and groups can all be mixed in the same pattern
one*.com:dbservers
It is not possible to target a host not in the inventory file.

@ -1,55 +1,118 @@
Playbooks Playbooks
========= =========
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim .. seealso::
placerat nibh, non feugiat risus varius vitae. Donec eu libero
lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in :doc:`YAMLScripts`
magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, Learn about YAML syntax
dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus :doc:`modules`
mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae Learn about available modules and writing your own
luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis :doc:`patterns`
ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, Learn about how to select hosts
rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies
tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis
egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna Playbooks are a completely different way to use ansible and are particularly awesome.
sem. Donec arcu felis, faucibus et malesuada non, blandit vitae
metus. Fusce nec sapien dolor. They are the basis for a really simple configuration management and deployment system, unlike any that already exist, and one that is very well suited to deploying complex multi-machine applications. While you might run the main ansible program for ad-hoc tasks, playbooks are more likely to be kept in source control and used to push out your configuration or assure the configurations of your remote systems are in spec.
Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at,
pretium quis sapien. Duis felis metus, sodales sit amet gravida in, Playbook Example
pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin ````````````````
eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at,
suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada Playbooks are expressed in YAML format and have a minimum of syntax. Each playbook is composed
molestie, nisi nunc placerat libero, vel vulputate elit tellus et of one or more patterns in a list. By composing a playbook of multiple patterns, it is possible
augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat to orchestrate multi-machine deployments, running certain steps on all machines in
egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan the webservers group, then certain steps on the database server group, then more commands
lorem eget leo dictum viverra. back on the webservers group, etc::
Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean ---
ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar - hosts: all
quam. Suspendisse nec massa vel augue laoreet ultricies in convallis vars:
dolor. Mauris sodales porta enim, non ultricies dolor luctus http_port: 80
in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, max_clients: 200
erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra user: root
arcu sem a ante. Praesent nec metus vestibulum augue eleifend tasks:
suscipit. In feugiat, sem nec dignissim consequat, velit tortor - include: base.yml somevar=3 othervar=4
scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh - name: write the apache config file
turpis. Proin ac nisi ligula, a pretium augue. action: template src=/srv/httpd.j2 dest=/etc/httpd.conf
notify:
In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed - restart apache
ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, - name: ensure apache is running
eget lobortis mi magna sed metus. Cras justo est, tempus quis action: service name=httpd state=started
adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et handlers:
luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae - include: handlers.yml
nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc
sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet Hosts line
lacus. Maecenas interdum viverra laoreet. Quisque elementum ``````````
sollicitudin ullamcorper.
The hosts line is alist of one or more groups or host patterns, seperated by colons.::
Pellentesque mauris sem, malesuada at lobortis in, porta eget
urna. Duis aliquet quam eget risus elementum quis auctor ligula webservers:dbservers:*.foo.example.com
gravida. Phasellus et ullamcorper libero. Nam elementum ultricies
tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat Vars section
tristique lobortis. Suspendisse est enim, tristique eu convallis id, ````````````
rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin
hendrerit mi tincidunt dui fermentum placerat. A list of variables that can be used in the 'action' lines of the template, or in
included templates. Variables are deferenced like this::
{{ varname }}
These variables will be pushed down to the managed systems for use in templating operations.
Further, if there are discovered variables about the system (say, if facter or ohai were
installed) these variables bubble up back into the playbook, and can be used on each
system just like explicitly set variables. Facter variables are prefixed with 'facter'
and Ohai variables are prefixed with 'ohai'.
Tasks list
``````````
Tasks are executed in order, one at a time, against all machines matched by the host
pattern, before moving on to the next task. Failed tasks are taken out of the rotation.
Task name and comment
`````````
Each task has a name (required) and optional comment. This is for informational purposes only
Task action
```````````
The action line is the name of an ansible module followed by parameters. Usually these
are expressed in key=value form, except for the command module, which looks just like a Linux/Unix
command line. See the module documentation for more info.
Notify statements
`````````````````
Nearly all modules are written to be 'idempotent' and can signal when they have affected a change
on the remote system. If a notify statement is used, the named handler will be run against
each system where a change was effected, but NOT on systems where no change occurred.
Handlers
````````
Handlers are lists of tasks, not really any different from regular tasks, that are referenced
by name.
Includes
````````
Not all tasks have to be listed directly in the main file. An include file can contain
a list of tasks (in YAML) as well, optionally passing extra variables into the file.
Variables passed in can be deferenced like this:
{{ variable }}
Asynchronous Actions and Polling
````````````````````````````````
(Information on this feature is pending)
Executing A Playbook
````````````````````
To run a playbook::
ansible-playbook playbook.yml

Loading…
Cancel
Save