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