Commit fae963a6 by Michael DeHaan

Docs build + attempt to add image to website

parent 2fb25f1f
......@@ -158,7 +158,7 @@ represent all the options you can use to write an <cite>ansible</cite> file. In
addition, all YAML files (regardless of their association with
<cite>ansible</cite> or not) should start with <tt class="docutils literal"><span class="pre">---</span></tt>.</p>
<p>In YAML a list can be represented in two ways. In one way all members
of a list are lines beginning at the same indenta`tion level starting
of a list are lines beginning at the same indentation level starting
with a <tt class="docutils literal"><span class="pre">-</span></tt> character:</p>
<div class="highlight-python"><pre>---
# A list of tasty fruits
......@@ -229,7 +229,7 @@ languages:
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Mar 09, 2012.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
</p>
</div>
</footer>
......
......@@ -79,6 +79,14 @@ div.sphinxsidebar input {
font-size: 1em;
}
div.sphinxsidebar input[type="text"] {
width: 170px;
}
div.sphinxsidebar input[type="submit"] {
width: 30px;
}
img {
border: 0;
}
......@@ -236,7 +244,6 @@ img.align-center, .figure.align-center, object.align-center {
}
.align-center {
clear: both;
text-align: center;
}
......
......@@ -363,10 +363,13 @@ var Search = {
var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) {
match = objects[prefix][name];
descr = objnames[match[1]] + _(', in ') + titles[match[0]];
// XXX the generated anchors are not generally correct
// XXX there may be custom prefixes
result = [filenames[match[0]], fullname, '#'+fullname, descr];
descr = objnames[match[1]][2] + _(', in ') + titles[match[0]];
anchor = match[3];
if (anchor == '')
anchor = fullname;
else if (anchor == '-')
anchor = objnames[match[1]][1] + '-' + fullname;
result = [filenames[match[0]], fullname, '#'+anchor, descr];
switch (match[2]) {
case 1: objectResults.push(result); break;
case 0: importantResults.push(result); break;
......@@ -489,7 +492,7 @@ var Search = {
listItem.slideDown(5, function() {
displayNextItem();
});
});
}, "text");
} else {
// no source available, just display title
Search.output.append(listItem);
......
......@@ -222,7 +222,7 @@ command line tools <tt class="docutils literal"><span class="pre">ansible</span>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Mar 09, 2012.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
</p>
</div>
</footer>
......
......@@ -172,28 +172,44 @@ ssh-add ~/.ssh/id_rsa.pub
ansible atlanta -a "/sbin/reboot" -f 10</pre>
</div>
<p>The -f 10 specifies the usage of 10 simultaneous processes.</p>
<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. This is commonly refered to
as &#8216;idempotency&#8217;.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Note that other than the <a class="reference internal" href="modules.html#command"><em>command</em></a> module, ansible modules do
not work like simple scripts. They make the remote system look like
you state, and run the commands necessary to get it there. This
is commonly referred to as &#8216;idempotent&#8217;.</p>
</div>
</div>
<div class="section" id="file-transfer-templating">
<h2>File Transfer &amp; Templating<a class="headerlink" href="#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>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 elsewhere in the documentation) will run the setup module for you, making this even simpler.:</p>
<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 elsewhere in the
documentation) 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>
<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>
<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>
</div>
<div class="section" id="deploying-from-source-control">
<h2>Deploying From Source Control<a class="headerlink" href="#deploying-from-source-control" title="Permalink to this headline"></a></h2>
<p>Deploy your webapp straight from git:</p>
<div class="highlight-python"><pre>ansible webservers -m git -a "repo=git://foo dest=/srv/myapp version=HEAD"</pre>
</div>
<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>
<p>Since ansible modules can notify change handlers (see
<a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>) 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>
</div>
<div class="section" id="managing-services">
<h2>Managing Services<a class="headerlink" href="#managing-services" title="Permalink to this headline"></a></h2>
......@@ -206,13 +222,18 @@ ansible webservers -m template -a "src=/srv/ntp.j2 dest=/etc/ntp.conf"</pre>
</div>
<div class="section" id="time-limited-background-operations">
<h2>Time Limited Background Operations<a class="headerlink" href="#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>
<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. Typically you&#8217;ll be backgrounding shell
commands or software upgrades only.</p>
<p>After the time limit (in seconds) runs out (-B), the process on the remote nodes will be killed.</p>
<p>Any module other than <a class="reference internal" href="modules.html#copy"><em>copy</em></a> or <a class="reference internal" href="modules.html#template"><em>template</em></a> can be
backgrounded. Typically you&#8217;ll be backgrounding shell commands or
software upgrades only.</p>
<p>After the time limit (in seconds) runs out (<tt class="docutils literal"><span class="pre">-B</span></tt>), the process on
the remote nodes will be killed.</p>
</div>
</div>
......@@ -224,7 +245,7 @@ commands or software upgrades only.</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Mar 09, 2012.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
</p>
</div>
</footer>
......
......@@ -151,7 +151,7 @@
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Mar 09, 2012.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
</p>
</div>
</footer>
......
......@@ -27,7 +27,7 @@
<script type="text/javascript" src="_static/bootstrap-scrollspy.js"></script>
<link rel="top" title="Ansible v0.0.1 documentation" href="index.html" />
<link rel="next" title="The Inventory File, Patterns, and Groups" href="patterns.html" />
<link rel="prev" title="Ansible" href="index.html" />
<link rel="prev" title="Introducing Ansible" href="index.html" />
<script type="text/javascript">
(function () {
/**
......@@ -128,7 +128,7 @@
<li><a href="index.html"
title="previous chapter">&laquo; Ansible</a></li>
title="previous chapter">&laquo; Introducing Ansible</a></li>
<li><a href="patterns.html"
title="next chapter">The Inventory File, Patterns, and Groups &raquo;</a></li>
......@@ -167,7 +167,8 @@
<div class="section" id="requirements">
<h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline"></a></h2>
<p>Requirements for Ansible are extremely minimal.</p>
<p>If you are running python 2.6 on the <strong>overlord</strong> machine (the machine that you&#8217;ll be talking to the other machines from), you will need:</p>
<p>If you are running python 2.6 on the <strong>overlord</strong> machine (the machine
that you&#8217;ll be talking to the other machines from), you will need:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">paramiko</span></tt></li>
<li><tt class="docutils literal"><span class="pre">PyYAML</span></tt></li>
......@@ -213,8 +214,8 @@ $ sudo make install</pre>
</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 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>
<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
......@@ -224,8 +225,8 @@ $ sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/ansible-1.0-1.noarch.rpm</pre>
</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>
<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>
......@@ -240,10 +241,18 @@ ssh-add ~/.ssh/id_rsa</pre>
<p>Now run a live command on all of your nodes:</p>
<div class="highlight-python"><pre>ansible all /bin/echo hello</pre>
</div>
<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, and explore what you can do with different modules, as well
as the Ansible playbooks language. Ansible is not just about running commands, but you already
have a working infrastructure!</p>
<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, and explore
what you can do with different modules, as well as the Ansible
playbooks language. Ansible is not just about running commands, but
you already have a working infrastructure!</p>
<div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p>
<dl class="last docutils">
<dt><a class="reference internal" href="patterns.html#inventoryformat"><em>Inventory</em></a></dt>
<dd>Complete documentation on the inventory file format</dd>
</dl>
</div>
</div>
</div>
......@@ -255,7 +264,7 @@ have a working infrastructure!</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Mar 09, 2012.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
</p>
</div>
</footer>
......
......@@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ansible &mdash; Ansible v0.0.1 documentation</title>
<title>Introducing Ansible &mdash; Ansible v0.0.1 documentation</title>
<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/bootstrap.css" type="text/css" />
......@@ -109,7 +109,7 @@
<a href="#"
class="dropdown-toggle">Page</a>
<span class="localtoc"><ul>
<li><a class="reference internal" href="#">Ansible</a><ul>
<li><a class="reference internal" href="#">Introducing Ansible</a><ul>
<li><a class="reference internal" href="#design-goals">Design Goals</a></li>
<li><a class="reference internal" href="#communicate-and-get-involved">Communicate and Get Involved</a></li>
</ul>
......@@ -147,22 +147,31 @@
<div class="container">
<div class="section" id="ansible">
<h1>Ansible<a class="headerlink" href="#ansible" title="Permalink to this headline"></a></h1>
<p>Ansible is a radically simple deployment, configuration, and command execution framework.
Other tools in this space have been too complicated for too long, require too much bootstrapping,
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>
<p>Ansible isn&#8217;t just for configuration &#8211; it&#8217;s also great for Ad-Hoc tasks,
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 &#8220;playbooks&#8221;.</p>
<p>Extending ansible does not require programming in any particular language &#8211; you can write modules
as scripts or programs that return simple JSON. It&#8217;s also trivially easy to just execute
useful shell commands.</p>
<p>Why use Ansible versus something else? (Puppet, Chef, Fabric, Capistrano,
mCollective, Func, SaltStack, etc?) Ansible will have far less code, it
will be (by extension) 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.</p>
<p>Systems management doesn&#8217;t have to be complicated. Ansible&#8217;s docs will remain
short &amp; simple, and the source will be blindingly obvious.</p>
<a class="reference external image-reference" href="http://photos.michaeldehaan.net/infrared/h3d850bdf#h3d850bdf"><img alt="http://mpdehaan.zenfolio.com" src="http://ansible.github.com/html/mpd_rings.jpg" style="width: 400px; height: 300px;" /></a>
<div class="section" id="introducing-ansible">
<h1>Introducing Ansible<a class="headerlink" href="#introducing-ansible" title="Permalink to this headline"></a></h1>
<p>Ansible is a radically simple deployment, configuration, and command
execution framework. Other tools in this space have been too
complicated for too long, require too much bootstrapping, 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>
<p>Ansible isn&#8217;t just for configuration &#8211; it&#8217;s also great for Ad-Hoc
tasks, 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
<a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>.</p>
<p>Extending ansible does not require programming in any particular
language &#8211; you can write modules as scripts or programs that return
simple JSON. It&#8217;s also trivially easy to just execute useful shell
commands.</p>
<p>Why use Ansible versus something else? (Puppet, Chef, Fabric,
Capistrano, mCollective, Func, SaltStack, etc?) Ansible will have far
less code, it will be (by extension) 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.</p>
<p>Systems management doesn&#8217;t have to be complicated. Ansible&#8217;s docs
will remain short &amp; simple, and the source will be blindingly obvious.</p>
<div class="section" id="design-goals">
<h2>Design Goals<a class="headerlink" href="#design-goals" title="Permalink to this headline"></a></h2>
<ul class="simple">
......@@ -178,7 +187,8 @@ short &amp; simple, and the source will be blindingly obvious.</p>
</div>
<div class="section" id="communicate-and-get-involved">
<h2>Communicate and Get Involved<a class="headerlink" href="#communicate-and-get-involved" title="Permalink to this headline"></a></h2>
<p>Your ideas and contributions are welcome. We&#8217;re also happy to help you with questions about Ansible.</p>
<p>Your ideas and contributions are welcome. We&#8217;re also happy to help
you with questions about Ansible.</p>
<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>
......@@ -260,13 +270,16 @@ short &amp; simple, and the source will be blindingly obvious.</p>
</div>
<div class="section" id="about-the-author">
<h2>About the Author<a class="headerlink" href="#about-the-author" title="Permalink to this headline"></a></h2>
<p>Ansible was originally developed by Michael DeHaan, a Raleigh, NC based software developer and architect.
He created other popular DevOps programs such as Cobbler, the popular Linux install server.
Cobbler is used to deploy mission critical systems all over the planet, in industries
ranging from massively multiplayer gaming, core internet infrastructure, finance,
chip design, and more. Michael also helped co-author of Func, a precursor to Ansible, which is used
to orchestrate systems in lots of diverse places. He&#8217;s worked on systems software for
IBM, Motorola, Red Hat&#8217;s Emerging Technologies Group, Puppet Labs, and rPath.</p>
<p>Ansible was originally developed by Michael DeHaan, a Raleigh, NC
based software developer and architect. He created other popular
DevOps programs such as Cobbler, the popular Linux install server.
Cobbler is used to deploy mission critical systems all over the
planet, in industries ranging from massively multiplayer gaming, core
internet infrastructure, finance, chip design, and more. Michael also
helped co-author of Func, a precursor to Ansible, which is used to
orchestrate systems in lots of diverse places. He&#8217;s worked on systems
software for IBM, Motorola, Red Hat&#8217;s Emerging Technologies Group,
Puppet Labs, and rPath.</p>
</div>
</div>
......@@ -278,7 +291,7 @@ IBM, Motorola, Red Hat&#8217;s Emerging Technologies Group, Puppet Labs, and rPa
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Mar 09, 2012.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
</p>
</div>
</footer>
......
......@@ -161,7 +161,7 @@
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Mar 09, 2012.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
</p>
</div>
</footer>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible-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="id475130"></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="id510561"></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
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.
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible-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="id507830"></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="id395532"></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,
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>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible</title><link rel="stylesheet" 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="id547391"></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="id421198"></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">
<span class="strong"><strong>host-pattern</strong></span>
</span></dt><dd>
......
No preview for this file type
......@@ -159,10 +159,11 @@
</dl>
</div>
<div class="section" id="inventory-file-format">
<h2>Inventory File Format<a class="headerlink" href="#inventory-file-format" title="Permalink to this headline"></a></h2>
<span id="inventoryformat"></span><h2>Inventory File Format<a class="headerlink" href="#inventory-file-format" title="Permalink to this headline"></a></h2>
<p>Ansible works against multiple systems in your infrastructure at the
same time. It does this by selecting portions of systems listed in Ansible&#8217;s inventory file,
which defaults to /etc/ansible/hosts, and looks like this:</p>
same time. It does this by selecting portions of systems listed in
Ansible&#8217;s inventory file, which defaults to /etc/ansible/hosts, and
looks like this:</p>
<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>
<span class="p">[</span><span class="n">webservers</span><span class="p">]</span>
......@@ -199,7 +200,10 @@ wildcards:</p>
<p>It&#8217;s also ok to mix wildcard patterns and groups at the same time:</p>
<div class="highlight-python"><pre>one*.com:dbservers</pre>
</div>
<p>NOTE: It is not possible to target a host not in the inventory file.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">It is not possible to target a host not in the inventory file.</p>
</div>
</div>
</div>
......@@ -211,7 +215,7 @@ wildcards:</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Mar 09, 2012.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
</p>
</div>
</footer>
......
......@@ -206,7 +206,7 @@ server group, then more commands back on the webservers group, etc:</p>
<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 a list of one or more groups or host patterns,
seperated by colons, as described in the <a class="reference internal" href="patterns.html#patterns"><em>The Inventory File, Patterns, and Groups</em></a>
separated by colons, as described in the <a class="reference internal" href="patterns.html#patterns"><em>The Inventory File, Patterns, and Groups</em></a>
documentation. This is just like the first parameter to
<cite>/usr/bin/ansible</cite>.</p>
</div>
......@@ -215,8 +215,7 @@ documentation. This is just like the first parameter to
<p>A list of variables and values that can be used in the plays. These
can be used in templates or &#8216;action&#8217; lines and are dereferenced using
<cite>jinja2</cite> syntax like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{{</span> <span class="n">varname</span> <span class="p">}}</span>
</pre></div>
<div class="highlight-python"><pre>{{ varname }}</pre>
</div>
<p>Further, if there are discovered variables about the system (say, if
facter or ohai were installed) these variables bubble up back into the
......@@ -235,7 +234,7 @@ to write the hostname into the /etc/motd file, I could say:</p>
<div class="section" id="tasks-list">
<h2>Tasks list<a class="headerlink" href="#tasks-list" title="Permalink to this headline"></a></h2>
<p>Each play contains a list of tasks. Tasks are executed in order, one
at a time, against all machines matched by the play&#8217;s host pattern,
at a time, against all machines matched by the playbooks host pattern,
before moving on to the next task.</p>
<p>Hosts with failed tasks are taken out of the rotation for the entire
playbook. If things fail, simply correct the playbook file and rerun.</p>
......@@ -285,8 +284,7 @@ of the tasks complete in a particular play.</p>
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 (assume a variable named &#8216;user&#8217;):</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{{</span> <span class="n">user</span> <span class="p">}}</span>
</pre></div>
<div class="highlight-python"><pre>{{ user }}</pre>
</div>
<p>For instance, if deploying multiple wordpress instances, I could
contain all of my tasks in a wordpress.yml file, and use it like so:</p>
......@@ -312,8 +310,12 @@ like:</p>
do in the main file. Including a variable in the name of a task is a
contrived example, you could also pass them to the action command line
or use them inside a template file.</p>
<p>Note that include statements are only usable from the top level
playbook file. At this time, includes can not include other includes.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Note that include statements are only usable from the top level
playbook file. At this time, includes can not include other
includes.</p>
</div>
</div>
<div class="section" id="using-includes-to-assign-classes-of-systems">
<h2>Using Includes To Assign Classes of Systems<a class="headerlink" href="#using-includes-to-assign-classes-of-systems" title="Permalink to this headline"></a></h2>
......@@ -367,7 +369,7 @@ from the configuration file to generate machine specific variables.</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Mar 09, 2012.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
</p>
</div>
</footer>
......
......@@ -165,7 +165,7 @@
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Mar 09, 2012.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
</p>
</div>
</footer>
......
.. Director documentation master file, created by sphinx-quickstart on Sat Sep 27 13:23:22 2008.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Ansible
=======
.. image:: http://ansible.github.com/html/mpd_rings.jpg
:height: 300
:width: 400
:alt: http://mpdehaan.zenfolio.com
:target: http://photos.michaeldehaan.net/infrared/h3d850bdf#h3d850bdf
Introducing Ansible
===================
Ansible is a radically simple deployment, configuration, and command
execution framework. Other tools in this space have been too
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment