This commit is contained in:
Michael DeHaan 2012-08-09 22:12:10 -04:00
commit b721176bdd
6 changed files with 131 additions and 72 deletions

View file

@ -317,9 +317,13 @@ Welcome, I am templated with a value of a={{ a }}, b={{ b }}, and c={{ c }}</pre
<div class="highlight-python"><pre>ansible webserver -m setup
ansible webserver -m template -a "src=/tmp/motd.j2 dest=/etc/motd"</pre>
</div>
<p>Note that the name &#8216;webserver&#8217; came from cobbler, as did the variables for the config file. You can still
pass in your own variables like normal in Ansible, but variables from the external inventory script will
override any that have the same name.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The name &#8216;webserver&#8217; came from cobbler, as did the variables for
the config file. You can still pass in your own variables like
normal in Ansible, but variables from the external inventory script
will override any that have the same name.</p>
</div>
<p>So, with the template above (motd.j2), this would result in the following data being written to /etc/motd for system &#8216;foo&#8217;:</p>
<div class="highlight-python"><pre>Welcome, I am templated with a value of a=2, b=3, and c=4</pre>
</div>