1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
This commit is contained in:
Michael DeHaan 2012-08-09 22:09:05 -04:00
parent ea3bf960aa
commit 331cfa6b36
6 changed files with 55 additions and 28 deletions

View file

@ -253,8 +253,12 @@ You may wish to construct simple shell scripts to wrap calls to ansible-playbook
</div>
<div class="section" id="bundling-ansible-modules-with-playbooks">
<h2>Bundling Ansible Modules With Playbooks<a class="headerlink" href="#bundling-ansible-modules-with-playbooks" title="Permalink to this headline"></a></h2>
<p>In version 0.5 and later, if a playbook has a &#8221;./library&#8221; directory relative to it&#8217;s YAML file, this directory can be used to add ansible modules that will automatically be in the ansible module path. This is a great way to keep modules that
go with a playbook together.</p>
<p class="versionadded">
<span class="versionmodified">New in version 0.5.</span></p>
<p>If a playbook has a &#8221;./library&#8221; directory relative to it&#8217;s YAML file,
this directory can be used to add ansible modules that will
automatically be in the ansible module path. This is a great way to
keep modules that go with a playbook together.</p>
</div>
<div class="section" id="miscellaneous-tips">
<h2>Miscellaneous Tips<a class="headerlink" href="#miscellaneous-tips" title="Permalink to this headline"></a></h2>

View file

@ -298,10 +298,12 @@ project page:</p>
<p>By default, ansible uses paramiko to talk to managed nodes over SSH. Paramiko is fast, works
very transparently, requires no configuration, and is a good choice for most users.
However, it does not support some advanced SSH features that folks will want to use.</p>
<p>Starting in version 0.5, if you want to leverage more advanced SSH features (such as Kerberized SSH or jump hosts),
pass the flag &#8220;&#8211;connection=ssh&#8221; to any ansible command, or set the
ANSIBLE_TRANSPORT environment variable to &#8216;ssh&#8217;. This will cause Ansible to use openssh
tools instead.</p>
<p class="versionadded">
<span class="versionmodified">New in version 0.5.</span></p>
<p>If you want to leverage more advanced SSH features (such as Kerberized
SSH or jump hosts), pass the flag &#8220;&#8211;connection=ssh&#8221; to any ansible
command, or set the ANSIBLE_TRANSPORT environment variable to
&#8216;ssh&#8217;. This will cause Ansible to use openssh tools instead.</p>
<p>If ANSIBLE_SSH_ARGS are not set, ansible will try to use some sensible ControlMaster options
by default. You are free to override this environment variable, but should still pass ControlMaster
options to ensure performance of this transport. With ControlMaster in use, both transports

View file

@ -340,11 +340,15 @@ apt_repository repo='deb http://archive.canonical.com/ubuntu hardy partner'</pre
</div>
<div class="section" id="assemble">
<span id="id3"></span><h2>assemble<a class="headerlink" href="#assemble" title="Permalink to this headline"></a></h2>
<p>(new in 0.5) Assembles a configuration file from fragments. Often a particular program will take a single configuration file
and does not support a conf.d style structure where it is easy to build up the configuration from multiple sources.
Assmeble will take a directory of files that have already been transferred to the system, and concatenate them
together to produce a destination file. Files are assembled in string sorting order. Puppet calls this idea
&#8220;fragments&#8221;.</p>
<p class="versionadded">
<span class="versionmodified">New in version 0.5.</span></p>
<p>Assembles a configuration file from fragments. Often a particular
program will take a single configuration file and does not support a
conf.d style structure where it is easy to build up the configuration
from multiple sources. Assmeble will take a directory of files that
have already been transferred to the system, and concatenate them
together to produce a destination file. Files are assembled in string
sorting order. Puppet calls this idea &#8220;fragments&#8221;.</p>
<table border="1" class="docutils">
<colgroup>
<col width="17%" />
@ -383,7 +387,9 @@ together to produce a destination file. Files are assembled in string sorting o
</div>
<div class="section" id="authorized-key">
<span id="id4"></span><h2>authorized_key<a class="headerlink" href="#authorized-key" title="Permalink to this headline"></a></h2>
<p>(new in 0.5). Adds or removes an authorized key for a user from a remote host.</p>
<p class="versionadded">
<span class="versionmodified">New in version 0.5.</span></p>
<p>Adds or removes an authorized key for a user from a remote host.</p>
<table border="1" class="docutils">
<colgroup>
<col width="17%" />

View file

@ -304,9 +304,11 @@ seperate from the inventory file, see the next section.</p>
</div>
<div class="section" id="splitting-out-host-and-group-specific-data">
<h2>Splitting Out Host and Group Specific Data<a class="headerlink" href="#splitting-out-host-and-group-specific-data" title="Permalink to this headline"></a></h2>
<p>In Ansible 0.6 and later, in addition to the storing variables directly in the INI file, host and
group variables can be stored in individual files relative to the inventory file. These
variable files are in YAML format.</p>
<p class="versionadded">
<span class="versionmodified">New in version 0.6.</span></p>
<p>In addition to the storing variables directly in the INI file, host
and group variables can be stored in individual files relative to the
inventory file. These variable files are in YAML format.</p>
<p>Assuming the inventory file path is:</p>
<div class="highlight-python"><pre>/etc/ansible/hosts</pre>
</div>
@ -326,13 +328,17 @@ database_server: storage.example.org</pre>
<p>It is ok if these files do not exist, this is an optional feature.</p>
<p>Tip: Keeping your inventory file and variables in a git repo (or other version control)
is an excellent way to track changes to your inventory and host variables.</p>
<p>Tip: If you ever have two python interpreters on a system, set a variable called &#8216;ansible_python_interpreter&#8217; to
the Python interpreter path you would like to use.</p>
<p class="versionadded">
<span class="versionmodified">New in version 0.5: </span>If you ever have two python interpreters on a system, set a
variable called &#8216;ansible_python_interpreter&#8217; to the Python
interpreter path you would like to use.</p>
</div>
<div class="section" id="yaml-inventory">
<h2>YAML Inventory<a class="headerlink" href="#yaml-inventory" title="Permalink to this headline"></a></h2>
<p>Ansible&#8217;s YAML inventory format is deprecated and will be removed in Ansible 0.7. Ansible 0.6 includes
a <a class="reference external" href="https://github.com/ansible/ansible/blob/devel/examples/scripts/yaml_to_ini.py">conversion script</a>.</p>
<p class="deprecated">
<span class="versionmodified">Deprecated since version 0.7.</span></p>
<p>Ansible&#8217;s YAML inventory format is deprecated and will be removed in
Ansible 0.7. Ansible 0.6 includes a <a class="reference external" href="https://github.com/ansible/ansible/blob/devel/examples/scripts/yaml_to_ini.py">conversion script</a>.</p>
<p>Usage:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">yaml_to_ini</span><span class="o">.</span><span class="n">py</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">ansible</span><span class="o">/</span><span class="n">hosts</span>
</pre></div>

View file

@ -202,8 +202,11 @@ 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="tags">
<h2>Tags<a class="headerlink" href="#tags" title="Permalink to this headline"></a></h2>
<p>(New in 0.6) If you have a large playbook it may become useful to be able to run a specific
part of the configuration. Both plays and tasks support a &#8220;tags:&#8221; attribute for this reason.</p>
<p class="versionadded">
<span class="versionmodified">New in version 0.6.</span></p>
<p>If you have a large playbook it may become useful to be able to run a
specific part of the configuration. Both plays and tasks support a
&#8220;tags:&#8221; attribute for this reason.</p>
<p>Example:</p>
<div class="highlight-python"><pre>tasks:
@ -224,10 +227,13 @@ part of the configuration. Both plays and tasks support a &#8220;tags:&#8221; a
</div>
<div class="section" id="playbooks-including-playbooks">
<h2>Playbooks Including Playbooks<a class="headerlink" href="#playbooks-including-playbooks" title="Permalink to this headline"></a></h2>
<p>(New in 0.6) To further advance the concept of include files, playbook files can include other playbook
files. Suppose you define the behavior of all your webservers in &#8220;webservers.yml&#8221; and
all your database servers in &#8220;dbservers.yml&#8221;. You can create a &#8220;site.yml&#8221; that would
reconfigure all of your systems like this:</p>
<p class="versionadded">
<span class="versionmodified">New in version 0.6.</span></p>
<p>To further advance the concept of include files, playbook files can
include other playbook files. Suppose you define the behavior of all
your webservers in &#8220;webservers.yml&#8221; and all your database servers in
&#8220;dbservers.yml&#8221;. You can create a &#8220;site.yml&#8221; that would reconfigure
all of your systems like this:</p>
<div class="highlight-python"><pre>----
- include: playbooks/webservers.yml
- include: playbooks/dbservers.yml</pre>
@ -237,8 +243,11 @@ what parts of those plays.</p>
</div>
<div class="section" id="ignoring-failed-commands">
<h2>Ignoring Failed Commands<a class="headerlink" href="#ignoring-failed-commands" title="Permalink to this headline"></a></h2>
<p>(New in 0.6) Generally playbooks will stop executing any more steps on a host that has a failure.
Sometimes, though, you want to continue on. To do so, write a task that looks like this:</p>
<p class="deprecated">
<span class="versionmodified">Deprecated since version 0.6.</span></p>
<p>Generally playbooks will stop executing any more steps on a host that
has a failure. Sometimes, though, you want to continue on. To do so,
write a task that looks like this:</p>
<div class="highlight-python"><pre>- name: this will not be counted as a failure
action: command /bin/false
ignore_errors: True</pre>

File diff suppressed because one or more lines are too long