From f71134cb980dd7c9959b73650ab2e39c9689858a Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Wed, 12 Oct 2016 17:43:54 -0400 Subject: [PATCH] Change example syntax on template module --- lib/ansible/modules/files/template.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/files/template.py b/lib/ansible/modules/files/template.py index 6b38a92575..3e42462125 100644 --- a/lib/ansible/modules/files/template.py +++ b/lib/ansible/modules/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." @@ -79,11 +79,24 @@ extends_documentation_fragment: validate 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' '''