Merge pull request #8 from tbielawa/master

Bootstrap
This commit is contained in:
Michael DeHaan 2012-03-09 08:51:46 -08:00
commit e67e446950
38 changed files with 7219 additions and 1101 deletions

View file

@ -0,0 +1,5 @@
<li class="dropdown" data-dropdown="dropdown">
<a href="{{ pathto(master_doc) }}"
class="dropdown-toggle">{{ _('Site') }}</a>
<span class="globaltoc">{{ toctree(maxdepth=1) }}</span>
</li>

View file

@ -0,0 +1,126 @@
{% extends "basic/layout.html" %}
{% set script_files = script_files + ['_static/bootstrap-dropdown.js', '_static/bootstrap-scrollspy.js'] %}
{% set css_files = ['_static/bootstrap.css', '_static/bootstrap-sphinx.css'] + css_files %}
{# Sidebar: Rework into our Boostrap nav section. #}
{% macro navBar() %}
<div class="topbar" data-scrollspy="scrollspy" >
<div class="topbar-inner">
<div class="container">
<a class="brand" href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>
<ul class="nav">
{% block sidebartoc %}
{% include "globaltoc.html" %}
{% include "localtoc.html" %}
{% endblock %}
{% block sidebarrel %}
{% include "relations.html" %}
{% endblock %}
{% block sidebarsourcelink %}
{% include "sourcelink.html" %}
{% endblock %}
</ul>
<ul class="nav secondary-nav">
{% block sidebarsearch %}
{% include "searchbox.html" %}
{% endblock %}
</ul>
</div>
</div>
</div>
{% endmacro %}
{%- block extrahead %}
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
{% endblock %}
{% block header %}{{ navBar() }}{% endblock %}
{# Silence the sidebar's, relbar's #}
{% block sidebar1 %}{% endblock %}
{% block sidebar2 %}{% endblock %}
{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}
{%- block content %}
<div class="container">
{% block body %} {% endblock %}
</div>
{%- endblock %}
{%- block footer %}
<footer class="footer">
<div class="container">
<p class="pull-right"><a href="#">Back to top</a></p>
<p>
{%- if show_copyright %}
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}<br/>
{%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}<br/>
{%- endif %}
{%- endif %}
{%- if last_updated %}
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}<br/>
{%- endif %}
{%- if show_sphinx %}
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}<br/>
{%- endif %}
</p>
</div>
</footer>
{%- endblock %}

View file

@ -0,0 +1,5 @@
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">{{ _('Page') }}</a>
<span class="localtoc">{{ toc }}</span>
</li>

View file

@ -0,0 +1,8 @@
{%- if prev %}
<li><a href="{{ prev.link|e }}"
title="{{ _('previous chapter') }}">{{ "&laquo;"|safe }} {{ prev.title }}</a></li>
{%- endif %}
{%- if next %}
<li><a href="{{ next.link|e }}"
title="{{ _('next chapter') }}">{{ next.title }} {{ "&raquo;"|safe }}</a></li>
{%- endif %}

View file

@ -0,0 +1,7 @@
{%- if pagename != "search" %}
<form class="pull-left" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
{%- endif %}

View file

@ -0,0 +1,4 @@
{%- if show_source and has_source and sourcename %}
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
rel="nofollow">{{ _('Source') }}</a></li>
{%- endif %}

View file

@ -0,0 +1,55 @@
/* ============================================================
* bootstrap-dropdown.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#dropdown
* ============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function( $ ){
"use strict"
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
$.fn.dropdown = function ( selector ) {
return this.each(function () {
$(this).delegate(selector || d, 'click', function (e) {
var li = $(this).parent('li')
, isActive = li.hasClass('open')
clearMenus()
!isActive && li.toggleClass('open')
return false
})
})
}
/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */
var d = 'a.menu, .dropdown-toggle'
function clearMenus() {
$(d).parent('li').removeClass('open')
}
$(function () {
$('html').bind("click", clearMenus)
$('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
})
}( window.jQuery || window.ender );

View file

@ -0,0 +1,107 @@
/* =============================================================
* bootstrap-scrollspy.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================== */
!function ( $ ) {
"use strict"
var $window = $(window)
function ScrollSpy( topbar, selector ) {
var processScroll = $.proxy(this.processScroll, this)
this.$topbar = $(topbar)
this.selector = selector || 'li > a'
this.refresh()
this.$topbar.delegate(this.selector, 'click', processScroll)
$window.scroll(processScroll)
this.processScroll()
}
ScrollSpy.prototype = {
refresh: function () {
this.targets = this.$topbar.find(this.selector).map(function () {
var href = $(this).attr('href')
return /^#\w/.test(href) && $(href).length ? href : null
})
this.offsets = $.map(this.targets, function (id) {
return $(id).offset().top
})
}
, processScroll: function () {
var scrollTop = $window.scrollTop() + 10
, offsets = this.offsets
, targets = this.targets
, activeTarget = this.activeTarget
, i
for (i = offsets.length; i--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
&& this.activateButton( targets[i] )
}
}
, activateButton: function (target) {
this.activeTarget = target
this.$topbar
.find(this.selector).parent('.active')
.removeClass('active')
this.$topbar
.find(this.selector + '[href="' + target + '"]')
.parent('li')
.addClass('active')
}
}
/* SCROLLSPY PLUGIN DEFINITION
* =========================== */
$.fn.scrollSpy = function( options ) {
var scrollspy = this.data('scrollspy')
if (!scrollspy) {
return this.each(function () {
$(this).data('scrollspy', new ScrollSpy( this, options ))
})
}
if ( options === true ) {
return scrollspy
}
if ( typeof options == 'string' ) {
scrollspy[options]()
}
return this
}
$(document).ready(function () {
$('body').scrollSpy('[data-scrollspy] li > a')
})
}( window.jQuery || window.ender );

View file

@ -0,0 +1,24 @@
/*
* bootstrap-sphinx.css
* ~~~~~~~~~~~~~~~~~~~~
*
* Sphinx stylesheet -- Twitter Bootstrap theme.
*/
body {
padding-top: 42px;
}
div.documentwrapper {
float: left;
width: 100%;
}
{%- block sidebarlogo %}
{%- if logo %}
.topbar h3 a, .topbar .brand {
background: transparent url("{{ logo }}") no-repeat 22px 3px;
padding-left: 62px;
}
{%- endif %}
{%- endblock %}

2467
_themes/bootstrap/static/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,5 @@
# Twitter Bootstrap Theme
[theme]
inherit = basic
stylesheet = basic.css
pygments_style = tango

View file

@ -22,6 +22,7 @@ import os
#sys.path.append(os.path.abspath('some/directory')) #sys.path.append(os.path.abspath('some/directory'))
sys.path.insert(0, os.path.join('ansible', 'lib')) sys.path.insert(0, os.path.join('ansible', 'lib'))
sys.path.append(os.path.abspath('_themes'))
from ansible import __version__, __author__ from ansible import __version__, __author__
@ -98,6 +99,10 @@ pygments_style = 'sphinx'
# Options for HTML output # Options for HTML output
# ----------------------- # -----------------------
html_theme_path = ['_themes']
html_theme = 'bootstrap'
html_short_title = 'Ansible'
# The style sheet to use for HTML and HTML Help pages. A file of that name # The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths # must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path. # given in html_static_path.
@ -149,7 +154,7 @@ html_last_updated_fmt = '%b %d, %Y'
#html_split_index = False #html_split_index = False
# If true, the reST sources are included in the HTML build as _sources/<name>. # If true, the reST sources are included in the HTML build as _sources/<name>.
#html_copy_source = True html_copy_source = False
# If true, an OpenSearch description file will be output, and all pages will # If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the # contain a <link> tag referring to it. The value of this option must be the

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,44 +9,142 @@
<title>YAML Format &mdash; Ansible v0.0.1 documentation</title> <title>YAML Format &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" />
<link rel="stylesheet" href="_static/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.0.1', VERSION: '0.0.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: false
}; };
</script> </script>
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<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>
<script type="text/javascript" src="_static/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="_static/bootstrap-scrollspy.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: Ansible for Deployment, Configuration Management, and Orchestration" href="playbooks.html" /> <link rel="next" title="Playbooks" href="playbooks.html" />
<link rel="prev" title="Ansible Modules" href="modules.html" /> <link rel="prev" title="Ansible Modules" href="modules.html" />
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
</head> </head>
<body> <body>
<div class="related"> <div class="topbar" data-scrollspy="scrollspy" >
<h3>Navigation</h3> <div class="topbar-inner">
<ul> <div class="container">
<li class="right" style="margin-right: 10px"> <a class="brand" href="index.html">Ansible</a>
<a href="genindex.html" title="General Index" <ul class="nav">
accesskey="I">index</a></li>
<li class="right" > <li class="dropdown" data-dropdown="dropdown">
<a href="playbooks.html" title="Playbooks: Ansible for Deployment, Configuration Management, and Orchestration" <a href="index.html"
accesskey="N">next</a> |</li> class="dropdown-toggle">Site</a>
<li class="right" > <span class="globaltoc"><ul class="current">
<a href="modules.html" title="Ansible Modules" <li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a></li>
accesskey="P">previous</a> |</li> <li class="toctree-l1"><a class="reference internal" href="patterns.html">The Inventory File, Patterns, and Groups</a></li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples</a></li>
</ul> <li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a></li>
</div> <li class="toctree-l1 current"><a class="current reference internal" href="">YAML Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
<div class="document"> <li class="toctree-l1"><a class="reference internal" href="api.html">Using the Python API</a></li>
<div class="documentwrapper"> <li class="toctree-l1"><a class="reference internal" href="man.html">Man Pages</a></li>
<div class="bodywrapper"> </ul>
<div class="body"> </span>
</li>
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">Page</a>
<span class="localtoc"><ul>
<li><a class="reference internal" href="#">YAML Format</a><ul>
<li><a class="reference internal" href="#yaml-basics">YAML Basics</a></li>
</ul>
</li>
</ul>
</span>
</li>
<li><a href="modules.html"
title="previous chapter">&laquo; Ansible Modules</a></li>
<li><a href="playbooks.html"
title="next chapter">Playbooks &raquo;</a></li>
</ul>
<ul class="nav secondary-nav">
<form class="pull-left" action="search.html" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="section" id="yaml-format"> <div class="section" id="yaml-format">
<h1>YAML Format<a class="headerlink" href="#yaml-format" title="Permalink to this headline"></a></h1> <h1>YAML Format<a class="headerlink" href="#yaml-format" title="Permalink to this headline"></a></h1>
<p>This page provides a basic overview of correct YAML syntax, which is how Ansible <p>This page provides a basic overview of correct YAML syntax, which is how Ansible
@ -125,66 +222,16 @@ languages:
</div> </div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">YAML Format</a><ul>
<li><a class="reference internal" href="#yaml-basics">YAML Basics</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="modules.html"
title="previous chapter">Ansible Modules</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="playbooks.html"
title="next chapter">Playbooks: Ansible for Deployment, Configuration Management, and Orchestration</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/YAMLScripts.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div> </div>
<script type="text/javascript">$('#searchbox').show(0);</script> <footer class="footer">
</div> <div class="container">
</div> <p class="pull-right"><a href="#">Back to top</a></p>
<div class="clearer"></div> <p>
</div> &copy; Copyright 2012 Michael DeHaan.<br/>
<div class="related"> Last updated on Mar 09, 2012.<br/>
<h3>Navigation</h3> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
<ul> </p>
<li class="right" style="margin-right: 10px"> </div>
<a href="genindex.html" title="General Index" </footer>
>index</a></li>
<li class="right" >
<a href="playbooks.html" title="Playbooks: Ansible for Deployment, Configuration Management, and Orchestration"
>next</a> |</li>
<li class="right" >
<a href="modules.html" title="Ansible Modules"
>previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 09, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body> </body>
</html> </html>

View file

@ -1,3 +1,5 @@
.. _patterns:
The Inventory File, Patterns, and Groups The Inventory File, Patterns, and Groups
======================================== ========================================
@ -43,16 +45,17 @@ It is also possible to address specific hosts::
one.example.com:two.example.com one.example.com:two.example.com
The following patterns address one or more groups, which are denoted with the bracket The following patterns address one or more groups, which are denoted
headers in the inventory file:: with the bracket headers in the inventory file::
webservers webservers
webservers:dbservers webservers:dbservers
Individual hosts, but not groups, can also be referenced using wildcards: Individual hosts, but not groups, can also be referenced using
wildcards::
*.example.com *.example.com
*.com *.com
It's also ok to mix wildcard patterns and groups at the same time:: It's also ok to mix wildcard patterns and groups at the same time::

View file

@ -1,5 +1,5 @@
Playbooks: Ansible for Deployment, Configuration Management, and Orchestration Playbooks
============================================================================== =========
.. seealso:: .. seealso::
@ -11,21 +11,28 @@ Playbooks: Ansible for Deployment, Configuration Management, and Orchestration
Learn about how to select hosts Learn about how to select hosts
Playbooks are a completely different way to use ansible and are particularly awesome. Playbooks are a completely different way to use ansible and are
particularly awesome.
They are the basis for a really simple configuration management and multi-machine deployment system, unlike any that already exist, and one that is very well suited to deploying complex applications. They are the basis for a really simple configuration management and
multi-machine deployment system, unlike any that already exist, and
one that is very well suited to deploying complex applications.
While you might run the main /usr/bin/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. While you might run the main ``/usr/bin/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.
Playbook Example Playbook Example
```````````````` ````````````````
Playbooks are expressed in YAML format and have a minimum of syntax. Each playbook is composed Playbooks are expressed in YAML format and have a minimum of syntax.
of one or more 'plays' in a list. By composing a playbook of multiple 'plays', it is possible Each playbook is composed of one or more 'plays' in a list. By
to orchestrate multi-machine deployments, running certain steps on all machines in composing a playbook of multiple 'plays', it is possible to
the webservers group, then certain steps on the database server group, then more commands orchestrate multi-machine deployments, running certain steps on all
back on the webservers group, etc:: machines in the webservers group, then certain steps on the database
server group, then more commands back on the webservers group, etc::
--- ---
- hosts: webservers - hosts: webservers
@ -47,21 +54,25 @@ back on the webservers group, etc::
Hosts line Hosts line
`````````` ``````````
The hosts line is a list of one or more groups or host patterns, seperated by colons, asdescribed in the 'patterns' documentation. This is just like the first parameter to /usr/bin/ansible. The hosts line is a list of one or more groups or host patterns,
seperated by colons, asdescribed in the :ref:`patterns` documentation.
This is just like the first parameter to ``/usr/bin/ansible``.
Vars section Vars section
```````````` ````````````
A list of variables and values that can be used in the plays. These can be used in templates A list of variables and values that can be used in the plays. These
or 'action' lines and are dereferenced using ```jinja2``` syntax like this:: can be used in templates or 'action' lines and are dereferenced using
```jinja2``` syntax like this::
{{ varname }} {{ varname }}
Further, if there are discovered variables about the system (say, if facter or ohai were Further, if there are discovered variables about the system (say, if
installed) these variables bubble up back into the playbook, and can be used on each facter or ohai were installed) these variables bubble up back into the
system just like explicitly set variables. Facter variables are prefixed with 'facter_' playbook, and can be used on each system just like explicitly set
and Ohai variables are prefixed with 'ohai_'. So for instance, if I wanted to write the variables. Facter variables are prefixed with ``facter_`` and Ohai
hostname into the /etc/motd file, I could say:: variables are prefixed with ``ohai_``. So for instance, if I wanted
to write the hostname into the /etc/motd file, I could say::
- name: write the motd - name: write the motd
- action: template src=/srv/templates/motd.j2 dest=/etc/motd - action: template src=/srv/templates/motd.j2 dest=/etc/motd
@ -75,27 +86,32 @@ But we're getting ahead of ourselves. Let's talk about tasks.
Tasks list Tasks list
`````````` ``````````
Each play contains a list of tasks. Tasks are executed in order, one at a time, against Each play contains a list of tasks. Tasks are executed in order, one
all machines matched by the play's host pattern, before moving on to the next task. at a time, against all machines matched by the play's host pattern,
before moving on to the next task.
Hosts with failed tasks are taken out of the rotation for the entire playbook. If things fail, Hosts with failed tasks are taken out of the rotation for the entire
simply correct the playbook file and rerun. playbook. If things fail, simply correct the playbook file and rerun.
Modules other than command are idempotent, meaning if you run them again, they will make the Modules other than command are idempotent, meaning if you run them
changes they are told to make to bring the system to the desired state. again, they will make the changes they are told to make to bring the
system to the desired state.
Task name and action Task name and action
````````````````````` `````````````````````
Every task must have a name, which is included in the output from running the playbook. Every task must have a name, which is included in the output from
running the playbook.
The action line is the name of an ansible module followed by parameters. Usually these The action line is the name of an ansible module followed by
are expressed in key=value form, except for the command module, which looks just like a Linux/Unix parameters. Usually these are expressed in ``key=value`` form, except
command line. See the module documentation for more info. for the command module, which looks just like a Linux/Unix command
line. See the module documentation for more info.
Variables, as mentioned above, can be used in action lines. So if, hypothetically, you wanted Variables, as mentioned above, can be used in action lines. So if,
to make a directory on each system named after the hostname ... yeah, that's I know silly ... you could hypothetically, you wanted to make a directory on each system named
do it like so:: after the hostname ... yeah, that's I know silly ... you could do it
like so::
- name: make a directory - name: make a directory
- action: mkdir /tmp/{{ facter_hostname }} - action: mkdir /tmp/{{ facter_hostname }}
@ -103,44 +119,49 @@ do it like so::
Notify statements Notify statements
````````````````` `````````````````
Nearly all modules are written to be 'idempotent' and can signal when they have affected a change Nearly all modules are written to be 'idempotent' and can signal when
on the remote system. If a notify statement is used, the named handler will be run against they have affected a change on the remote system. If a notify
each system where a change was effected, but NOT on systems where no change occurred. This happens statement is used, the named handler will be run against each system
after all of the tasks are run. For example, if notifying Apache and potentially replacing lots of where a change was effected, but NOT on systems where no change
configuration files, you could have Apache restart just once, at the end of a run. If you need occurred. This happens after all of the tasks are run. For example,
Apache restarted in the middle of a run, you could just make a task for it, no harm done. Notifiers if notifying Apache and potentially replacing lots of configuration
are optional. files, you could have Apache restart just once, at the end of a run.
If you need Apache restarted in the middle of a run, you could just
make a task for it, no harm done. Notifiers are optional.
Handlers Handlers
```````` ````````
Handlers are lists of tasks, not really any different from regular tasks, that are referenced Handlers are lists of tasks, not really any different from regular
by name. Handlers are what notifiers notify. If nothing notifies a handler, it will not run. tasks, that are referenced by name. Handlers are what notifiers
Regardless of how many things notify a handler, it will run only once, after all of the tasks notify. If nothing notifies a handler, it will not run. Regardless
complete in a particular play. of how many things notify a handler, it will run only once, after all
of the tasks complete in a particular play.
Includes Includes
```````` ````````
Not all tasks have to be listed directly in the main file. An include file can contain Not all tasks have to be listed directly in the main file. An include
a list of tasks (in YAML) as well, optionally passing extra variables into the file. file can contain a list of tasks (in YAML) as well, optionally passing
Variables passed in can be deferenced like this (assume a variable named 'user'):: extra variables into the file. Variables passed in can be deferenced
like this (assume a variable named 'user')::
{{ user }} {{ user }}
For instance, if deploying multiple wordpress instances, I could contain all of my tasks For instance, if deploying multiple wordpress instances, I could
in a wordpress.yml file, and use it like so:: contain all of my tasks in a wordpress.yml file, and use it like so::
- tasks: - tasks:
- include: wordpress.yml user=timmy - include: wordpress.yml user=timmy
- include: wordpress.yml user=alice - include: wordpress.yml user=alice
- include: wordpress.yml user=bob - include: wordpress.yml user=bob
In addition to the explicitly passed in parameters, all variables from the vars section In addition to the explicitly passed in parameters, all variables from
are also available. the vars section are also available.
The format of an included list of tasks or handlers looks just like a flat list of tasks. Here The format of an included list of tasks or handlers looks just like a
is an example of what base.yml might look like:: flat list of tasks. Here is an example of what base.yml might look
like::
--- ---
- name: no selinux - name: no selinux
@ -150,18 +171,20 @@ is an example of what base.yml might look like::
- name: this is just to show variables work here, favcolor={{ favcolor }} - name: this is just to show variables work here, favcolor={{ favcolor }}
action: command /bin/true action: command /bin/true
As you can see above, variables in include files work just like they do in the main file. As you can see above, variables in include files work just like they
Including a variable in the name of a task is a contrived example, you could also do in the main file. Including a variable in the name of a task is a
pass them to the action command line or use them inside a template file. contrived example, you could also pass them to the action command line
or use them inside a template file.
Note that include statements are only usable from the top level playbook file. Note that include statements are only usable from the top level
At this time, includes can not include other includes. playbook file. At this time, includes can not include other includes.
Using Includes To Assign Classes of Systems Using Includes To Assign Classes of Systems
``````````````````````````````````````````` ```````````````````````````````````````````
Include files are best used to reuse logic between playbooks. You could imagine Include files are best used to reuse logic between playbooks. You
a playbook describing your entire infrastructure like this:: could imagine a playbook describing your entire infrastructure like
this::
--- ---
- hosts: atlanta-webservers - hosts: atlanta-webservers
@ -181,21 +204,23 @@ a playbook describing your entire infrastructure like this::
handlers: handlers:
- include: generic-handlers.yml - include: generic-handlers.yml
There is one (or more) play defined for each group of systems, and each play maps There is one (or more) play defined for each group of systems, and
each group includes one or more 'class definitions' telling the systems what they each play maps each group includes one or more 'class definitions'
are supposed to do or be. telling the systems what they are supposed to do or be.
Using a common handlers file could allow one task in 'webservers' to define 'restart apache', Using a common handlers file could allow one task in 'webservers' to
and it could be reused between multiple plays. define 'restart apache', and it could be reused between multiple
plays.
Variables like 'database' above can be used in templates referenced from the Variables like 'database' above can be used in templates referenced
configuration file to generate machine specific variables. from the configuration file to generate machine specific variables.
Asynchronous Actions and Polling Asynchronous Actions and Polling
```````````````````````````````` ````````````````````````````````
(Information on this feature is pending) (Information on this feature is pending)
Executing A Playbook Executing A Playbook
```````````````````` ````````````````````

View file

@ -79,14 +79,6 @@ 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;
} }
@ -244,6 +236,7 @@ img.align-center, .figure.align-center, object.align-center {
} }
.align-center { .align-center {
clear: both;
text-align: center; text-align: center;
} }

55
html/_static/bootstrap-dropdown.js vendored Normal file
View file

@ -0,0 +1,55 @@
/* ============================================================
* bootstrap-dropdown.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#dropdown
* ============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function( $ ){
"use strict"
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
$.fn.dropdown = function ( selector ) {
return this.each(function () {
$(this).delegate(selector || d, 'click', function (e) {
var li = $(this).parent('li')
, isActive = li.hasClass('open')
clearMenus()
!isActive && li.toggleClass('open')
return false
})
})
}
/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */
var d = 'a.menu, .dropdown-toggle'
function clearMenus() {
$(d).parent('li').removeClass('open')
}
$(function () {
$('html').bind("click", clearMenus)
$('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
})
}( window.jQuery || window.ender );

107
html/_static/bootstrap-scrollspy.js vendored Normal file
View file

@ -0,0 +1,107 @@
/* =============================================================
* bootstrap-scrollspy.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================== */
!function ( $ ) {
"use strict"
var $window = $(window)
function ScrollSpy( topbar, selector ) {
var processScroll = $.proxy(this.processScroll, this)
this.$topbar = $(topbar)
this.selector = selector || 'li > a'
this.refresh()
this.$topbar.delegate(this.selector, 'click', processScroll)
$window.scroll(processScroll)
this.processScroll()
}
ScrollSpy.prototype = {
refresh: function () {
this.targets = this.$topbar.find(this.selector).map(function () {
var href = $(this).attr('href')
return /^#\w/.test(href) && $(href).length ? href : null
})
this.offsets = $.map(this.targets, function (id) {
return $(id).offset().top
})
}
, processScroll: function () {
var scrollTop = $window.scrollTop() + 10
, offsets = this.offsets
, targets = this.targets
, activeTarget = this.activeTarget
, i
for (i = offsets.length; i--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
&& this.activateButton( targets[i] )
}
}
, activateButton: function (target) {
this.activeTarget = target
this.$topbar
.find(this.selector).parent('.active')
.removeClass('active')
this.$topbar
.find(this.selector + '[href="' + target + '"]')
.parent('li')
.addClass('active')
}
}
/* SCROLLSPY PLUGIN DEFINITION
* =========================== */
$.fn.scrollSpy = function( options ) {
var scrollspy = this.data('scrollspy')
if (!scrollspy) {
return this.each(function () {
$(this).data('scrollspy', new ScrollSpy( this, options ))
})
}
if ( options === true ) {
return scrollspy
}
if ( typeof options == 'string' ) {
scrollspy[options]()
}
return this
}
$(document).ready(function () {
$('body').scrollSpy('[data-scrollspy] li > a')
})
}( window.jQuery || window.ender );

15
html/_static/bootstrap-sphinx.css vendored Normal file
View file

@ -0,0 +1,15 @@
/*
* bootstrap-sphinx.css
* ~~~~~~~~~~~~~~~~~~~~
*
* Sphinx stylesheet -- Twitter Bootstrap theme.
*/
body {
padding-top: 42px;
}
div.documentwrapper {
float: left;
width: 100%;
}

2467
html/_static/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -363,13 +363,10 @@ 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]][2] + _(', in ') + titles[match[0]]; descr = objnames[match[1]] + _(', in ') + titles[match[0]];
anchor = match[3]; // XXX the generated anchors are not generally correct
if (anchor == '') // XXX there may be custom prefixes
anchor = fullname; result = [filenames[match[0]], fullname, '#'+fullname, descr];
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;
@ -492,7 +489,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);

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,44 +9,142 @@
<title>Using the Python API &mdash; Ansible v0.0.1 documentation</title> <title>Using the Python API &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" />
<link rel="stylesheet" href="_static/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.0.1', VERSION: '0.0.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: false
}; };
</script> </script>
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<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>
<script type="text/javascript" src="_static/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="_static/bootstrap-scrollspy.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="Man Pages" href="man.html" /> <link rel="next" title="Man Pages" href="man.html" />
<link rel="prev" title="Playbooks: Ansible for Deployment, Configuration Management, and Orchestration" href="playbooks.html" /> <link rel="prev" title="Playbooks" href="playbooks.html" />
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
</head> </head>
<body> <body>
<div class="related"> <div class="topbar" data-scrollspy="scrollspy" >
<h3>Navigation</h3> <div class="topbar-inner">
<ul> <div class="container">
<li class="right" style="margin-right: 10px"> <a class="brand" href="index.html">Ansible</a>
<a href="genindex.html" title="General Index" <ul class="nav">
accesskey="I">index</a></li>
<li class="right" > <li class="dropdown" data-dropdown="dropdown">
<a href="man.html" title="Man Pages" <a href="index.html"
accesskey="N">next</a> |</li> class="dropdown-toggle">Site</a>
<li class="right" > <span class="globaltoc"><ul class="current">
<a href="playbooks.html" title="Playbooks: Ansible for Deployment, Configuration Management, and Orchestration" <li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a></li>
accesskey="P">previous</a> |</li> <li class="toctree-l1"><a class="reference internal" href="patterns.html">The Inventory File, Patterns, and Groups</a></li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples</a></li>
</ul> <li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a></li>
</div> <li class="toctree-l1"><a class="reference internal" href="YAMLScripts.html">YAML Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
<div class="document"> <li class="toctree-l1 current"><a class="current reference internal" href="">Using the Python API</a></li>
<div class="documentwrapper"> <li class="toctree-l1"><a class="reference internal" href="man.html">Man Pages</a></li>
<div class="bodywrapper"> </ul>
<div class="body"> </span>
</li>
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">Page</a>
<span class="localtoc"><ul>
<li><a class="reference internal" href="#">Using the Python API</a><ul>
<li><a class="reference internal" href="#detailed-api-example">Detailed API Example</a></li>
</ul>
</li>
</ul>
</span>
</li>
<li><a href="playbooks.html"
title="previous chapter">&laquo; Playbooks</a></li>
<li><a href="man.html"
title="next chapter">Man Pages &raquo;</a></li>
</ul>
<ul class="nav secondary-nav">
<form class="pull-left" action="search.html" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="section" id="using-the-python-api"> <div class="section" id="using-the-python-api">
<h1>Using the Python API<a class="headerlink" href="#using-the-python-api" title="Permalink to this headline"></a></h1> <h1>Using the Python API<a class="headerlink" href="#using-the-python-api" title="Permalink to this headline"></a></h1>
<p>The Python API is very powerful, and is how the ansible CLI and ansible-playbook <p>The Python API is very powerful, and is how the ansible CLI and ansible-playbook
@ -118,66 +215,16 @@ command line tools <tt class="docutils literal"><span class="pre">ansible</span>
</div> </div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Using the Python API</a><ul>
<li><a class="reference internal" href="#detailed-api-example">Detailed API Example</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="playbooks.html"
title="previous chapter">Playbooks: Ansible for Deployment, Configuration Management, and Orchestration</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="man.html"
title="next chapter">Man Pages</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/api.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div> </div>
<script type="text/javascript">$('#searchbox').show(0);</script> <footer class="footer">
</div> <div class="container">
</div> <p class="pull-right"><a href="#">Back to top</a></p>
<div class="clearer"></div> <p>
</div> &copy; Copyright 2012 Michael DeHaan.<br/>
<div class="related"> Last updated on Mar 09, 2012.<br/>
<h3>Navigation</h3> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
<ul> </p>
<li class="right" style="margin-right: 10px"> </div>
<a href="genindex.html" title="General Index" </footer>
>index</a></li>
<li class="right" >
<a href="man.html" title="Man Pages"
>next</a> |</li>
<li class="right" >
<a href="playbooks.html" title="Playbooks: Ansible for Deployment, Configuration Management, and Orchestration"
>previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 09, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body> </body>
</html> </html>

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,44 +9,146 @@
<title>Command Line Examples &mdash; Ansible v0.0.1 documentation</title> <title>Command Line Examples &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" />
<link rel="stylesheet" href="_static/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.0.1', VERSION: '0.0.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: false
}; };
</script> </script>
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<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>
<script type="text/javascript" src="_static/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="_static/bootstrap-scrollspy.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="Ansible Modules" href="modules.html" /> <link rel="next" title="Ansible Modules" href="modules.html" />
<link rel="prev" title="The Inventory File, Patterns, and Groups" href="patterns.html" /> <link rel="prev" title="The Inventory File, Patterns, and Groups" href="patterns.html" />
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
</head> </head>
<body> <body>
<div class="related"> <div class="topbar" data-scrollspy="scrollspy" >
<h3>Navigation</h3> <div class="topbar-inner">
<ul> <div class="container">
<li class="right" style="margin-right: 10px"> <a class="brand" href="index.html">Ansible</a>
<a href="genindex.html" title="General Index" <ul class="nav">
accesskey="I">index</a></li>
<li class="right" > <li class="dropdown" data-dropdown="dropdown">
<a href="modules.html" title="Ansible Modules" <a href="index.html"
accesskey="N">next</a> |</li> class="dropdown-toggle">Site</a>
<li class="right" > <span class="globaltoc"><ul class="current">
<a href="patterns.html" title="The Inventory File, Patterns, and Groups" <li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a></li>
accesskey="P">previous</a> |</li> <li class="toctree-l1"><a class="reference internal" href="patterns.html">The Inventory File, Patterns, and Groups</a></li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li class="toctree-l1 current"><a class="current reference internal" href="">Command Line Examples</a></li>
</ul> <li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a></li>
</div> <li class="toctree-l1"><a class="reference internal" href="YAMLScripts.html">YAML Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
<div class="document"> <li class="toctree-l1"><a class="reference internal" href="api.html">Using the Python API</a></li>
<div class="documentwrapper"> <li class="toctree-l1"><a class="reference internal" href="man.html">Man Pages</a></li>
<div class="bodywrapper"> </ul>
<div class="body"> </span>
</li>
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">Page</a>
<span class="localtoc"><ul>
<li><a class="reference internal" href="#">Command Line Examples</a><ul>
<li><a class="reference internal" href="#parallelism-and-shell-commands">Parallelism and Shell Commands</a></li>
<li><a class="reference internal" href="#file-transfer-templating">File Transfer &amp; Templating</a></li>
<li><a class="reference internal" href="#deploying-from-source-control">Deploying From Source Control</a></li>
<li><a class="reference internal" href="#managing-services">Managing Services</a></li>
<li><a class="reference internal" href="#time-limited-background-operations">Time Limited Background Operations</a></li>
</ul>
</li>
</ul>
</span>
</li>
<li><a href="patterns.html"
title="previous chapter">&laquo; The Inventory File, Patterns, and Groups</a></li>
<li><a href="modules.html"
title="next chapter">Ansible Modules &raquo;</a></li>
</ul>
<ul class="nav secondary-nav">
<form class="pull-left" action="search.html" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="section" id="command-line-examples"> <div class="section" id="command-line-examples">
<h1>Command Line Examples<a class="headerlink" href="#command-line-examples" title="Permalink to this headline"></a></h1> <h1>Command Line Examples<a class="headerlink" href="#command-line-examples" title="Permalink to this headline"></a></h1>
<p>The following examples show how to use <cite>/usr/bin/ansible</cite> for running ad-hoc tasks. <p>The following examples show how to use <cite>/usr/bin/ansible</cite> for running ad-hoc tasks.
@ -58,7 +159,7 @@ using <cite>/usr/bin/ansible-playbook</cite> &#8211; the concepts port over dire
<dl class="last docutils"> <dl class="last docutils">
<dt><a class="reference internal" href="modules.html"><em>Ansible Modules</em></a></dt> <dt><a class="reference internal" href="modules.html"><em>Ansible Modules</em></a></dt>
<dd>A list of available modules</dd> <dd>A list of available modules</dd>
<dt><a class="reference internal" href="playbooks.html"><em>Playbooks: Ansible for Deployment, Configuration Management, and Orchestration</em></a></dt> <dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
<dd>Alternative ways to use ansible</dd> <dd>Alternative ways to use ansible</dd>
</dl> </dl>
</div> </div>
@ -116,70 +217,16 @@ commands or software upgrades only.</p>
</div> </div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Command Line Examples</a><ul>
<li><a class="reference internal" href="#parallelism-and-shell-commands">Parallelism and Shell Commands</a></li>
<li><a class="reference internal" href="#file-transfer-templating">File Transfer &amp; Templating</a></li>
<li><a class="reference internal" href="#deploying-from-source-control">Deploying From Source Control</a></li>
<li><a class="reference internal" href="#managing-services">Managing Services</a></li>
<li><a class="reference internal" href="#time-limited-background-operations">Time Limited Background Operations</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="patterns.html"
title="previous chapter">The Inventory File, Patterns, and Groups</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="modules.html"
title="next chapter">Ansible Modules</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/examples.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div> </div>
<script type="text/javascript">$('#searchbox').show(0);</script> <footer class="footer">
</div> <div class="container">
</div> <p class="pull-right"><a href="#">Back to top</a></p>
<div class="clearer"></div> <p>
</div> &copy; Copyright 2012 Michael DeHaan.<br/>
<div class="related"> Last updated on Mar 09, 2012.<br/>
<h3>Navigation</h3> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
<ul> </p>
<li class="right" style="margin-right: 10px"> </div>
<a href="genindex.html" title="General Index" </footer>
>index</a></li>
<li class="right" >
<a href="modules.html" title="Ansible Modules"
>next</a> |</li>
<li class="right" >
<a href="patterns.html" title="The Inventory File, Patterns, and Groups"
>previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 09, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body> </body>
</html> </html>

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,36 +9,133 @@
<title>Index &mdash; Ansible v0.0.1 documentation</title> <title>Index &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" />
<link rel="stylesheet" href="_static/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.0.1', VERSION: '0.0.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: false
}; };
</script> </script>
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<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" /> <script type="text/javascript" src="_static/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="_static/bootstrap-scrollspy.js"></script>
<link rel="top" title="Ansible v0.0.1 documentation" href="index.html" />
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
</head> </head>
<body> <body>
<div class="related"> <div class="topbar" data-scrollspy="scrollspy" >
<h3>Navigation</h3> <div class="topbar-inner">
<ul> <div class="container">
<li class="right" style="margin-right: 10px"> <a class="brand" href="index.html">Ansible</a>
<a href="#" title="General Index" <ul class="nav">
accesskey="I">index</a></li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li class="dropdown" data-dropdown="dropdown">
</ul> <a href="index.html"
</div> class="dropdown-toggle">Site</a>
<span class="globaltoc"><ul>
<li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="patterns.html">The Inventory File, Patterns, and Groups</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="YAMLScripts.html">YAML Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">Using the Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="man.html">Man Pages</a></li>
</ul>
</span>
</li>
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">Page</a>
<span class="localtoc"></span>
</li>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</ul>
<ul class="nav secondary-nav">
<form class="pull-left" action="search.html" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</ul>
</div>
</div>
</div>
<div class="container">
<h1 id="index">Index</h1> <h1 id="index">Index</h1>
@ -48,44 +144,16 @@
</div> </div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div> </div>
<script type="text/javascript">$('#searchbox').show(0);</script> <footer class="footer">
</div> <div class="container">
</div> <p class="pull-right"><a href="#">Back to top</a></p>
<div class="clearer"></div> <p>
</div> &copy; Copyright 2012 Michael DeHaan.<br/>
<div class="related"> Last updated on Mar 09, 2012.<br/>
<h3>Navigation</h3> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
<ul> </p>
<li class="right" style="margin-right: 10px"> </div>
<a href="#" title="General Index" </footer>
>index</a></li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 09, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body> </body>
</html> </html>

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,44 +9,149 @@
<title>Getting Started &mdash; Ansible v0.0.1 documentation</title> <title>Getting Started &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" />
<link rel="stylesheet" href="_static/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.0.1', VERSION: '0.0.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: false
}; };
</script> </script>
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<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>
<script type="text/javascript" src="_static/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="_static/bootstrap-scrollspy.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="The Inventory File, Patterns, and Groups" href="patterns.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="Ansible" href="index.html" />
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
</head> </head>
<body> <body>
<div class="related"> <div class="topbar" data-scrollspy="scrollspy" >
<h3>Navigation</h3> <div class="topbar-inner">
<ul> <div class="container">
<li class="right" style="margin-right: 10px"> <a class="brand" href="index.html">Ansible</a>
<a href="genindex.html" title="General Index" <ul class="nav">
accesskey="I">index</a></li>
<li class="right" > <li class="dropdown" data-dropdown="dropdown">
<a href="patterns.html" title="The Inventory File, Patterns, and Groups" <a href="index.html"
accesskey="N">next</a> |</li> class="dropdown-toggle">Site</a>
<li class="right" > <span class="globaltoc"><ul class="current">
<a href="index.html" title="Ansible" <li class="toctree-l1 current"><a class="current reference internal" href="">Getting Started</a></li>
accesskey="P">previous</a> |</li> <li class="toctree-l1"><a class="reference internal" href="patterns.html">The Inventory File, Patterns, and Groups</a></li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples</a></li>
</ul> <li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a></li>
</div> <li class="toctree-l1"><a class="reference internal" href="YAMLScripts.html">YAML Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
<div class="document"> <li class="toctree-l1"><a class="reference internal" href="api.html">Using the Python API</a></li>
<div class="documentwrapper"> <li class="toctree-l1"><a class="reference internal" href="man.html">Man Pages</a></li>
<div class="bodywrapper"> </ul>
<div class="body"> </span>
</li>
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">Page</a>
<span class="localtoc"><ul>
<li><a class="reference internal" href="#">Getting Started</a><ul>
<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>
</li>
</ul>
</span>
</li>
<li><a href="index.html"
title="previous chapter">&laquo; Ansible</a></li>
<li><a href="patterns.html"
title="next chapter">The Inventory File, Patterns, and Groups &raquo;</a></li>
</ul>
<ul class="nav secondary-nav">
<form class="pull-left" action="search.html" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</ul>
</div>
</div>
</div>
<div class="container">
<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 download ansible and get started using it</p> <p>How to download ansible and get started using it</p>
@ -56,7 +160,7 @@
<dl class="last docutils"> <dl class="last docutils">
<dt><a class="reference internal" href="examples.html"><em>Command Line Examples</em></a></dt> <dt><a class="reference internal" href="examples.html"><em>Command Line Examples</em></a></dt>
<dd>Examples of basic commands</dd> <dd>Examples of basic commands</dd>
<dt><a class="reference internal" href="playbooks.html"><em>Playbooks: Ansible for Deployment, Configuration Management, and Orchestration</em></a></dt> <dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
<dd>Learning ansible&#8217;s configuration management language</dd> <dd>Learning ansible&#8217;s configuration management language</dd>
</dl> </dl>
</div> </div>
@ -144,73 +248,16 @@ have a working infrastructure!</p>
</div> </div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Getting Started</a><ul>
<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>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">Ansible</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="patterns.html"
title="next chapter">The Inventory File, Patterns, and Groups</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/gettingstarted.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div> </div>
<script type="text/javascript">$('#searchbox').show(0);</script> <footer class="footer">
</div> <div class="container">
</div> <p class="pull-right"><a href="#">Back to top</a></p>
<div class="clearer"></div> <p>
</div> &copy; Copyright 2012 Michael DeHaan.<br/>
<div class="related"> Last updated on Mar 09, 2012.<br/>
<h3>Navigation</h3> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
<ul> </p>
<li class="right" style="margin-right: 10px"> </div>
<a href="genindex.html" title="General Index" </footer>
>index</a></li>
<li class="right" >
<a href="patterns.html" title="The Inventory File, Patterns, and Groups"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="Ansible"
>previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 09, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body> </body>
</html> </html>

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,40 +9,144 @@
<title>Ansible &mdash; Ansible v0.0.1 documentation</title> <title>Ansible &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" />
<link rel="stylesheet" href="_static/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.0.1', VERSION: '0.0.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: false
}; };
</script> </script>
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<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>
<script type="text/javascript" src="_static/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="_static/bootstrap-scrollspy.js"></script>
<link rel="top" title="Ansible v0.0.1 documentation" href="#" /> <link rel="top" title="Ansible v0.0.1 documentation" href="#" />
<link rel="next" title="Getting Started" href="gettingstarted.html" /> <link rel="next" title="Getting Started" href="gettingstarted.html" />
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
</head> </head>
<body> <body>
<div class="related"> <div class="topbar" data-scrollspy="scrollspy" >
<h3>Navigation</h3> <div class="topbar-inner">
<ul> <div class="container">
<li class="right" style="margin-right: 10px"> <a class="brand" href="#">Ansible</a>
<a href="genindex.html" title="General Index" <ul class="nav">
accesskey="I">index</a></li>
<li class="right" > <li class="dropdown" data-dropdown="dropdown">
<a href="gettingstarted.html" title="Getting Started" <a href="#"
accesskey="N">next</a> |</li> class="dropdown-toggle">Site</a>
<li><a href="#">Ansible v0.0.1 documentation</a> &raquo;</li> <span class="globaltoc"><ul>
</ul> <li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a></li>
</div> <li class="toctree-l1"><a class="reference internal" href="patterns.html">The Inventory File, Patterns, and Groups</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples</a></li>
<div class="document"> <li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a></li>
<div class="documentwrapper"> <li class="toctree-l1"><a class="reference internal" href="YAMLScripts.html">YAML Format</a></li>
<div class="bodywrapper"> <li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
<div class="body"> <li class="toctree-l1"><a class="reference internal" href="api.html">Using the Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="man.html">Man Pages</a></li>
</ul>
</span>
</li>
<li class="dropdown" data-dropdown="dropdown">
<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="#design-goals">Design Goals</a></li>
<li><a class="reference internal" href="#communicate-and-get-involved">Communicate and Get Involved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#contents">Contents</a><ul>
<li><a class="reference internal" href="#about-the-author">About the Author</a></li>
</ul>
</li>
</ul>
</span>
</li>
<li><a href="gettingstarted.html"
title="next chapter">Getting Started &raquo;</a></li>
</ul>
<ul class="nav secondary-nav">
<form class="pull-left" action="search.html" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</ul>
</div>
</div>
</div>
<div class="container">
<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 radically simple deployment, configuration, and command execution framework. <p>Ansible is a radically simple deployment, configuration, and command execution framework.
@ -131,7 +234,7 @@ short &amp; simple, and the source will be blindingly obvious.</p>
<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="playbooks.html">Playbooks: Ansible for Deployment, Configuration Management, and Orchestration</a><ul> <li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a><ul>
<li class="toctree-l2"><a class="reference internal" href="playbooks.html#playbook-example">Playbook Example</a></li> <li class="toctree-l2"><a class="reference internal" href="playbooks.html#playbook-example">Playbook Example</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#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#vars-section">Vars section</a></li>
@ -168,65 +271,16 @@ IBM, Motorola, Red Hat&#8217;s Emerging Technologies Group, Puppet Labs, and rPa
</div> </div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">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>
</li>
<li><a class="reference internal" href="#contents">Contents</a><ul>
<li><a class="reference internal" href="#about-the-author">About the Author</a></li>
</ul>
</li>
</ul>
<h4>Next topic</h4>
<p class="topless"><a href="gettingstarted.html"
title="next chapter">Getting Started</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div> </div>
<script type="text/javascript">$('#searchbox').show(0);</script> <footer class="footer">
</div> <div class="container">
</div> <p class="pull-right"><a href="#">Back to top</a></p>
<div class="clearer"></div> <p>
</div> &copy; Copyright 2012 Michael DeHaan.<br/>
<div class="related"> Last updated on Mar 09, 2012.<br/>
<h3>Navigation</h3> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
<ul> </p>
<li class="right" style="margin-right: 10px"> </div>
<a href="genindex.html" title="General Index" </footer>
>index</a></li>
<li class="right" >
<a href="gettingstarted.html" title="Getting Started"
>next</a> |</li>
<li><a href="#">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 09, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body> </body>
</html> </html>

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,40 +9,139 @@
<title>Man Pages &mdash; Ansible v0.0.1 documentation</title> <title>Man Pages &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" />
<link rel="stylesheet" href="_static/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.0.1', VERSION: '0.0.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: false
}; };
</script> </script>
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<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>
<script type="text/javascript" src="_static/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="_static/bootstrap-scrollspy.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="Using the Python API" href="api.html" /> <link rel="prev" title="Using the Python API" href="api.html" />
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
</head> </head>
<body> <body>
<div class="related"> <div class="topbar" data-scrollspy="scrollspy" >
<h3>Navigation</h3> <div class="topbar-inner">
<ul> <div class="container">
<li class="right" style="margin-right: 10px"> <a class="brand" href="index.html">Ansible</a>
<a href="genindex.html" title="General Index" <ul class="nav">
accesskey="I">index</a></li>
<li class="right" > <li class="dropdown" data-dropdown="dropdown">
<a href="api.html" title="Using the Python API" <a href="index.html"
accesskey="P">previous</a> |</li> class="dropdown-toggle">Site</a>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <span class="globaltoc"><ul class="current">
</ul> <li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a></li>
</div> <li class="toctree-l1"><a class="reference internal" href="patterns.html">The Inventory File, Patterns, and Groups</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples</a></li>
<div class="document"> <li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a></li>
<div class="documentwrapper"> <li class="toctree-l1"><a class="reference internal" href="YAMLScripts.html">YAML Format</a></li>
<div class="bodywrapper"> <li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
<div class="body"> <li class="toctree-l1"><a class="reference internal" href="api.html">Using the Python API</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Man Pages</a></li>
</ul>
</span>
</li>
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">Page</a>
<span class="localtoc"><ul>
<li><a class="reference internal" href="#">Man Pages</a><ul>
<li><a class="reference internal" href="#ansible-1">ansible(1)</a></li>
</ul>
</li>
</ul>
</span>
</li>
<li><a href="api.html"
title="previous chapter">&laquo; Using the Python API</a></li>
</ul>
<ul class="nav secondary-nav">
<form class="pull-left" action="search.html" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</ul>
</div>
</div>
</div>
<div class="container">
<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>Ansible&#8217;s manpage lists available command line options.</p> <p>Ansible&#8217;s manpage lists available command line options.</p>
@ -56,60 +154,16 @@
</div> </div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Man Pages</a><ul>
<li><a class="reference internal" href="#ansible-1">ansible(1)</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="api.html"
title="previous chapter">Using the Python API</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/man.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div> </div>
<script type="text/javascript">$('#searchbox').show(0);</script> <footer class="footer">
</div> <div class="container">
</div> <p class="pull-right"><a href="#">Back to top</a></p>
<div class="clearer"></div> <p>
</div> &copy; Copyright 2012 Michael DeHaan.<br/>
<div class="related"> Last updated on Mar 09, 2012.<br/>
<h3>Navigation</h3> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
<ul> </p>
<li class="right" style="margin-right: 10px"> </div>
<a href="genindex.html" title="General Index" </footer>
>index</a></li>
<li class="right" >
<a href="api.html" title="Using the Python API"
>previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 09, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body> </body>
</html> </html>

View file

@ -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" 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="id373277"></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" 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
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.

View file

@ -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" 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="id303952"></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" 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.
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>

View file

@ -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" 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="id547970"></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" 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
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>

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,44 +9,151 @@
<title>Ansible 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" />
<link rel="stylesheet" href="_static/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.0.1', VERSION: '0.0.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: false
}; };
</script> </script>
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<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>
<script type="text/javascript" src="_static/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="_static/bootstrap-scrollspy.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 Format" href="YAMLScripts.html" /> <link rel="next" title="YAML Format" href="YAMLScripts.html" />
<link rel="prev" title="Command Line Examples" href="examples.html" /> <link rel="prev" title="Command Line Examples" href="examples.html" />
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
</head> </head>
<body> <body>
<div class="related"> <div class="topbar" data-scrollspy="scrollspy" >
<h3>Navigation</h3> <div class="topbar-inner">
<ul> <div class="container">
<li class="right" style="margin-right: 10px"> <a class="brand" href="index.html">Ansible</a>
<a href="genindex.html" title="General Index" <ul class="nav">
accesskey="I">index</a></li>
<li class="right" > <li class="dropdown" data-dropdown="dropdown">
<a href="YAMLScripts.html" title="YAML Format" <a href="index.html"
accesskey="N">next</a> |</li> class="dropdown-toggle">Site</a>
<li class="right" > <span class="globaltoc"><ul class="current">
<a href="examples.html" title="Command Line Examples" <li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a></li>
accesskey="P">previous</a> |</li> <li class="toctree-l1"><a class="reference internal" href="patterns.html">The Inventory File, Patterns, and Groups</a></li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples</a></li>
</ul> <li class="toctree-l1 current"><a class="current reference internal" href="">Ansible Modules</a></li>
</div> <li class="toctree-l1"><a class="reference internal" href="YAMLScripts.html">YAML Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
<div class="document"> <li class="toctree-l1"><a class="reference internal" href="api.html">Using the Python API</a></li>
<div class="documentwrapper"> <li class="toctree-l1"><a class="reference internal" href="man.html">Man Pages</a></li>
<div class="bodywrapper"> </ul>
<div class="body"> </span>
</li>
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">Page</a>
<span class="localtoc"><ul>
<li><a class="reference internal" href="#">Ansible Modules</a><ul>
<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="#writing-your-own-modules">Writing your own modules</a></li>
</ul>
</li>
</ul>
</span>
</li>
<li><a href="examples.html"
title="previous chapter">&laquo; Command Line Examples</a></li>
<li><a href="YAMLScripts.html"
title="next chapter">YAML Format &raquo;</a></li>
</ul>
<ul class="nav secondary-nav">
<form class="pull-left" action="search.html" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="section" id="ansible-modules"> <div class="section" id="ansible-modules">
<h1>Ansible Modules<a class="headerlink" href="#ansible-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>Ansible ships with a number of modules that can be executed directly on remote hosts or through <p>Ansible ships with a number of modules that can be executed directly on remote hosts or through
@ -57,7 +163,7 @@ ansible playbooks.</p>
<dl class="last docutils"> <dl class="last docutils">
<dt><a class="reference internal" href="examples.html"><em>Command Line Examples</em></a></dt> <dt><a class="reference internal" href="examples.html"><em>Command Line Examples</em></a></dt>
<dd>Examples of using modules in /usr/bin/ansible</dd> <dd>Examples of using modules in /usr/bin/ansible</dd>
<dt><a class="reference internal" href="playbooks.html"><em>Playbooks: Ansible for Deployment, Configuration Management, and Orchestration</em></a></dt> <dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
<dd>Examples of using modules with /usr/bin/ansible-playbook</dd> <dd>Examples of using modules with /usr/bin/ansible-playbook</dd>
<dt><a class="reference internal" href="api.html"><em>Using the Python API</em></a></dt> <dt><a class="reference internal" href="api.html"><em>Using the Python API</em></a></dt>
<dd>Examples of using modules with the Python API</dd> <dd>Examples of using modules with the Python API</dd>
@ -192,75 +298,16 @@ the command line, passing them arguments just like they would be passed with ans
</div> </div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<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="#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="#writing-your-own-modules">Writing your own modules</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="examples.html"
title="previous chapter">Command Line Examples</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="YAMLScripts.html"
title="next chapter">YAML Format</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/modules.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div> </div>
<script type="text/javascript">$('#searchbox').show(0);</script> <footer class="footer">
</div> <div class="container">
</div> <p class="pull-right"><a href="#">Back to top</a></p>
<div class="clearer"></div> <p>
</div> &copy; Copyright 2012 Michael DeHaan.<br/>
<div class="related"> Last updated on Mar 09, 2012.<br/>
<h3>Navigation</h3> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
<ul> </p>
<li class="right" style="margin-right: 10px"> </div>
<a href="genindex.html" title="General Index" </footer>
>index</a></li>
<li class="right" >
<a href="YAMLScripts.html" title="YAML Format"
>next</a> |</li>
<li class="right" >
<a href="examples.html" title="Command Line Examples"
>previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 09, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body> </body>
</html> </html>

Binary file not shown.

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,53 +9,152 @@
<title>The Inventory File, Patterns, and Groups &mdash; Ansible v0.0.1 documentation</title> <title>The Inventory File, Patterns, and Groups &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" />
<link rel="stylesheet" href="_static/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.0.1', VERSION: '0.0.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: false
}; };
</script> </script>
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<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>
<script type="text/javascript" src="_static/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="_static/bootstrap-scrollspy.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="Command Line Examples" href="examples.html" /> <link rel="next" title="Command Line Examples" href="examples.html" />
<link rel="prev" title="Getting Started" href="gettingstarted.html" /> <link rel="prev" title="Getting Started" href="gettingstarted.html" />
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
</head> </head>
<body> <body>
<div class="related"> <div class="topbar" data-scrollspy="scrollspy" >
<h3>Navigation</h3> <div class="topbar-inner">
<ul> <div class="container">
<li class="right" style="margin-right: 10px"> <a class="brand" href="index.html">Ansible</a>
<a href="genindex.html" title="General Index" <ul class="nav">
accesskey="I">index</a></li>
<li class="right" > <li class="dropdown" data-dropdown="dropdown">
<a href="examples.html" title="Command Line Examples" <a href="index.html"
accesskey="N">next</a> |</li> class="dropdown-toggle">Site</a>
<li class="right" > <span class="globaltoc"><ul class="current">
<a href="gettingstarted.html" title="Getting Started" <li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a></li>
accesskey="P">previous</a> |</li> <li class="toctree-l1 current"><a class="current reference internal" href="">The Inventory File, Patterns, and Groups</a></li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples</a></li>
</ul> <li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a></li>
</div> <li class="toctree-l1"><a class="reference internal" href="YAMLScripts.html">YAML Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
<div class="document"> <li class="toctree-l1"><a class="reference internal" href="api.html">Using the Python API</a></li>
<div class="documentwrapper"> <li class="toctree-l1"><a class="reference internal" href="man.html">Man Pages</a></li>
<div class="bodywrapper"> </ul>
<div class="body"> </span>
</li>
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">Page</a>
<span class="localtoc"><ul>
<li><a class="reference internal" href="#">The Inventory File, Patterns, and Groups</a><ul>
<li><a class="reference internal" href="#inventory-file-format">Inventory File Format</a></li>
<li><a class="reference internal" href="#selecting-targets">Selecting Targets</a></li>
</ul>
</li>
</ul>
</span>
</li>
<li><a href="gettingstarted.html"
title="previous chapter">&laquo; Getting Started</a></li>
<li><a href="examples.html"
title="next chapter">Command Line Examples &raquo;</a></li>
</ul>
<ul class="nav secondary-nav">
<form class="pull-left" action="search.html" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="section" id="the-inventory-file-patterns-and-groups"> <div class="section" id="the-inventory-file-patterns-and-groups">
<h1>The Inventory File, Patterns, and Groups<a class="headerlink" href="#the-inventory-file-patterns-and-groups" title="Permalink to this headline"></a></h1> <span id="patterns"></span><h1>The Inventory File, Patterns, and Groups<a class="headerlink" href="#the-inventory-file-patterns-and-groups" title="Permalink to this headline"></a></h1>
<p>How to select hosts you wish to manage</p> <p>How to select hosts you wish to manage</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>Command Line Examples</em></a></dt> <dt><a class="reference internal" href="examples.html"><em>Command Line Examples</em></a></dt>
<dd>Examples of basic commands</dd> <dd>Examples of basic commands</dd>
<dt><a class="reference internal" href="playbooks.html"><em>Playbooks: Ansible for Deployment, Configuration Management, and Orchestration</em></a></dt> <dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
<dd>Learning ansible&#8217;s configuration management language</dd> <dd>Learning ansible&#8217;s configuration management language</dd>
</dl> </dl>
</div> </div>
@ -88,15 +186,16 @@ which defaults to /etc/ansible/hosts, and looks like this:</p>
<div class="highlight-python"><pre>one.example.com <div class="highlight-python"><pre>one.example.com
one.example.com:two.example.com</pre> one.example.com:two.example.com</pre>
</div> </div>
<p>The following patterns address one or more groups, which are denoted with the bracket <p>The following patterns address one or more groups, which are denoted
headers in the inventory file:</p> with the bracket headers in the inventory file:</p>
<div class="highlight-python"><pre>webservers <div class="highlight-python"><pre>webservers
webservers:dbservers</pre> webservers:dbservers</pre>
</div> </div>
<p>Individual hosts, but not groups, can also be referenced using wildcards:</p> <p>Individual hosts, but not groups, can also be referenced using
<blockquote> wildcards:</p>
<div><a href="#id1"><span class="problematic" id="id2">*</span></a>.example.com <div class="highlight-python"><pre>*.example.com
<a href="#id3"><span class="problematic" id="id4">*</span></a>.com</div></blockquote> *.com</pre>
</div>
<p>It&#8217;s also ok to mix wildcard patterns and groups at the same time:</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 class="highlight-python"><pre>one*.com:dbservers</pre>
</div> </div>
@ -105,67 +204,16 @@ webservers:dbservers</pre>
</div> </div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">The Inventory File, Patterns, and Groups</a><ul>
<li><a class="reference internal" href="#inventory-file-format">Inventory File Format</a></li>
<li><a class="reference internal" href="#selecting-targets">Selecting Targets</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="gettingstarted.html"
title="previous chapter">Getting Started</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="examples.html"
title="next chapter">Command Line Examples</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/patterns.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div> </div>
<script type="text/javascript">$('#searchbox').show(0);</script> <footer class="footer">
</div> <div class="container">
</div> <p class="pull-right"><a href="#">Back to top</a></p>
<div class="clearer"></div> <p>
</div> &copy; Copyright 2012 Michael DeHaan.<br/>
<div class="related"> Last updated on Mar 09, 2012.<br/>
<h3>Navigation</h3> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
<ul> </p>
<li class="right" style="margin-right: 10px"> </div>
<a href="genindex.html" title="General Index" </footer>
>index</a></li>
<li class="right" >
<a href="examples.html" title="Command Line Examples"
>next</a> |</li>
<li class="right" >
<a href="gettingstarted.html" title="Getting Started"
>previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 09, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body> </body>
</html> </html>

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -7,49 +6,157 @@
<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>Playbooks: Ansible for Deployment, Configuration Management, and Orchestration &mdash; Ansible v0.0.1 documentation</title> <title>Playbooks &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" />
<link rel="stylesheet" href="_static/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.0.1', VERSION: '0.0.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: false
}; };
</script> </script>
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<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>
<script type="text/javascript" src="_static/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="_static/bootstrap-scrollspy.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="Using the Python API" href="api.html" /> <link rel="next" title="Using the Python API" href="api.html" />
<link rel="prev" title="YAML Format" href="YAMLScripts.html" /> <link rel="prev" title="YAML Format" href="YAMLScripts.html" />
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
</head> </head>
<body> <body>
<div class="related"> <div class="topbar" data-scrollspy="scrollspy" >
<h3>Navigation</h3> <div class="topbar-inner">
<ul> <div class="container">
<li class="right" style="margin-right: 10px"> <a class="brand" href="index.html">Ansible</a>
<a href="genindex.html" title="General Index" <ul class="nav">
accesskey="I">index</a></li>
<li class="right" > <li class="dropdown" data-dropdown="dropdown">
<a href="api.html" title="Using the Python API" <a href="index.html"
accesskey="N">next</a> |</li> class="dropdown-toggle">Site</a>
<li class="right" > <span class="globaltoc"><ul class="current">
<a href="YAMLScripts.html" title="YAML Format" <li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a></li>
accesskey="P">previous</a> |</li> <li class="toctree-l1"><a class="reference internal" href="patterns.html">The Inventory File, Patterns, and Groups</a></li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples</a></li>
</ul> <li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a></li>
</div> <li class="toctree-l1"><a class="reference internal" href="YAMLScripts.html">YAML Format</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Playbooks</a></li>
<div class="document"> <li class="toctree-l1"><a class="reference internal" href="api.html">Using the Python API</a></li>
<div class="documentwrapper"> <li class="toctree-l1"><a class="reference internal" href="man.html">Man Pages</a></li>
<div class="bodywrapper"> </ul>
<div class="body"> </span>
</li>
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">Page</a>
<span class="localtoc"><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-action">Task name and 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="#using-includes-to-assign-classes-of-systems">Using Includes To Assign Classes of Systems</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>
</span>
</li>
<div class="section" id="playbooks-ansible-for-deployment-configuration-management-and-orchestration"> <li><a href="YAMLScripts.html"
<h1>Playbooks: Ansible for Deployment, Configuration Management, and Orchestration<a class="headerlink" href="#playbooks-ansible-for-deployment-configuration-management-and-orchestration" title="Permalink to this headline"></a></h1> title="previous chapter">&laquo; YAML Format</a></li>
<li><a href="api.html"
title="next chapter">Using the Python API &raquo;</a></li>
</ul>
<ul class="nav secondary-nav">
<form class="pull-left" action="search.html" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="section" id="playbooks">
<h1>Playbooks<a class="headerlink" href="#playbooks" title="Permalink to this headline"></a></h1>
<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">
@ -61,16 +168,23 @@
<dd>Learn about how to select hosts</dd> <dd>Learn about how to select hosts</dd>
</dl> </dl>
</div> </div>
<p>Playbooks are a completely different way to use ansible and are particularly awesome.</p> <p>Playbooks are a completely different way to use ansible and are
<p>They are the basis for a really simple configuration management and multi-machine deployment system, unlike any that already exist, and one that is very well suited to deploying complex applications.</p> particularly awesome.</p>
<p>While you might run the main /usr/bin/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>They are the basis for a really simple configuration management and
multi-machine deployment system, unlike any that already exist, and
one that is very well suited to deploying complex applications.</p>
<p>While you might run the main /usr/bin/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>
<div class="section" id="playbook-example"> <div class="section" id="playbook-example">
<h2>Playbook Example<a class="headerlink" href="#playbook-example" title="Permalink to this headline"></a></h2> <h2>Playbook Example<a class="headerlink" href="#playbook-example" title="Permalink to this headline"></a></h2>
<p>Playbooks are expressed in YAML format and have a minimum of syntax. Each playbook is composed <p>Playbooks are expressed in YAML format and have a minimum of syntax.
of one or more &#8216;plays&#8217; in a list. By composing a playbook of multiple &#8216;plays&#8217;, it is possible Each playbook is composed of one or more &#8216;plays&#8217; in a list. By
to orchestrate multi-machine deployments, running certain steps on all machines in composing a playbook of multiple &#8216;plays&#8217;, it is possible to
the webservers group, then certain steps on the database server group, then more commands orchestrate multi-machine deployments, running certain steps on all
back on the webservers group, etc:</p> machines in the webservers group, then certain steps on the database
server group, then more commands back on the webservers group, etc:</p>
<div class="highlight-python"><pre>--- <div class="highlight-python"><pre>---
- hosts: webservers - hosts: webservers
vars: vars:
@ -91,19 +205,25 @@ back on the webservers group, etc:</p>
</div> </div>
<div class="section" id="hosts-line"> <div class="section" id="hosts-line">
<h2>Hosts line<a class="headerlink" href="#hosts-line" title="Permalink to this headline"></a></h2> <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, asdescribed in the &#8216;patterns&#8217; documentation. This is just like the first parameter to /usr/bin/ansible.</p> <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>
documentation. This is just like the first parameter to
<cite>/usr/bin/ansible</cite>.</p>
</div> </div>
<div class="section" id="vars-section"> <div class="section" id="vars-section">
<h2>Vars section<a class="headerlink" href="#vars-section" title="Permalink to this headline"></a></h2> <h2>Vars section<a class="headerlink" href="#vars-section" title="Permalink to this headline"></a></h2>
<p>A list of variables and values that can be used in the plays. These can be used in templates <p>A list of variables and values that can be used in the plays. These
or &#8216;action&#8217; lines and are dereferenced using <tt class="docutils literal"><span class="pre">`jinja2`</span></tt> syntax like this:</p> can be used in templates or &#8216;action&#8217; lines and are dereferenced using
<div class="highlight-python"><pre>{{ varname }}</pre> <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> </div>
<p>Further, if there are discovered variables about the system (say, if facter or ohai were <p>Further, if there are discovered variables about the system (say, if
installed) these variables bubble up back into the playbook, and can be used on each facter or ohai were installed) these variables bubble up back into the
system just like explicitly set variables. Facter variables are prefixed with &#8216;<a href="#id1"><span class="problematic" id="id2">facter_</span></a>&#8216; playbook, and can be used on each system just like explicitly set
and Ohai variables are prefixed with &#8216;<a href="#id3"><span class="problematic" id="id4">ohai_</span></a>&#8216;. So for instance, if I wanted to write the variables. Facter variables are prefixed with <tt class="docutils literal"><span class="pre">facter_</span></tt> and Ohai
hostname into the /etc/motd file, I could say:</p> variables are prefixed with <tt class="docutils literal"><span class="pre">ohai_</span></tt>. So for instance, if I wanted
to write the hostname into the /etc/motd file, I could say:</p>
<div class="highlight-python"><pre>- name: write the motd <div class="highlight-python"><pre>- name: write the motd
- action: template src=/srv/templates/motd.j2 dest=/etc/motd</pre> - action: template src=/srv/templates/motd.j2 dest=/etc/motd</pre>
</div> </div>
@ -114,61 +234,72 @@ hostname into the /etc/motd file, I could say:</p>
</div> </div>
<div class="section" id="tasks-list"> <div class="section" id="tasks-list">
<h2>Tasks list<a class="headerlink" href="#tasks-list" title="Permalink to this headline"></a></h2> <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 <p>Each play contains a list of tasks. Tasks are executed in order, one
all machines matched by the play&#8217;s host pattern, before moving on to the next task.</p> at a time, against all machines matched by the play&#8217;s host pattern,
<p>Hosts with failed tasks are taken out of the rotation for the entire playbook. If things fail, before moving on to the next task.</p>
simply correct the playbook file and rerun.</p> <p>Hosts with failed tasks are taken out of the rotation for the entire
<p>Modules other than command are idempotent, meaning if you run them again, they will make the playbook. If things fail, simply correct the playbook file and rerun.</p>
changes they are told to make to bring the system to the desired state.</p> <p>Modules other than command are idempotent, meaning if you run them
again, they will make the changes they are told to make to bring the
system to the desired state.</p>
</div> </div>
<div class="section" id="task-name-and-action"> <div class="section" id="task-name-and-action">
<h2>Task name and action<a class="headerlink" href="#task-name-and-action" title="Permalink to this headline"></a></h2> <h2>Task name and action<a class="headerlink" href="#task-name-and-action" title="Permalink to this headline"></a></h2>
<p>Every task must have a name, which is included in the output from running the playbook.</p> <p>Every task must have a name, which is included in the output from
<p>The action line is the name of an ansible module followed by parameters. Usually these running the playbook.</p>
are expressed in key=value form, except for the command module, which looks just like a Linux/Unix <p>The action line is the name of an ansible module followed by
command line. See the module documentation for more info.</p> parameters. Usually these are expressed in <tt class="docutils literal"><span class="pre">key=value</span></tt> form, except
<p>Variables, as mentioned above, can be used in action lines. So if, hypothetically, you wanted for the command module, which looks just like a Linux/Unix command
to make a directory on each system named after the hostname ... yeah, that&#8217;s I know silly ... you could line. See the module documentation for more info.</p>
do it like so:</p> <p>Variables, as mentioned above, can be used in action lines. So if,
hypothetically, you wanted to make a directory on each system named
after the hostname ... yeah, that&#8217;s I know silly ... you could do it
like so:</p>
<div class="highlight-python"><pre>- name: make a directory <div class="highlight-python"><pre>- name: make a directory
- action: mkdir /tmp/{{ facter_hostname }}</pre> - action: mkdir /tmp/{{ facter_hostname }}</pre>
</div> </div>
</div> </div>
<div class="section" id="notify-statements"> <div class="section" id="notify-statements">
<h2>Notify statements<a class="headerlink" href="#notify-statements" title="Permalink to this headline"></a></h2> <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 <p>Nearly all modules are written to be &#8216;idempotent&#8217; and can signal when
on the remote system. If a notify statement is used, the named handler will be run against they have affected a change on the remote system. If a notify
each system where a change was effected, but NOT on systems where no change occurred. This happens statement is used, the named handler will be run against each system
after all of the tasks are run. For example, if notifying Apache and potentially replacing lots of where a change was effected, but NOT on systems where no change
configuration files, you could have Apache restart just once, at the end of a run. If you need occurred. This happens after all of the tasks are run. For example,
Apache restarted in the middle of a run, you could just make a task for it, no harm done. Notifiers if notifying Apache and potentially replacing lots of configuration
are optional.</p> files, you could have Apache restart just once, at the end of a run.
If you need Apache restarted in the middle of a run, you could just
make a task for it, no harm done. Notifiers are optional.</p>
</div> </div>
<div class="section" id="handlers"> <div class="section" id="handlers">
<h2>Handlers<a class="headerlink" href="#handlers" title="Permalink to this headline"></a></h2> <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 <p>Handlers are lists of tasks, not really any different from regular
by name. Handlers are what notifiers notify. If nothing notifies a handler, it will not run. tasks, that are referenced by name. Handlers are what notifiers
Regardless of how many things notify a handler, it will run only once, after all of the tasks notify. If nothing notifies a handler, it will not run. Regardless
complete in a particular play.</p> of how many things notify a handler, it will run only once, after all
of the tasks complete in a particular play.</p>
</div> </div>
<div class="section" id="includes"> <div class="section" id="includes">
<h2>Includes<a class="headerlink" href="#includes" title="Permalink to this headline"></a></h2> <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 <p>Not all tasks have to be listed directly in the main file. An include
a list of tasks (in YAML) as well, optionally passing extra variables into the file. file can contain a list of tasks (in YAML) as well, optionally passing
Variables passed in can be deferenced like this (assume a variable named &#8216;user&#8217;):</p> extra variables into the file. Variables passed in can be deferenced
<div class="highlight-python"><pre>{{ user }}</pre> 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> </div>
<p>For instance, if deploying multiple wordpress instances, I could contain all of my tasks <p>For instance, if deploying multiple wordpress instances, I could
in a wordpress.yml file, and use it like so:</p> contain all of my tasks in a wordpress.yml file, and use it like so:</p>
<div class="highlight-python"><pre>- tasks: <div class="highlight-python"><pre>- tasks:
- include: wordpress.yml user=timmy - include: wordpress.yml user=timmy
- include: wordpress.yml user=alice - include: wordpress.yml user=alice
- include: wordpress.yml user=bob</pre> - include: wordpress.yml user=bob</pre>
</div> </div>
<p>In addition to the explicitly passed in parameters, all variables from the vars section <p>In addition to the explicitly passed in parameters, all variables from
are also available.</p> the vars section are also available.</p>
<p>The format of an included list of tasks or handlers looks just like a flat list of tasks. Here <p>The format of an included list of tasks or handlers looks just like a
is an example of what base.yml might look like:</p> flat list of tasks. Here is an example of what base.yml might look
like:</p>
<div class="highlight-python"><pre>--- <div class="highlight-python"><pre>---
- name: no selinux - name: no selinux
action: command /usr/sbin/setenforce 0 action: command /usr/sbin/setenforce 0
@ -177,16 +308,18 @@ is an example of what base.yml might look like:</p>
- name: this is just to show variables work here, favcolor={{ favcolor }} - name: this is just to show variables work here, favcolor={{ favcolor }}
action: command /bin/true</pre> action: command /bin/true</pre>
</div> </div>
<p>As you can see above, variables in include files work just like they do in the main file. <p>As you can see above, variables in include files work just like they
Including a variable in the name of a task is a contrived example, you could also do in the main file. Including a variable in the name of a task is a
pass them to the action command line or use them inside a template file.</p> contrived example, you could also pass them to the action command line
<p>Note that include statements are only usable from the top level playbook file. or use them inside a template file.</p>
At this time, includes can not include other includes.</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> </div>
<div class="section" id="using-includes-to-assign-classes-of-systems"> <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> <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>
<p>Include files are best used to reuse logic between playbooks. You could imagine <p>Include files are best used to reuse logic between playbooks. You
a playbook describing your entire infrastructure like this:</p> could imagine a playbook describing your entire infrastructure like
this:</p>
<div class="highlight-python"><pre>--- <div class="highlight-python"><pre>---
- hosts: atlanta-webservers - hosts: atlanta-webservers
vars: vars:
@ -205,13 +338,14 @@ a playbook describing your entire infrastructure like this:</p>
handlers: handlers:
- include: generic-handlers.yml</pre> - include: generic-handlers.yml</pre>
</div> </div>
<p>There is one (or more) play defined for each group of systems, and each play maps <p>There is one (or more) play defined for each group of systems, and
each group includes one or more &#8216;class definitions&#8217; telling the systems what they each play maps each group includes one or more &#8216;class definitions&#8217;
are supposed to do or be.</p> telling the systems what they are supposed to do or be.</p>
<p>Using a common handlers file could allow one task in &#8216;webservers&#8217; to define &#8216;restart apache&#8217;, <p>Using a common handlers file could allow one task in &#8216;webservers&#8217; to
and it could be reused between multiple plays.</p> define &#8216;restart apache&#8217;, and it could be reused between multiple
<p>Variables like &#8216;database&#8217; above can be used in templates referenced from the plays.</p>
configuration file to generate machine specific variables.</p> <p>Variables like &#8216;database&#8217; above can be used in templates referenced
from the configuration file to generate machine specific variables.</p>
</div> </div>
<div class="section" id="asynchronous-actions-and-polling"> <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> <h2>Asynchronous Actions and Polling<a class="headerlink" href="#asynchronous-actions-and-polling" title="Permalink to this headline"></a></h2>
@ -226,76 +360,16 @@ configuration file to generate machine specific variables.</p>
</div> </div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Playbooks: Ansible for Deployment, Configuration Management, and Orchestration</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-action">Task name and 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="#using-includes-to-assign-classes-of-systems">Using Includes To Assign Classes of Systems</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>
<p class="topless"><a href="YAMLScripts.html"
title="previous chapter">YAML Format</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="api.html"
title="next chapter">Using the Python API</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/playbooks.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div> </div>
<script type="text/javascript">$('#searchbox').show(0);</script> <footer class="footer">
</div> <div class="container">
</div> <p class="pull-right"><a href="#">Back to top</a></p>
<div class="clearer"></div> <p>
</div> &copy; Copyright 2012 Michael DeHaan.<br/>
<div class="related"> Last updated on Mar 09, 2012.<br/>
<h3>Navigation</h3> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
<ul> </p>
<li class="right" style="margin-right: 10px"> </div>
<a href="genindex.html" title="General Index" </footer>
>index</a></li>
<li class="right" >
<a href="api.html" title="Using the Python API"
>next</a> |</li>
<li class="right" >
<a href="YAMLScripts.html" title="YAML Format"
>previous</a> |</li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 09, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body> </body>
</html> </html>

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,42 +9,131 @@
<title>Search &mdash; Ansible v0.0.1 documentation</title> <title>Search &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" />
<link rel="stylesheet" href="_static/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.0.1', VERSION: '0.0.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: false
}; };
</script> </script>
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<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>
<script type="text/javascript" src="_static/searchtools.js"></script> <script type="text/javascript" src="_static/searchtools.js"></script>
<script type="text/javascript" src="_static/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="_static/bootstrap-scrollspy.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" />
<script type="text/javascript"> <script type="text/javascript">
jQuery(function() { Search.loadIndex("searchindex.js"); }); jQuery(function() { Search.loadIndex("searchindex.js"); });
</script> </script>
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($span, minLevel) {
var $tocList = $("<ul/>").attr('class', "dropdown-menu"),
findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 10 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
// Add list element.
$tocList.append($("<li/>").append($item));
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
// Start construction and return.
findA($span);
// Wipe out old list and patch in new one.
return $span.empty("ul").append($tocList);
};
$(document).ready(function () {
// Patch the global and local TOC's to be bootstrap-compliant.
patchToc($("span.globaltoc"), 1);
patchToc($("span.localtoc"), 2);
// Activate.
$('#topbar').dropdown();
});
}());
</script>
</head> </head>
<body> <body>
<div class="related"> <div class="topbar" data-scrollspy="scrollspy" >
<h3>Navigation</h3> <div class="topbar-inner">
<ul> <div class="container">
<li class="right" style="margin-right: 10px"> <a class="brand" href="index.html">Ansible</a>
<a href="genindex.html" title="General Index" <ul class="nav">
accesskey="I">index</a></li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li> <li class="dropdown" data-dropdown="dropdown">
</ul> <a href="index.html"
</div> class="dropdown-toggle">Site</a>
<span class="globaltoc"><ul>
<div class="document"> <li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a></li>
<div class="documentwrapper"> <li class="toctree-l1"><a class="reference internal" href="patterns.html">The Inventory File, Patterns, and Groups</a></li>
<div class="bodywrapper"> <li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples</a></li>
<div class="body"> <li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="YAMLScripts.html">YAML Format</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">Using the Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="man.html">Man Pages</a></li>
</ul>
</span>
</li>
<li class="dropdown" data-dropdown="dropdown">
<a href="#"
class="dropdown-toggle">Page</a>
<span class="localtoc"></span>
</li>
</ul>
<ul class="nav secondary-nav">
</ul>
</div>
</div>
</div>
<div class="container">
<h1 id="search-documentation">Search</h1> <h1 id="search-documentation">Search</h1>
<div id="fallback" class="admonition warning"> <div id="fallback" class="admonition warning">
<script type="text/javascript">$('#fallback').hide();</script> <script type="text/javascript">$('#fallback').hide();</script>
@ -70,28 +158,16 @@
</div> </div>
</div> </div>
</div> <footer class="footer">
</div> <div class="container">
<div class="sphinxsidebar"> <p class="pull-right"><a href="#">Back to top</a></p>
<div class="sphinxsidebarwrapper"> <p>
</div> &copy; Copyright 2012 Michael DeHaan.<br/>
</div> Last updated on Mar 09, 2012.<br/>
<div class="clearer"></div> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
</div> </p>
<div class="related"> </div>
<h3>Navigation</h3> </footer>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li><a href="index.html">Ansible v0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2012 Michael DeHaan.
Last updated on Mar 09, 2012.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

View file

@ -1,3 +1,5 @@
.. _patterns:
The Inventory File, Patterns, and Groups The Inventory File, Patterns, and Groups
======================================== ========================================
@ -43,16 +45,17 @@ It is also possible to address specific hosts::
one.example.com:two.example.com one.example.com:two.example.com
The following patterns address one or more groups, which are denoted with the bracket The following patterns address one or more groups, which are denoted
headers in the inventory file:: with the bracket headers in the inventory file::
webservers webservers
webservers:dbservers webservers:dbservers
Individual hosts, but not groups, can also be referenced using wildcards: Individual hosts, but not groups, can also be referenced using
wildcards::
*.example.com *.example.com
*.com *.com
It's also ok to mix wildcard patterns and groups at the same time:: It's also ok to mix wildcard patterns and groups at the same time::

View file

@ -1,5 +1,5 @@
Playbooks: Ansible for Deployment, Configuration Management, and Orchestration Playbooks
============================================================================== =========
.. seealso:: .. seealso::
@ -11,21 +11,28 @@ Playbooks: Ansible for Deployment, Configuration Management, and Orchestration
Learn about how to select hosts Learn about how to select hosts
Playbooks are a completely different way to use ansible and are particularly awesome. Playbooks are a completely different way to use ansible and are
particularly awesome.
They are the basis for a really simple configuration management and multi-machine deployment system, unlike any that already exist, and one that is very well suited to deploying complex applications. They are the basis for a really simple configuration management and
multi-machine deployment system, unlike any that already exist, and
one that is very well suited to deploying complex applications.
While you might run the main /usr/bin/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. While you might run the main /usr/bin/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.
Playbook Example Playbook Example
```````````````` ````````````````
Playbooks are expressed in YAML format and have a minimum of syntax. Each playbook is composed Playbooks are expressed in YAML format and have a minimum of syntax.
of one or more 'plays' in a list. By composing a playbook of multiple 'plays', it is possible Each playbook is composed of one or more 'plays' in a list. By
to orchestrate multi-machine deployments, running certain steps on all machines in composing a playbook of multiple 'plays', it is possible to
the webservers group, then certain steps on the database server group, then more commands orchestrate multi-machine deployments, running certain steps on all
back on the webservers group, etc:: machines in the webservers group, then certain steps on the database
server group, then more commands back on the webservers group, etc::
--- ---
- hosts: webservers - hosts: webservers
@ -47,21 +54,26 @@ back on the webservers group, etc::
Hosts line Hosts line
`````````` ``````````
The hosts line is a list of one or more groups or host patterns, seperated by colons, asdescribed in the 'patterns' documentation. This is just like the first parameter to /usr/bin/ansible. The hosts line is a list of one or more groups or host patterns,
seperated by colons, as described in the :ref:`patterns`
documentation. This is just like the first parameter to
`/usr/bin/ansible`.
Vars section Vars section
```````````` ````````````
A list of variables and values that can be used in the plays. These can be used in templates A list of variables and values that can be used in the plays. These
or 'action' lines and are dereferenced using ```jinja2``` syntax like this:: can be used in templates or 'action' lines and are dereferenced using
`jinja2` syntax like this::
{{ varname }} {{ varname }}
Further, if there are discovered variables about the system (say, if facter or ohai were Further, if there are discovered variables about the system (say, if
installed) these variables bubble up back into the playbook, and can be used on each facter or ohai were installed) these variables bubble up back into the
system just like explicitly set variables. Facter variables are prefixed with 'facter_' playbook, and can be used on each system just like explicitly set
and Ohai variables are prefixed with 'ohai_'. So for instance, if I wanted to write the variables. Facter variables are prefixed with ``facter_`` and Ohai
hostname into the /etc/motd file, I could say:: variables are prefixed with ``ohai_``. So for instance, if I wanted
to write the hostname into the /etc/motd file, I could say::
- name: write the motd - name: write the motd
- action: template src=/srv/templates/motd.j2 dest=/etc/motd - action: template src=/srv/templates/motd.j2 dest=/etc/motd
@ -75,27 +87,32 @@ But we're getting ahead of ourselves. Let's talk about tasks.
Tasks list Tasks list
`````````` ``````````
Each play contains a list of tasks. Tasks are executed in order, one at a time, against Each play contains a list of tasks. Tasks are executed in order, one
all machines matched by the play's host pattern, before moving on to the next task. at a time, against all machines matched by the play's host pattern,
before moving on to the next task.
Hosts with failed tasks are taken out of the rotation for the entire playbook. If things fail, Hosts with failed tasks are taken out of the rotation for the entire
simply correct the playbook file and rerun. playbook. If things fail, simply correct the playbook file and rerun.
Modules other than command are idempotent, meaning if you run them again, they will make the Modules other than command are idempotent, meaning if you run them
changes they are told to make to bring the system to the desired state. again, they will make the changes they are told to make to bring the
system to the desired state.
Task name and action Task name and action
````````````````````` `````````````````````
Every task must have a name, which is included in the output from running the playbook. Every task must have a name, which is included in the output from
running the playbook.
The action line is the name of an ansible module followed by parameters. Usually these The action line is the name of an ansible module followed by
are expressed in key=value form, except for the command module, which looks just like a Linux/Unix parameters. Usually these are expressed in ``key=value`` form, except
command line. See the module documentation for more info. for the command module, which looks just like a Linux/Unix command
line. See the module documentation for more info.
Variables, as mentioned above, can be used in action lines. So if, hypothetically, you wanted Variables, as mentioned above, can be used in action lines. So if,
to make a directory on each system named after the hostname ... yeah, that's I know silly ... you could hypothetically, you wanted to make a directory on each system named
do it like so:: after the hostname ... yeah, that's I know silly ... you could do it
like so::
- name: make a directory - name: make a directory
- action: mkdir /tmp/{{ facter_hostname }} - action: mkdir /tmp/{{ facter_hostname }}
@ -103,44 +120,49 @@ do it like so::
Notify statements Notify statements
````````````````` `````````````````
Nearly all modules are written to be 'idempotent' and can signal when they have affected a change Nearly all modules are written to be 'idempotent' and can signal when
on the remote system. If a notify statement is used, the named handler will be run against they have affected a change on the remote system. If a notify
each system where a change was effected, but NOT on systems where no change occurred. This happens statement is used, the named handler will be run against each system
after all of the tasks are run. For example, if notifying Apache and potentially replacing lots of where a change was effected, but NOT on systems where no change
configuration files, you could have Apache restart just once, at the end of a run. If you need occurred. This happens after all of the tasks are run. For example,
Apache restarted in the middle of a run, you could just make a task for it, no harm done. Notifiers if notifying Apache and potentially replacing lots of configuration
are optional. files, you could have Apache restart just once, at the end of a run.
If you need Apache restarted in the middle of a run, you could just
make a task for it, no harm done. Notifiers are optional.
Handlers Handlers
```````` ````````
Handlers are lists of tasks, not really any different from regular tasks, that are referenced Handlers are lists of tasks, not really any different from regular
by name. Handlers are what notifiers notify. If nothing notifies a handler, it will not run. tasks, that are referenced by name. Handlers are what notifiers
Regardless of how many things notify a handler, it will run only once, after all of the tasks notify. If nothing notifies a handler, it will not run. Regardless
complete in a particular play. of how many things notify a handler, it will run only once, after all
of the tasks complete in a particular play.
Includes Includes
```````` ````````
Not all tasks have to be listed directly in the main file. An include file can contain Not all tasks have to be listed directly in the main file. An include
a list of tasks (in YAML) as well, optionally passing extra variables into the file. file can contain a list of tasks (in YAML) as well, optionally passing
Variables passed in can be deferenced like this (assume a variable named 'user'):: extra variables into the file. Variables passed in can be deferenced
like this (assume a variable named 'user')::
{{ user }} {{ user }}
For instance, if deploying multiple wordpress instances, I could contain all of my tasks For instance, if deploying multiple wordpress instances, I could
in a wordpress.yml file, and use it like so:: contain all of my tasks in a wordpress.yml file, and use it like so::
- tasks: - tasks:
- include: wordpress.yml user=timmy - include: wordpress.yml user=timmy
- include: wordpress.yml user=alice - include: wordpress.yml user=alice
- include: wordpress.yml user=bob - include: wordpress.yml user=bob
In addition to the explicitly passed in parameters, all variables from the vars section In addition to the explicitly passed in parameters, all variables from
are also available. the vars section are also available.
The format of an included list of tasks or handlers looks just like a flat list of tasks. Here The format of an included list of tasks or handlers looks just like a
is an example of what base.yml might look like:: flat list of tasks. Here is an example of what base.yml might look
like::
--- ---
- name: no selinux - name: no selinux
@ -150,18 +172,20 @@ is an example of what base.yml might look like::
- name: this is just to show variables work here, favcolor={{ favcolor }} - name: this is just to show variables work here, favcolor={{ favcolor }}
action: command /bin/true action: command /bin/true
As you can see above, variables in include files work just like they do in the main file. As you can see above, variables in include files work just like they
Including a variable in the name of a task is a contrived example, you could also do in the main file. Including a variable in the name of a task is a
pass them to the action command line or use them inside a template file. contrived example, you could also pass them to the action command line
or use them inside a template file.
Note that include statements are only usable from the top level playbook file. Note that include statements are only usable from the top level
At this time, includes can not include other includes. playbook file. At this time, includes can not include other includes.
Using Includes To Assign Classes of Systems Using Includes To Assign Classes of Systems
``````````````````````````````````````````` ```````````````````````````````````````````
Include files are best used to reuse logic between playbooks. You could imagine Include files are best used to reuse logic between playbooks. You
a playbook describing your entire infrastructure like this:: could imagine a playbook describing your entire infrastructure like
this::
--- ---
- hosts: atlanta-webservers - hosts: atlanta-webservers
@ -181,21 +205,23 @@ a playbook describing your entire infrastructure like this::
handlers: handlers:
- include: generic-handlers.yml - include: generic-handlers.yml
There is one (or more) play defined for each group of systems, and each play maps There is one (or more) play defined for each group of systems, and
each group includes one or more 'class definitions' telling the systems what they each play maps each group includes one or more 'class definitions'
are supposed to do or be. telling the systems what they are supposed to do or be.
Using a common handlers file could allow one task in 'webservers' to define 'restart apache', Using a common handlers file could allow one task in 'webservers' to
and it could be reused between multiple plays. define 'restart apache', and it could be reused between multiple
plays.
Variables like 'database' above can be used in templates referenced from the Variables like 'database' above can be used in templates referenced
configuration file to generate machine specific variables. from the configuration file to generate machine specific variables.
Asynchronous Actions and Polling Asynchronous Actions and Polling
```````````````````````````````` ````````````````````````````````
(Information on this feature is pending) (Information on this feature is pending)
Executing A Playbook Executing A Playbook
```````````````````` ````````````````````