diff options
Diffstat (limited to 'lib/ansible/modules/template.py')
-rw-r--r-- | lib/ansible/modules/template.py | 66 |
1 files changed, 60 insertions, 6 deletions
diff --git a/lib/ansible/modules/template.py b/lib/ansible/modules/template.py index 7ee581ad..8f8ad0bd 100644 --- a/lib/ansible/modules/template.py +++ b/lib/ansible/modules/template.py @@ -18,16 +18,17 @@ options: follow: description: - Determine whether symbolic links should be followed. - - When set to C(true) symbolic links will be followed, if they exist. - - When set to C(false) symbolic links will not be followed. - - Previous to Ansible 2.4, this was hardcoded as C(true). + - When set to V(true) symbolic links will be followed, if they exist. + - When set to V(false) symbolic links will not be followed. + - Previous to Ansible 2.4, this was hardcoded as V(true). type: bool default: no version_added: '2.4' notes: -- For Windows you can use M(ansible.windows.win_template) which uses C(\r\n) as C(newline_sequence) by default. -- The C(jinja2_native) setting has no effect. Native types are never used in the C(template) module which is by design used for generating text files. - For working with templates and utilizing Jinja2 native types see the C(jinja2_native) parameter of the C(template lookup). +- For Windows you can use M(ansible.windows.win_template) which uses V(\\r\\n) as O(newline_sequence) by default. +- The C(jinja2_native) setting has no effect. Native types are never used in the M(ansible.builtin.template) module + which is by design used for generating text files. For working with templates and utilizing Jinja2 native types see + the O(ansible.builtin.template#lookup:jinja2_native) parameter of the P(ansible.builtin.template#lookup) lookup. seealso: - module: ansible.builtin.copy - module: ansible.windows.win_copy @@ -109,3 +110,56 @@ EXAMPLES = r''' validate: /usr/sbin/sshd -t -f %s backup: yes ''' + +RETURN = r''' +dest: + description: Destination file/path, equal to the value passed to I(dest). + returned: success + type: str + sample: /path/to/file.txt +checksum: + description: SHA1 checksum of the rendered file + returned: always + type: str + sample: 373296322247ab85d26d5d1257772757e7afd172 +uid: + description: Numeric id representing the file owner + returned: success + type: int + sample: 1003 +gid: + description: Numeric id representing the group of the owner + returned: success + type: int + sample: 1003 +owner: + description: User name of owner + returned: success + type: str + sample: httpd +group: + description: Group name of owner + returned: success + type: str + sample: www-data +md5sum: + description: MD5 checksum of the rendered file + returned: changed + type: str + sample: d41d8cd98f00b204e9800998ecf8427e +mode: + description: Unix permissions of the file in octal representation as a string + returned: success + type: str + sample: 1755 +size: + description: Size of the rendered file in bytes + returned: success + type: int + sample: 42 +src: + description: Source file used for the copy on the target machine. + returned: changed + type: str + sample: /home/httpd/.ansible/tmp/ansible-tmp-1423796390.97-147729857856000/source +''' |