summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorSam Doran <sdoran@ansible.com>2016-10-12 17:43:54 -0400
committerSam Doran <sdoran@ansible.com>2016-11-14 14:12:43 -0500
commit2ae8840c2c95400e6b612ffb25fcc8c2e44e0f3a (patch)
treee436904960a718fc842f2b1dd555e5c0714150de /files
parentcc8cdd9506d283937afc906e7d3bf3afa7ad4eb4 (diff)
downloadansible-modules-core-2ae8840c2c95400e6b612ffb25fcc8c2e44e0f3a.tar.gz
Change example syntax on template module
Diffstat (limited to 'files')
-rw-r--r--files/template.py25
1 files changed, 19 insertions, 6 deletions
diff --git a/files/template.py b/files/template.py
index 5ee903a7..c7ff655c 100644
--- a/files/template.py
+++ b/files/template.py
@@ -25,12 +25,12 @@ description:
(U(http://jinja.pocoo.org/docs/)) - documentation on the template
formatting can be found in the Template Designer Documentation
(U(http://jinja.pocoo.org/docs/templates/)).
- - "Six additional variables can be used in templates: C(ansible_managed)
+ - "Six additional variables can be used in templates: C(ansible_managed)
(configurable via the C(defaults) section of C(ansible.cfg)) contains a string
which can be used to describe the template name, host, modification time of the
- template file and the owner uid, C(template_host) contains the node name of
+ template file and the owner uid, C(template_host) contains the node name of
the template's machine, C(template_uid) the owner, C(template_path) the
- absolute path of the template, C(template_fullpath) is the absolute path of the
+ absolute path of the template, C(template_fullpath) is the absolute path of the
template, and C(template_run_date) is the date that the template was rendered. Note that including
a string that uses a date in the template will result in the template being marked 'changed'
each time."
@@ -77,11 +77,24 @@ extends_documentation_fragment:
EXAMPLES = '''
# Example from Ansible Playbooks
-- template: src=/mytemplates/foo.j2 dest=/etc/file.conf owner=bin group=wheel mode=0644
+- template:
+ src: /mytemplates/foo.j2
+ dest: /etc/file.conf
+ owner: bin
+ group: wheel
+ mode: 0644
# The same example, but using symbolic modes equivalent to 0644
-- template: src=/mytemplates/foo.j2 dest=/etc/file.conf owner=bin group=wheel mode="u=rw,g=r,o=r"
+- template:
+ src: /mytemplates/foo.j2
+ dest: /etc/file.conf
+ owner: bin
+ group: wheel
+ mode: "u=rw,g=r,o=r"
# Copy a new "sudoers" file into place, after passing validation with visudo
-- template: src=/mine/sudoers dest=/etc/sudoers validate='visudo -cf %s'
+- template:
+ src: /mine/sudoers
+ dest: /etc/sudoers
+ validate: 'visudo -cf %s'
'''