add documentation stub for apt, and fix agreement issues caused by Tim's doc ref link fixup.
This commit is contained in:
parent
d584cdf501
commit
1f565c3d76
19 changed files with 112 additions and 65 deletions
|
@ -245,8 +245,8 @@ languages:
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -79,6 +79,14 @@ div.sphinxsidebar input {
|
|||
font-size: 1em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar input[type="text"] {
|
||||
width: 170px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar input[type="submit"] {
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
|
@ -236,7 +244,6 @@ img.align-center, .figure.align-center, object.align-center {
|
|||
}
|
||||
|
||||
.align-center {
|
||||
clear: both;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
|
|
@ -363,10 +363,13 @@ var Search = {
|
|||
var fullname = (prefix ? prefix + '.' : '') + name;
|
||||
if (fullname.toLowerCase().indexOf(object) > -1) {
|
||||
match = objects[prefix][name];
|
||||
descr = objnames[match[1]] + _(', in ') + titles[match[0]];
|
||||
// XXX the generated anchors are not generally correct
|
||||
// XXX there may be custom prefixes
|
||||
result = [filenames[match[0]], fullname, '#'+fullname, descr];
|
||||
descr = objnames[match[1]][2] + _(', in ') + titles[match[0]];
|
||||
anchor = match[3];
|
||||
if (anchor == '')
|
||||
anchor = fullname;
|
||||
else if (anchor == '-')
|
||||
anchor = objnames[match[1]][1] + '-' + fullname;
|
||||
result = [filenames[match[0]], fullname, '#'+anchor, descr];
|
||||
switch (match[2]) {
|
||||
case 1: objectResults.push(result); break;
|
||||
case 0: importantResults.push(result); break;
|
||||
|
@ -489,7 +492,7 @@ var Search = {
|
|||
listItem.slideDown(5, function() {
|
||||
displayNextItem();
|
||||
});
|
||||
});
|
||||
}, "text");
|
||||
} else {
|
||||
// no source available, just display title
|
||||
Search.output.append(listItem);
|
||||
|
|
4
api.html
4
api.html
|
@ -330,8 +330,8 @@ a conf.d file appropriately or something similar. Who knows.</p>
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -329,8 +329,8 @@ a simplified syntax for this.</p>
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
4
faq.html
4
faq.html
|
@ -336,8 +336,8 @@ tasks – whether for a QA sytem, build system, or anything you can think of
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -160,8 +160,8 @@ s.parentNode.insertBefore(ga, s);
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -299,8 +299,8 @@ explore, but you already have a fully working infrastructure!</p>
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -260,7 +260,8 @@ Email: <input type=text name=email> <input type=submit name="sub" val
|
|||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="modules.html#command">command</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="modules.html#apt">apt</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="modules.html#id1">command</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="modules.html#copy">copy</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="modules.html#facter">facter</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="modules.html#file">file</a></li>
|
||||
|
@ -370,8 +371,8 @@ Puppet Labs, and rPath. Reach Michael by email <a class="reference external" hr
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
4
man.html
4
man.html
|
@ -194,8 +194,8 @@ examples of these tools in use.</p>
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible-playbook</title><link rel="stylesheet" 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-playbook" lang="en"><a id="id537662"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible-playbook — run an ansible playbook</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible-playbook <filename.yml> … [options]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible playbooks</strong></span> are a configuration and multinode deployment
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible-playbook</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible-playbook" lang="en"><a id="id493526"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible-playbook — run an ansible playbook</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible-playbook <filename.yml> … [options]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible playbooks</strong></span> are a configuration and multinode deployment
|
||||
system. Ansible-playbook is the tool used to run them. See the
|
||||
project home page (link below) for more information.</p></div><div class="refsect1" title="ARGUMENTS"><a id="_arguments"></a><h2>ARGUMENTS</h2><div class="variablelist"><dl><dt><span class="term">
|
||||
<span class="strong"><strong>filename.yml</strong></span>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible</title><link rel="stylesheet" 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="id413895"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible — run a command somewhere else</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible <host-pattern> [-f forks] [-m module_name] [-a args]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible</strong></span> is an extra-simple tool/framework/API for doing 'remote things' over
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible" lang="en"><a id="id481682"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible — run a command somewhere else</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible <host-pattern> [-f forks] [-m module_name] [-a args]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible</strong></span> is an extra-simple tool/framework/API for doing 'remote things' over
|
||||
SSH.</p></div><div class="refsect1" title="ARGUMENTS"><a id="_arguments"></a><h2>ARGUMENTS</h2><div class="variablelist"><dl><dt><span class="term">
|
||||
<span class="strong"><strong>host-pattern</strong></span>
|
||||
</span></dt><dd>
|
||||
|
|
|
@ -394,8 +394,8 @@ Stop by the mailing list to inquire about requirements.</p>
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
44
modules.html
44
modules.html
|
@ -129,7 +129,8 @@ s.parentNode.insertBefore(ga, s);
|
|||
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="#apt">apt</a></li>
|
||||
<li><a class="reference internal" href="#id1">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="#file">file</a></li>
|
||||
|
@ -196,8 +197,25 @@ to avoid changes to the system unless a change needs to be made. When using ans
|
|||
playbooks, these modules can trigger ‘change events’. Unless otherwise
|
||||
noted, any given module does support change hooks.</p>
|
||||
<p>Let’s see what’s available in the Ansible module library, out of the box:</p>
|
||||
<div class="section" id="command">
|
||||
<span id="id1"></span><h2>command<a class="headerlink" href="#command" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="apt">
|
||||
<span id="command"></span><h2>apt<a class="headerlink" href="#apt" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Manages apt-packages (such as for Debian/Ubuntu).</p>
|
||||
<p><em>pkg</em>:</p>
|
||||
<ul class="simple">
|
||||
<li>A package name or package specifier with version, like name-1.0</li>
|
||||
</ul>
|
||||
<p><em>state</em>:</p>
|
||||
<ul class="simple">
|
||||
<li>Can be either ‘installed’ or ‘removed’. NOTE: support</li>
|
||||
</ul>
|
||||
<p>for ‘latest’ (see yum, below) is in work.</p>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>apt pkg=foo ensure=removed
|
||||
apt pkg=foo ensure=installed</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id1">
|
||||
<h2>command<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The command module takes the command name followed by a list of
|
||||
arguments, space delimited.</p>
|
||||
<p>If you want to run a command through the shell (say you are using
|
||||
|
@ -210,7 +228,7 @@ paths to commands must be fully qualified.</p>
|
|||
<p>This module does not support change hooks and returns the return code
|
||||
from the program as well as timing information about how long the
|
||||
command was running for.</p>
|
||||
<p>Example action from a <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>command /sbin/shutdown -t now</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -229,7 +247,7 @@ absolute or relative path.</li>
|
|||
<li>Remote absolute path where the file should end up.</li>
|
||||
</ul>
|
||||
<p>This module also returns md5sum information about the resultant file.</p>
|
||||
<p>Example action from a <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>copy src=/srv/myfiles/foo.conf dest=/etc/foo.conf owner=foo group=foo mode=0644</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -267,7 +285,7 @@ to the file module are also available when running the <cite>copy</cite> or <cit
|
|||
<ul class="simple">
|
||||
<li>name of group that should own the file or directory, as would be given to <cite>chgrp</cite></li>
|
||||
</ul>
|
||||
<p>Example action from a <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>file dest=/etc/foo.conf owner=foo group=foo mode=0644
|
||||
file dest=/some/path owner=foo group=foo state=directory
|
||||
file dest/path/to/delete state=absent</pre>
|
||||
|
@ -289,7 +307,7 @@ file dest/path/to/delete state=absent</pre>
|
|||
<li>What version to check out – either the git SHA, the literal string
|
||||
<tt class="docutils literal"><span class="pre">HEAD</span></tt>, or a tag name.</li>
|
||||
</ul>
|
||||
<p>Example action from a <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>git repo=git://foosball.example.org/path/to/repo.git dest=/srv/checkout version=release-0.22</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -324,7 +342,7 @@ unless necessary. <tt class="docutils literal"><span class="pre">restarted</spa
|
|||
<ul class="simple">
|
||||
<li>The name of the service.</li>
|
||||
</ul>
|
||||
<p>Example action from a <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>service name=httpd state=started
|
||||
service name=httpd state=stopped
|
||||
service name=httpd state=restarted</pre>
|
||||
|
@ -348,7 +366,7 @@ tell their source. All variables are then bubbled up to the caller.</p>
|
|||
<tt class="docutils literal"><span class="pre">key=value</span></tt> pair in the JSON file for use in templating.</li>
|
||||
</ul>
|
||||
</div></blockquote>
|
||||
<p>Example action from a <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>vars:
|
||||
ntpserver: 'ntp.example.com'
|
||||
xyz: 1234</pre>
|
||||
|
@ -427,7 +445,7 @@ example in the github examples directory for what this looks like in a playbook.
|
|||
<ul class="simple">
|
||||
<li>Defaults to ‘present’. When ‘absent’, the user account will be removed if present.</li>
|
||||
</ul>
|
||||
<p>Example action from a <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>user name=mdehaan comment=awesome passwd=awWxVV.JvmdHw createhome=yes
|
||||
user name=mdehaan state=absent</pre>
|
||||
</div>
|
||||
|
@ -449,7 +467,7 @@ user name=mdehaan state=absent</pre>
|
|||
various configuration attributes. Values include ‘installed’, ‘updates’,
|
||||
‘available’, ‘repos’, or any package specifier.</li>
|
||||
</ul>
|
||||
<p>Example action from a <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>yum pkg=httpd ensure=latest
|
||||
yum pkg=httpd ensure=removed
|
||||
yum pkg=httpd ensure=installed</pre>
|
||||
|
@ -485,8 +503,8 @@ yum pkg=httpd ensure=installed</pre>
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -240,8 +240,8 @@ wildcards:</p>
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -246,8 +246,7 @@ documentation. The <cite>user</cite> is just the name of the user account:</p>
|
|||
other: 'magic'</pre>
|
||||
</div>
|
||||
<p>These variables can be used later in the playbook, or on the managed system (in templates), just like this:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="p">{{</span> <span class="n">varname</span> <span class="p">}}</span>
|
||||
</pre></div>
|
||||
<div class="highlight-python"><pre>{{ varname }}</pre>
|
||||
</div>
|
||||
<p>Within playbooks themselves, but not within templates on the remote machines, it’s also legal
|
||||
to use nicer shorthand like this:</p>
|
||||
|
@ -466,8 +465,7 @@ include files to do this.</p>
|
|||
</div>
|
||||
<p>Variables passed in can be used in the include files too. Assume a variable named ‘user’. Using
|
||||
<cite>jinja2</cite> syntax, anywhere in the included file, you can say:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="p">{{</span> <span class="n">user</span> <span class="p">}}</span>
|
||||
</pre></div>
|
||||
<div class="highlight-python"><pre>{{ user }}</pre>
|
||||
</div>
|
||||
<p>I can also pass variables into includes directly. We might call this a ‘parameterized include’.</p>
|
||||
<p>For instance, if deploying multiple wordpress instances, I could
|
||||
|
@ -624,8 +622,8 @@ Let’s run a playbook using a parallelism level of 10:</p>
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -29,7 +29,7 @@ that. If you're writing your own module, you care, and this means you do
|
|||
not have to write modules in any particular language -- you get tho choose.
|
||||
|
||||
Most modules other than command are `idempotent`, meaning they will seek
|
||||
to avoid changes to the system unless a change needs to be made. When using ansible
|
||||
to avoid changes to the system unless a change needs to be made. When using Ansible
|
||||
playbooks, these modules can trigger 'change events'. Unless otherwise
|
||||
noted, any given module does support change hooks.
|
||||
|
||||
|
@ -37,6 +37,26 @@ Let's see what's available in the Ansible module library, out of the box:
|
|||
|
||||
.. _command:
|
||||
|
||||
apt
|
||||
```
|
||||
|
||||
Manages apt-packages (such as for Debian/Ubuntu).
|
||||
|
||||
*pkg*:
|
||||
|
||||
* A package name or package specifier with version, like name-1.0
|
||||
|
||||
*state*:
|
||||
|
||||
* Can be either 'installed' or 'removed'. NOTE: support
|
||||
for 'latest' (see yum, below) is in work.
|
||||
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
|
||||
apt pkg=foo ensure=removed
|
||||
apt pkg=foo ensure=installed
|
||||
|
||||
|
||||
command
|
||||
```````
|
||||
|
||||
|
@ -56,7 +76,7 @@ This module does not support change hooks and returns the return code
|
|||
from the program as well as timing information about how long the
|
||||
command was running for.
|
||||
|
||||
Example action from a :doc:`playbooks`::
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
|
||||
command /sbin/shutdown -t now
|
||||
|
||||
|
@ -82,7 +102,7 @@ module.
|
|||
|
||||
This module also returns md5sum information about the resultant file.
|
||||
|
||||
Example action from a :doc:`playbooks`::
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
|
||||
copy src=/srv/myfiles/foo.conf dest=/etc/foo.conf owner=foo group=foo mode=0644
|
||||
|
||||
|
@ -128,7 +148,7 @@ to the file module are also available when running the `copy` or `template` modu
|
|||
|
||||
* name of group that should own the file or directory, as would be given to `chgrp`
|
||||
|
||||
Example action from a :doc:`playbooks`::
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
|
||||
file dest=/etc/foo.conf owner=foo group=foo mode=0644
|
||||
file dest=/some/path owner=foo group=foo state=directory
|
||||
|
@ -153,7 +173,7 @@ Deploys software (or files) from git checkouts.
|
|||
* What version to check out -- either the git SHA, the literal string
|
||||
``HEAD``, or a tag name.
|
||||
|
||||
Example action from a :doc:`playbooks`::
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
|
||||
git repo=git://foosball.example.org/path/to/repo.git dest=/srv/checkout version=release-0.22
|
||||
|
||||
|
@ -198,7 +218,7 @@ Controls services on remote machines.
|
|||
|
||||
* The name of the service.
|
||||
|
||||
Example action from a :doc:`playbooks`::
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
|
||||
service name=httpd state=started
|
||||
service name=httpd state=stopped
|
||||
|
@ -226,15 +246,15 @@ tell their source. All variables are then bubbled up to the caller.
|
|||
* Any other parameters can be named basically anything, and set a
|
||||
``key=value`` pair in the JSON file for use in templating.
|
||||
|
||||
Example action from a :doc:`playbooks`::
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
|
||||
vars:
|
||||
ntpserver: 'ntp.example.com'
|
||||
xyz: 1234
|
||||
|
||||
Example action from `/usr/bin/ansible`::
|
||||
Example action from `/usr/bin/Ansible`::
|
||||
|
||||
ansible -m all setup -a "ntpserver=ntp.example.com xyz=1234"
|
||||
Ansible -m all setup -a "ntpserver=ntp.example.com xyz=1234"
|
||||
|
||||
|
||||
.. _shell:
|
||||
|
@ -325,7 +345,7 @@ Creates user accounts, manipulates existing user accounts, and removes user acco
|
|||
|
||||
* Defaults to 'present'. When 'absent', the user account will be removed if present.
|
||||
|
||||
Example action from a :doc:`playbooks`::
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
|
||||
user name=mdehaan comment=awesome passwd=awWxVV.JvmdHw createhome=yes
|
||||
user name=mdehaan state=absent
|
||||
|
@ -351,7 +371,7 @@ Will install, upgrade, remove, and list packages with the yum package manager.
|
|||
various configuration attributes. Values include 'installed', 'updates',
|
||||
'available', 'repos', or any package specifier.
|
||||
|
||||
Example action from a :doc:`playbooks`::
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
|
||||
yum pkg=httpd ensure=latest
|
||||
yum pkg=httpd ensure=removed
|
||||
|
@ -366,14 +386,14 @@ See :doc:`moduledev`.
|
|||
.. seealso::
|
||||
|
||||
:doc:`examples`
|
||||
Examples of using modules in /usr/bin/ansible
|
||||
Examples of using modules in /usr/bin/Ansible
|
||||
:doc:`playbooks`
|
||||
Examples of using modules with /usr/bin/ansible-playbook
|
||||
Examples of using modules with /usr/bin/Ansible-playbook
|
||||
:doc:`moduledev`
|
||||
How to write your own modules
|
||||
:doc:`api`
|
||||
Examples of using modules with the Python API
|
||||
`Mailing List <http://groups.google.com/group/ansible-project>`_
|
||||
`Mailing List <http://groups.google.com/group/Ansible-project>`_
|
||||
Questions? Help? Ideas? Stop by the list on Google Groups
|
||||
`irc.freenode.net <http://irc.freenode.net>`_
|
||||
#ansible IRC chat channel
|
||||
|
|
|
@ -177,8 +177,8 @@ s.parentNode.insertBefore(ga, s);
|
|||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Mar 23, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.<br/>
|
||||
Last updated on Mar 26, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue