in a different system. Frequent examples include LDAP, <aclass="reference external"href="http://cobbler.github.com">Cobbler</a>,
or a piece of expensive enterprisey CMDB software. Ansible easily supports all
of these options via an external interventory system.</p>
<p>If you have a data store system where an Ansible external inventory script doesn’t already exist, this may require a little coding,J
but we have a <aclass="reference external"href="https://github.com/ansible/ansible/blob/master/examples/scripts/cobbler_external_inventory.py">Cobbler example</a> in the main source tree – but it’s pretty simple, as we’ll explain below – that would provide a good starting point. Like with modules, it’s possible to build an external inventory script in any language, as long as it returns JSON.</p>
<p>If you have a data store system where an Ansible external inventory script doesn’t already exist, this may require a little coding, but we have a <aclass="reference external"href="https://github.com/ansible/ansible/blob/master/examples/scripts/cobbler_external_inventory.py">Cobbler example</a> in the main source tree – but it’s pretty simple, as we’ll explain below – that would provide a good starting point. Like with modules, it’s possible to build an external inventory script in any language, as long as it returns JSON.</p>
<p>If you are familiar with Puppet terminology, this concept is basically the same as ‘external nodes’, with the slight difference that it also defines which hosts are managed.</p>
<divclass="section"id="script-conventions">
<h3>Script Conventions<aclass="headerlink"href="#script-conventions"title="Permalink to this headline">¶</a></h3>
@@ -234,7 +234,7 @@ even bash ... just return some output in JSON format. You don’t need to k
as it can. A system shouldn’t be half correct, especially if we’re planning on configuring
other systems that depend on that system.</p>
<p>Ansible also has a VERY short learning curve – but it also has less language constructs and
does not create it’s own programming language. What constructs Ansible does have should be enough to cover 80% or so of the cases of most Puppet users, and it should scale equally well (not having a server is
does not create its own programming language. What constructs Ansible does have should be enough to cover 80% or so of the cases of most Puppet users, and it should scale equally well (not having a server is
almost like cheating).</p>
<p>I also suspect some Ansible users will actually use Ansible to trigger Puppet – using the git
module to checkout a Puppet module hierachy from source, and the command module to run
...
...
@@ -284,7 +284,7 @@ run multiple commands in seperate forks, thanks to the magic behind
Python’s multiprocessing module.</p>
<p>If you need to address 500 machines you can decide if you want to try
to contact 5 at a time, or 50 at a time.
It’s up to you and how much power you can throw at it, but it’s heritage
It’s up to you and how much power you can throw at it, but its heritage
is about handling those kinds of use cases.</p>
<p>There are no daemons so it’s entirely up to you. When you are aren’t using
<liclass="toctree-l3"><aclass="reference internal"href="playbooks.html#external-variables-and-prompted-or-sensitive-data">External Variables And Prompted or Sensitive Data</a></li>
<h3>External Variables And Prompted or Sensitive Data<aclass="headerlink"href="#external-variables-and-prompted-or-sensitive-data"title="Permalink to this headline">¶</a></h3>
<p>It’s a great idea to keep your playbooks under source control, but
...
...
@@ -411,7 +426,7 @@ or it could be something like performing some cleanup steps if a filesystem is g
<p>This is easy to do in Ansible, with the <cite>only_if</cite> clause. This clause can be applied to any task,
and allows usage of variables from anywhere in ansible, either denoted with <cite>$dollar_sign_syntax</cite> or
<cite>{{ braces_syntax }}</cite> and then evaluates them with a Python expression. Don’t panic – it’s actually
pretty simple.:</p>
pretty simple:</p>
<divclass="highlight-python"><pre>vars:
favcolor: blue
is_favcolor_blue: "'$favcolor' == 'blue'"
...
...
@@ -569,7 +584,7 @@ running operations can go faster. The easiest way to do this is
to kick them off all at once and then poll until they are done.</p>
<p>You will also want to use asynchronous mode on very long running
operations that might be subject to timeout.</p>
<p>To launch a task asynchronously, specify it’s maximum runtime
<p>To launch a task asynchronously, specify its maximum runtime
and how frequently you would like to poll for status. The default
poll value is 10 seconds if you do not specify a value for <cite>poll</cite>:</p>