mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Docs rebuild
This commit is contained in:
parent
340faa5fde
commit
abdd5c1060
15 changed files with 31 additions and 29 deletions
|
@ -275,7 +275,7 @@ languages:
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
2
api.html
2
api.html
|
@ -359,7 +359,7 @@ a conf.d file appropriately or something similar. Who knows?</p>
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -183,7 +183,7 @@ s.parentNode.insertBefore(ga, s);
|
|||
<p>Here are some tips for making the most of Ansible.</p>
|
||||
<div class="section" id="group-by-roles">
|
||||
<h2>Group By Roles<a class="headerlink" href="#group-by-roles" title="Permalink to this headline">¶</a></h2>
|
||||
<p>A system can be in multiple groups. See ref:<cite>patterns</cite>. Having groups named after things like
|
||||
<p>A system can be in multiple groups. See <a class="reference internal" href="patterns.html"><em>Inventory & Patterns</em></a>. Having groups named after things like
|
||||
‘webservers’ and ‘dbservers’ is repeated in the examples because it’s a very powerful concept.</p>
|
||||
<p>This allows playbooks to target machines based on role, as well as to assign role specific variables
|
||||
using the group variable system.</p>
|
||||
|
@ -232,17 +232,17 @@ will require <cite>handlers</cite>, <cite>tasks</cite>, and <cite>templates</cit
|
|||
</div>
|
||||
<p>The tasks are individually broken out in ‘acme/tasks/setup.yml’, and handlers, which are common to all task files,
|
||||
are contained in ‘acme/handlers/main.yml’. As a reminder, handlers are mostly just used to notify services to restart
|
||||
when things change, and these are described in ref:<cite>playbooks</cite>.</p>
|
||||
when things change, and these are described in <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>.</p>
|
||||
<p>Including more than one setup file or more than one handlers file is of course legal.</p>
|
||||
<p>Having playbooks be able to include other playbooks is coming in release 0.5.</p>
|
||||
<p>Until then, to manage your entire site, simply execute all of your playbooks together, in the order desired.
|
||||
You don’t have to do this though, it’s fine to select sections of your infrastructure to manage at a single time.
|
||||
You don’t have to do this though. It’s fine to select sections of your infrastructure to manage at a single time.
|
||||
You may wish to construct simple shell scripts to wrap calls to ansible-playbook.</p>
|
||||
</div>
|
||||
<div class="section" id="miscellaneous-tips">
|
||||
<h2>Miscellaneous Tips<a class="headerlink" href="#miscellaneous-tips" title="Permalink to this headline">¶</a></h2>
|
||||
<p>When you can do something simply, do something simply. Do not reach to use every feature of Ansible together, all
|
||||
at once. Use what works for you. For example, you should probably not need ‘vars’, ‘vars_files’, ‘vars_prompt’ and ‘–extra-vars’ all at once, while also using an external inventory file.</p>
|
||||
at once. Use what works for you. For example, you should probably not need <tt class="docutils literal"><span class="pre">vars</span></tt>, <tt class="docutils literal"><span class="pre">vars_files</span></tt>, <tt class="docutils literal"><span class="pre">vars_prompt</span></tt> and <tt class="docutils literal"><span class="pre">--extra-vars</span></tt> all at once, while also using an external inventory file.</p>
|
||||
<p>Optimize for readability. Whitespace between sections of YAML documents and in between tasks is strongly encouraged,
|
||||
as is usage of YAML comments, which start with “#”. It is also useful to comment at the top of each file the purpose of the individual file and the author, including email address.</p>
|
||||
<p>It is possible to leave off the “name” for a given task, though it is recommended to provide
|
||||
|
@ -289,7 +289,7 @@ This way you have an audit trail describing when and why you changed the rules a
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -382,7 +382,7 @@ a simplified syntax for this.</p>
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
2
faq.html
2
faq.html
|
@ -386,7 +386,7 @@ tasks – whether for a QA sytem, build system, or anything you can think of
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -190,7 +190,7 @@ s.parentNode.insertBefore(ga, s);
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -236,7 +236,7 @@ $ git checkout -t origin/devel
|
|||
$ cd ./ansible
|
||||
$ source ./hacking/env-setup</pre>
|
||||
</div>
|
||||
<p>You can optionally specify an inventory file (see doc:<cite>patterns</cite>) other than /etc/ansible/hosts:</p>
|
||||
<p>You can optionally specify an inventory file (see <a class="reference internal" href="patterns.html"><em>Inventory & Patterns</em></a>) other than /etc/ansible/hosts:</p>
|
||||
<div class="highlight-python"><pre>$ echo "127.0.0.1" > ~/ansible_hosts
|
||||
$ export ANSIBLE_HOSTS=~/ansible_hosts</pre>
|
||||
</div>
|
||||
|
@ -280,7 +280,7 @@ same version. This is perfectly safe to do.</p>
|
|||
<div class="highlight-python"><pre>make debian</pre>
|
||||
</div>
|
||||
<p>An Arch PKGBUILD is available on <a class="reference external" href="https://aur.archlinux.org/packages.php?ID=58621">AUR</a>
|
||||
If you have python3 installed on Arch, you probably want to symlink python to python2.:</p>
|
||||
If you have python3 installed on Arch, you probably want to symlink python to python2:</p>
|
||||
<div class="highlight-python"><pre>sudo ln -sf /usr/bin/python2 /usr/bin/python</pre>
|
||||
</div>
|
||||
<p>If you would like to package Ansible for Homebrew, BSD, or others,
|
||||
|
@ -351,7 +351,7 @@ explore, but you already have a fully working infrastructure!</p>
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -447,7 +447,7 @@ Puppet Labs, and is now with <a class="reference external" href="http://rpath.co
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -455,7 +455,7 @@ Stop by the mailing list to inquire about requirements.</p>
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
14
modules.html
14
modules.html
|
@ -465,17 +465,18 @@ using the ‘shell’ or ‘command’ module is much more appro
|
|||
only output is returned. There is no error detection or change handler support
|
||||
for this module.</p>
|
||||
<p>Example from <cite>/usr/bin/ansible</cite> to bootstrap a legacy python 2.4 host:</p>
|
||||
<blockquote>
|
||||
<div>ansible newhost.example.com raw -a “yum install python-simplejson”</div></blockquote>
|
||||
<div class="highlight-python"><pre>ansible newhost.example.com raw -a "yum install python-simplejson"</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id9">
|
||||
<h2>service<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Controls services on remote machines.</p>
|
||||
<p><em>state</em>:</p>
|
||||
<ul class="simple">
|
||||
<li>Values are <tt class="docutils literal"><span class="pre">started</span></tt>, <tt class="docutils literal"><span class="pre">stopped</span></tt>, or <tt class="docutils literal"><span class="pre">restarted</span></tt>.
|
||||
<li>Values are <tt class="docutils literal"><span class="pre">started</span></tt>, <tt class="docutils literal"><span class="pre">stopped</span></tt>, <tt class="docutils literal"><span class="pre">reloaded</span></tt>, or <tt class="docutils literal"><span class="pre">restarted</span></tt>.
|
||||
Started/stopped are idempotent actions that will not run commands
|
||||
unless necessary. <tt class="docutils literal"><span class="pre">restarted</span></tt> will always bounce the service.</li>
|
||||
unless necessary. <tt class="docutils literal"><span class="pre">restarted</span></tt> will always bounce the service, <tt class="docutils literal"><span class="pre">reloaded</span></tt>
|
||||
will always issue a reload.</li>
|
||||
</ul>
|
||||
<p><em>enabled</em>:</p>
|
||||
<ul class="simple">
|
||||
|
@ -493,7 +494,8 @@ Uses chkconfig or updates-rc.d as appropriate.</li>
|
|||
<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>
|
||||
service name=httpd state=restarted
|
||||
service name=httpd state=reloaded</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="setup">
|
||||
|
@ -787,7 +789,7 @@ yum pkg=httpd state=installed</pre>
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -363,7 +363,7 @@ YAML:</p>
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -271,8 +271,8 @@ Just <cite>Control-C</cite> to kill it and run it again with <cite>-K</cite>.</p
|
|||
<div class="highlight-python"><pre>$varname</pre>
|
||||
</div>
|
||||
<p>In templates, the full power of the Jinja2 templating language is also available, which looks like this:</p>
|
||||
<blockquote>
|
||||
<div>{{ varname }}</div></blockquote>
|
||||
<div class="highlight-python"><pre>{{ varname }}</pre>
|
||||
</div>
|
||||
<p>The Jinja2 documentation provides information about how to construct loops and conditionals for those
|
||||
who which to use more advanced templating. This is optional and the $varname format still works in template
|
||||
files.</p>
|
||||
|
@ -471,7 +471,7 @@ Let’s run a playbook using a parallelism level of 10:</p>
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -196,7 +196,7 @@ relevant, feel free to skip it. For many people, the features documented in <ci
|
|||
be 90% or more of what they use in Ansible.</p>
|
||||
<div class="section" id="accessing-complex-variable-data">
|
||||
<h2>Accessing Complex Variable Data<a class="headerlink" href="#accessing-complex-variable-data" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Some provided facts, like networking information, are made available as nested datastructures. To access
|
||||
<p>Some provided facts, like networking information, are made available as nested data structures. To access
|
||||
them a simple ‘$foo’ is not sufficient, but it is still easy to do. Here’s how we get an IP address using
|
||||
Ansible 0.4 and later:</p>
|
||||
<div class="highlight-python"><pre>${ansible_eth0.ipv4.address}</pre>
|
||||
|
@ -501,7 +501,7 @@ logs from ansible-pull runs would be an excellent way to gather and analyze remo
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -207,7 +207,7 @@ s.parentNode.insertBefore(ga, s);
|
|||
</p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on May 13, 2012.<br/>
|
||||
Last updated on May 19, 2012.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue