1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

various tweaks/rebuild

This commit is contained in:
Michael DeHaan 2012-08-16 21:12:36 -04:00
parent 1676ff4e2d
commit 7fc9ac4cf9
18 changed files with 83 additions and 82 deletions

View file

@ -131,7 +131,7 @@ s.parentNode.insertBefore(ga, s);
<span class="globaltoc"><ul class="current">
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Ansible Modules</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -289,7 +289,7 @@ languages:
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -131,7 +131,7 @@ s.parentNode.insertBefore(ga, s);
<span class="globaltoc"><ul class="current">
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -469,7 +469,7 @@ e.g.
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -131,7 +131,7 @@ s.parentNode.insertBefore(ga, s);
<span class="globaltoc"><ul class="current">
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -340,7 +340,7 @@ different variables to different geographies.</p>
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Command Line &mdash; Ansible - SSH-Based Configuration Management &amp; Deployment</title>
<title>Command Line Examples And Next Steps &mdash; Ansible - SSH-Based Configuration Management &amp; Deployment</title>
<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/bootstrap.css" type="text/css" />
@ -131,7 +131,7 @@ s.parentNode.insertBefore(ga, s);
<span class="globaltoc"><ul class="current">
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Command Line</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -148,15 +148,16 @@ s.parentNode.insertBefore(ga, s);
<a href="#"
class="dropdown-toggle">Page</a>
<span class="localtoc"><ul>
<li><a class="reference internal" href="#">Command Line</a><ul>
<li><a class="reference internal" href="#">Command Line Examples And Next Steps</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="#file-transfer">File Transfer</a></li>
<li><a class="reference internal" href="#managing-packages">Managing Packages</a></li>
<li><a class="reference internal" href="#users-and-groups">Users and Groups</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>
<li><a class="reference internal" href="#limiting-selected-hosts">Limiting Selected Hosts</a></li>
<li><a class="reference internal" href="#configuration-defaults">Configuration &amp; Defaults</a></li>
</ul>
</li>
</ul>
@ -184,8 +185,8 @@ s.parentNode.insertBefore(ga, s);
<a href="http://ansible.github.com"><img src="http://ansible.github.com/ansible-logo.png" alt="Ansible"/></a><br/>
<br/>
<div class="section" id="command-line">
<h1>Command Line<a class="headerlink" href="#command-line" title="Permalink to this headline"></a></h1>
<div class="section" id="command-line-examples-and-next-steps">
<h1>Command Line Examples And Next Steps<a class="headerlink" href="#command-line-examples-and-next-steps" 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. Start here.</p>
<p>For configuration management and deployments, you&#8217;ll want to pick up on
@ -255,19 +256,17 @@ simple scripts. They make the remote system look like you state, and run the com
get it there. This is commonly referred to as &#8216;idempotence&#8217;, and is a core design goal of ansible.
However, we also recognize that running <em>ad hoc</em> commands is equally important, so Ansible easily supports both.</p>
</div>
<div class="section" id="file-transfer-templating">
<h2>File Transfer &amp; Templating<a class="headerlink" href="#file-transfer-templating" title="Permalink to this headline"></a></h2>
<p>Here&#8217;s another use case for the <cite>/usr/bin/ansible</cite> command line.</p>
<p>Ansible can SCP lots of files to multiple machines in parallel, and
optionally use them as template sources.</p>
<div class="section" id="file-transfer">
<h2>File Transfer<a class="headerlink" href="#file-transfer" title="Permalink to this headline"></a></h2>
<p>Here&#8217;s another use case for the <cite>/usr/bin/ansible</cite> command line. Ansible can SCP lots of files to multiple machines in parallel.</p>
<p>To transfer a file directly to many different servers:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ansible atlanta -m copy -a <span class="s2">&quot;src=/etc/hosts dest=/tmp/hosts&quot;</span>
</pre></div>
</div>
<p>If you use playbooks, you can also take advantage of the template module,
which takes this another step further.</p>
<p>If you use playbooks, you can also take advantage of the <tt class="docutils literal"><span class="pre">template</span></tt> module,
which takes this another step further. (See module and playbook documentation).</p>
<p>The <tt class="docutils literal"><span class="pre">file</span></tt> module allows changing ownership and permissions on files. These
same options can be passed directly to the <tt class="docutils literal"><span class="pre">copy</span></tt> or <tt class="docutils literal"><span class="pre">template</span></tt> modules as well:</p>
same options can be passed directly to the <tt class="docutils literal"><span class="pre">copy</span></tt> module as well:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ansible webservers -m file -a <span class="s2">&quot;dest=/srv/foo/a.txt mode=600&quot;</span>
<span class="nv">$ </span>ansible webservers -m file -a <span class="s2">&quot;dest=/srv/foo/b.txt mode=600 owner=mdehaan group=mdehaan&quot;</span>
</pre></div>
@ -280,7 +279,6 @@ same options can be passed directly to the <tt class="docutils literal"><span cl
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ansible webservers -m file -a <span class="s2">&quot;dest=/path/to/c state=absent&quot;</span>
</pre></div>
</div>
<p>The mode, owner, and group arguments can also be used on the copy or template lines.</p>
</div>
<div class="section" id="managing-packages">
<h2>Managing Packages<a class="headerlink" href="#managing-packages" title="Permalink to this headline"></a></h2>
@ -368,10 +366,8 @@ poll for status (<tt class="docutils literal"><span class="pre">-P</span></tt>)
Be sure to use a high enough <tt class="docutils literal"><span class="pre">--forks</span></tt> value if you want to get all of your jobs started
very quickly. After the time limit (in seconds) runs out (<tt class="docutils literal"><span class="pre">-B</span></tt>), the process on
the remote nodes will be terminated.</p>
<p>Any module other than <tt class="docutils literal"><span class="pre">copy</span></tt> or <tt class="docutils literal"><span class="pre">template</span></tt> can be
backgrounded. Typically you&#8217;ll be backgrounding long-running
shell commands or software upgrades only. <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a> also support polling, and have
a simplified syntax for this.</p>
<p>Typically you&#8217;ll be only be backgrounding long-running
shell commands or software upgrades only. Backgrounding the copy module does not do a background file transfer. <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a> also support polling, and have a simplified syntax for this.</p>
</div>
<div class="section" id="limiting-selected-hosts">
<h2>Limiting Selected Hosts<a class="headerlink" href="#limiting-selected-hosts" title="Permalink to this headline"></a></h2>
@ -396,6 +392,12 @@ also works with <tt class="docutils literal"><span class="pre">ansible-playbook<
<p>This will select the first 100, then the second 100, host entries in the webservers group. (It does not matter
what their names or IP addresses are).</p>
<p>Both of these methods can be used at the same time, and ranges can also be passed to the &#8211;limit parameter.</p>
</div>
<div class="section" id="configuration-defaults">
<h2>Configuration &amp; Defaults<a class="headerlink" href="#configuration-defaults" title="Permalink to this headline"></a></h2>
<p class="versionadded">
<span class="versionmodified">New in version 0.7.</span></p>
<p>Ansible has an optional configuration file that can be used to tune settings and also eliminate the need to pass various command line flags. The config file location is controlled by the ANSIBLE_CONFIG environment variable, if set, otherwise ~/ansible.cfg or /etc/ansible/ansible.cfg will be loaded, whichever comes first. For those running from source, a sample configuration file lives in the examples/ directory. The RPM will install configuration into /etc/ansible/ansible.cfg automatically.</p>
<div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p>
<dl class="last docutils">
@ -440,7 +442,7 @@ what their names or IP addresses are).</p>
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -131,7 +131,7 @@ s.parentNode.insertBefore(ga, s);
<span class="globaltoc"><ul class="current">
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -367,7 +367,7 @@ tasks &#8211; whether for a QA sytem, build system, or anything you can think of
<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="examples.html"><em>Command Line</em></a></dt>
<dt><a class="reference internal" href="examples.html"><em>Command Line Examples And Next Steps</em></a></dt>
<dd>Examples of basic commands</dd>
<dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
<dd>Learning ansible&#8217;s configuration management language</dd>
@ -409,7 +409,7 @@ tasks &#8211; whether for a QA sytem, build system, or anything you can think of
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -129,7 +129,7 @@ s.parentNode.insertBefore(ga, s);
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -204,7 +204,7 @@ s.parentNode.insertBefore(ga, s);
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -131,7 +131,7 @@ s.parentNode.insertBefore(ga, s);
<span class="globaltoc"><ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="patterns.html">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -361,7 +361,7 @@ like to access sudo mode, there are also flags to do that:</p>
</pre></div>
</div>
<p>Congratulations. You&#8217;ve just contacted your nodes with Ansible. It&#8217;s
now time to read some of the more real-world <a class="reference internal" href="examples.html"><em>Command Line</em></a>, and explore
now time to read some of the more real-world <a class="reference internal" href="examples.html"><em>Command Line Examples And Next Steps</em></a>, and explore
what you can do with different modules, as well as the Ansible
<a class="reference internal" href="playbooks.html"><em>Playbooks</em></a> language. Ansible is not just about running commands, it
also has powerful configuration management and deployment features. There&#8217;s more to
@ -369,7 +369,7 @@ explore, but you already have a fully working infrastructure!</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="examples.html"><em>Command Line</em></a></dt>
<dt><a class="reference internal" href="examples.html"><em>Command Line Examples And Next Steps</em></a></dt>
<dd>Examples of basic commands</dd>
<dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
<dd>Learning ansible&#8217;s configuration management language</dd>
@ -410,7 +410,7 @@ explore, but you already have a fully working infrastructure!</p>
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -130,7 +130,7 @@ s.parentNode.insertBefore(ga, s);
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -371,7 +371,7 @@ Puppet Labs, and is now with <a class="reference external" href="http://rpath.co
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -413,7 +413,7 @@ Puppet Labs, and is now with <a class="reference external" href="http://rpath.co
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -131,7 +131,7 @@ s.parentNode.insertBefore(ga, s);
<span class="globaltoc"><ul class="current">
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -511,7 +511,7 @@ the program. Stop by the mailing list to inquire about requirements.</p>
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -28,7 +28,7 @@
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="top" title="Ansible - SSH-Based Configuration Management &amp; Deployment" href="index.html" />
<link rel="next" title="YAML Syntax" href="YAMLSyntax.html" />
<link rel="prev" title="Command Line" href="examples.html" />
<link rel="prev" title="Command Line Examples And Next Steps" href="examples.html" />
<script type="text/javascript">
(function () {
/**
@ -131,7 +131,7 @@ s.parentNode.insertBefore(ga, s);
<span class="globaltoc"><ul class="current">
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Ansible Modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -1742,7 +1742,7 @@ yum name=httpd state=installed</pre>
<dl class="last docutils">
<dt><a class="reference external" href="https://github.com/ansible/ansible-resources">Ansible Resources (Contrib)</a></dt>
<dd>User contributed playbooks, modules, and articles</dd>
<dt><a class="reference internal" href="examples.html"><em>Command Line</em></a></dt>
<dt><a class="reference internal" href="examples.html"><em>Command Line Examples And Next Steps</em></a></dt>
<dd>Examples of using modules in /usr/bin/ansible</dd>
<dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
<dd>Examples of using modules with /usr/bin/ansible-playbook</dd>
@ -1787,7 +1787,7 @@ yum name=httpd state=installed</pre>
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -27,7 +27,7 @@
<script type="text/javascript" src="_static/bootstrap-scrollspy.js"></script>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="top" title="Ansible - SSH-Based Configuration Management &amp; Deployment" href="index.html" />
<link rel="next" title="Command Line" href="examples.html" />
<link rel="next" title="Command Line Examples And Next Steps" href="examples.html" />
<link rel="prev" title="Getting Started" href="gettingstarted.html" />
<script type="text/javascript">
(function () {
@ -131,7 +131,7 @@ s.parentNode.insertBefore(ga, s);
<span class="globaltoc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -218,7 +218,7 @@ after the hostname with a colon.</p>
</div>
<div class="section" id="selecting-targets">
<h2>Selecting Targets<a class="headerlink" href="#selecting-targets" title="Permalink to this headline"></a></h2>
<p>We&#8217;ll go over how to use the command line in <a class="reference internal" href="examples.html"><em>Command Line</em></a> section, however, basically it looks like this:</p>
<p>We&#8217;ll go over how to use the command line in <a class="reference internal" href="examples.html"><em>Command Line Examples And Next Steps</em></a> section, however, basically it looks like this:</p>
<div class="highlight-python"><pre>ansible &lt;pattern_goes_here&gt; -m &lt;module_name&gt; -a &lt;arguments&gt;</pre>
</div>
<p>Such as:</p>
@ -253,7 +253,7 @@ wildcards:</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>
<p>Easy enough. See <a class="reference internal" href="examples.html"><em>Command Line</em></a> and then <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a> for how to do things to selected hosts.</p>
<p>Easy enough. See <a class="reference internal" href="examples.html"><em>Command Line Examples And Next Steps</em></a> and then <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a> for how to do things to selected hosts.</p>
</div>
<div class="section" id="host-variables">
<h2>Host Variables<a class="headerlink" href="#host-variables" title="Permalink to this headline"></a></h2>
@ -351,7 +351,7 @@ Ansible 0.7. Ansible 0.6 includes a <a class="reference external" href="https:/
<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="examples.html"><em>Command Line</em></a></dt>
<dt><a class="reference internal" href="examples.html"><em>Command Line Examples And Next Steps</em></a></dt>
<dd>Examples of basic commands</dd>
<dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
<dd>Learning ansible&#8217;s configuration management language</dd>
@ -392,7 +392,7 @@ Ansible 0.7. Ansible 0.6 includes a <a class="reference external" href="https:/
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -131,7 +131,7 @@ s.parentNode.insertBefore(ga, s);
<span class="globaltoc"><ul class="current">
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Playbooks</a></li>
@ -190,7 +190,7 @@ s.parentNode.insertBefore(ga, s);
<div class="section" id="playbooks">
<h1>Playbooks<a class="headerlink" href="#playbooks" title="Permalink to this headline"></a></h1>
<p>Playbooks are a completely different way to use ansible than in task execution mode, and are
particularly awesome. Simply put, playbooks are the basis for a really simple
particularly powerful. Simply put, playbooks 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>Playbooks can declare configurations, but they can also orchestrate steps of
@ -295,7 +295,7 @@ parameters.</p>
<div class="highlight-python"><pre>$varname or ${varname}</pre>
</div>
<p>The later is useful in the event you need to do something like ${other}_some_string.</p>
<p>The full power of the <a class="reference external" href="http://jinja.pocoo.org/docs/">Jinja2</a> templating language is also available, which looks like this:</p>
<p>Inside templates, the full power of the <a class="reference external" href="http://jinja.pocoo.org/docs/">Jinja2</a> templating language is also available, which looks like this:</p>
<div class="highlight-python"><pre>{{ varname }}</pre>
</div>
<p>The Jinja2 documentation provides information about how to construct loops and conditionals for those
@ -546,7 +546,7 @@ package is installed. Try it!</p>
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -131,7 +131,7 @@ s.parentNode.insertBefore(ga, s);
<span class="globaltoc"><ul class="current">
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -655,7 +655,7 @@ instance, you could test for the existance of a particular program.</p>
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

View file

@ -1,5 +1,5 @@
Command Line
============
Command Line Examples And Next Steps
====================================
.. highlight:: bash
@ -81,23 +81,20 @@ get it there. This is commonly referred to as 'idempotence', and is a core desi
However, we also recognize that running *ad hoc* commands is equally important, so Ansible easily supports both.
File Transfer & Templating
``````````````````````````
File Transfer
`````````````
Here's another use case for the `/usr/bin/ansible` command line.
Ansible can SCP lots of files to multiple machines in parallel, and
optionally use them as template sources.
Here's another use case for the `/usr/bin/ansible` command line. Ansible can SCP lots of files to multiple machines in parallel.
To transfer a file directly to many different servers::
$ ansible atlanta -m copy -a "src=/etc/hosts dest=/tmp/hosts"
If you use playbooks, you can also take advantage of the template module,
which takes this another step further.
If you use playbooks, you can also take advantage of the ``template`` module,
which takes this another step further. (See module and playbook documentation).
The ``file`` module allows changing ownership and permissions on files. These
same options can be passed directly to the ``copy`` or ``template`` modules as well::
same options can be passed directly to the ``copy`` module as well::
$ ansible webservers -m file -a "dest=/srv/foo/a.txt mode=600"
$ ansible webservers -m file -a "dest=/srv/foo/b.txt mode=600 owner=mdehaan group=mdehaan"
@ -110,8 +107,6 @@ As well as delete directories (recursively) and delete files::
$ ansible webservers -m file -a "dest=/path/to/c state=absent"
The mode, owner, and group arguments can also be used on the copy or template lines.
Managing Packages
`````````````````
@ -206,10 +201,8 @@ Be sure to use a high enough ``--forks`` value if you want to get all of your jo
very quickly. After the time limit (in seconds) runs out (``-B``), the process on
the remote nodes will be terminated.
Any module other than ``copy`` or ``template`` can be
backgrounded. Typically you'll be backgrounding long-running
shell commands or software upgrades only. :doc:`playbooks` also support polling, and have
a simplified syntax for this.
Typically you'll be only be backgrounding long-running
shell commands or software upgrades only. Backgrounding the copy module does not do a background file transfer. :doc:`playbooks` also support polling, and have a simplified syntax for this.
Limiting Selected Hosts
```````````````````````
@ -221,7 +214,7 @@ by using 'batch' (or 'range') selectors.
As mentioned above, patterns can be strung together to select hosts in more than one group::
$ ansible webservers:dbservers -m command -a "/bin/foo xyz"
$ ansible webservers:dbservers -m command -a "/bin/foo xyz"
This is an "or" condition. If you want to further constrain the selection, use --limit, which
also works with ``ansible-playbook``::
@ -236,8 +229,14 @@ Now let's talk about range selection. Suppose you have 1000 servers in group '
This will select the first 100, then the second 100, host entries in the webservers group. (It does not matter
what their names or IP addresses are).
Both of these methods can be used at the same time, and ranges can also be passed to the --limit parameter.
Both of these methods can be used at the same time, and ranges can also be passed to the --limit parameter.
Configuration & Defaults
````````````````````````
.. versionadded:: 0.7
Ansible has an optional configuration file that can be used to tune settings and also eliminate the need to pass various command line flags. The config file location is controlled by the ANSIBLE_CONFIG environment variable, if set, otherwise ~/ansible.cfg or /etc/ansible/ansible.cfg will be loaded, whichever comes first. For those running from source, a sample configuration file lives in the examples/ directory. The RPM will install configuration into /etc/ansible/ansible.cfg automatically.
.. seealso::

View file

@ -2,7 +2,7 @@ Playbooks
=========
Playbooks are a completely different way to use ansible than in task execution mode, and are
particularly awesome. Simply put, playbooks are the basis for a really simple
particularly powerful. Simply put, playbooks 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.
@ -127,7 +127,7 @@ These variables can be used later in the playbook like this::
The later is useful in the event you need to do something like ${other}_some_string.
The full power of the `Jinja2 <http://jinja.pocoo.org/docs/>`_ templating language is also available, which looks like this::
Inside templates, the full power of the `Jinja2 <http://jinja.pocoo.org/docs/>`_ templating language is also available, which looks like this::
{{ varname }}

View file

@ -135,7 +135,7 @@ s.parentNode.insertBefore(ga, s);
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -221,7 +221,7 @@ s.parentNode.insertBefore(ga, s);
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>

File diff suppressed because one or more lines are too long

View file

@ -130,7 +130,7 @@ s.parentNode.insertBefore(ga, s);
<span class="globaltoc"><ul class="current">
<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">Inventory &amp; Patterns</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Command Line Examples And Next Steps</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="YAMLSyntax.html">YAML Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="playbooks.html">Playbooks</a></li>
@ -269,7 +269,7 @@ s.parentNode.insertBefore(ga, s);
</p>
<p>
&copy; Copyright 2012 Michael DeHaan.<br/>
Last updated on Aug 14, 2012.<br/>
Last updated on Aug 16, 2012.<br/>
</p>
</div>
</footer>