<h3>Accessing Information About Other Hosts<aclass="headerlink"href="#accessing-information-about-other-hosts"title="Permalink to this headline">¶</a></h3>
<h2>Accessing Information About Other Hosts<aclass="headerlink"href="#accessing-information-about-other-hosts"title="Permalink to this headline">¶</a></h2>
<p>If your database server wants to check the value of a ‘fact’ from another node, or an inventory variable
assigned to another node, it’s easy to do so within a template or even an action line:</p>
<p>Don’t worry about any of this unless you think you need it. You’ll know when you do.</p>
</div>
<divclass="section"id="variable-file-seperation">
<h3>Variable File Seperation<aclass="headerlink"href="#variable-file-seperation"title="Permalink to this headline">¶</a></h3>
<h2>Variable File Seperation<aclass="headerlink"href="#variable-file-seperation"title="Permalink to this headline">¶</a></h2>
<p>It’s a great idea to keep your playbooks under source control, but
you may wish to make the playbook source public while keeping certain
important variables private. Similarly, sometimes you may just
...
...
@@ -305,7 +314,7 @@ password: magic</pre>
<p>NOTE: It’s also possible to keep per-host and per-group variables in very similar files, this is covered in <aclass="reference internal"href="patterns.html#patterns"><em>Inventory & Patterns</em></a>.</p>
<h3>Passing Variables On The Command Line<aclass="headerlink"href="#passing-variables-on-the-command-line"title="Permalink to this headline">¶</a></h3>
<h2>Passing Variables On The Command Line<aclass="headerlink"href="#passing-variables-on-the-command-line"title="Permalink to this headline">¶</a></h2>
<p>In addition to <cite>vars_prompt</cite> and <cite>vars_files</cite>, it is possible to send variables over
the ansible command line. This is particularly useful when writing a generic release playbook
where you may want to pass in the version of the application to deploy:</p>
<h3>Selecting Files And Templates Based On Variables<aclass="headerlink"href="#selecting-files-and-templates-based-on-variables"title="Permalink to this headline">¶</a></h3>
<h2>Selecting Files And Templates Based On Variables<aclass="headerlink"href="#selecting-files-and-templates-based-on-variables"title="Permalink to this headline">¶</a></h2>
<p>Sometimes a configuration file you want to copy, or a template you will use may depend on a variable.
The following construct selects the first available file appropriate for the variables of a given host,
which is often much cleaner than putting a lot of if conditionals in a template.</p>
Ansible is used by all sorts of organizations from hosted web applications, media companies, universities, consultancies, and ISVs -- all over the world. Some of these users include:
and lots of other people (you should see our Google Analytics data). Tweet at `Michael DeHaan <http://twitter.com/laserllama>`_ or `email him <mailto:michael.dehaan@gmail.com>`_ to get your company or project listed here. (It's free!)
<p>Ansible is used by all sorts of organizations from hosted web applications, media companies, universities, consultancies, and ISVs – all over the world. Some of these users include:</p>
<td>Running some of the biggest web sites in Europe</td>
</tr>
</tbody>
</table>
<p>and lots of other people (you should see our Google Analytics data). Tweet at <aclass="reference external"href="http://twitter.com/laserllama">Michael DeHaan</a> or <aclass="reference external"href="mailto:michael.dehaan%40gmail.com">email him</a> to get your company or project listed here. (It’s free!)</p>