mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
rebuild
This commit is contained in:
10
api.html
10
api.html
@@ -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 ‘webserver’ 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 ‘webserver’ 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 ‘foo’:</p>
|
||||
<div class="highlight-python"><pre>Welcome, I am templated with a value of a=2, b=3, and c=4</pre>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user