New in version 1.9.2.
Parameter |
Choices/Defaults |
Comments |
---|---|---|
block_end_string
(added in 2.4) |
Default:
%}
|
The string marking the end of a block.
|
block_start_string
(added in 2.4) |
Default:
{%
|
The string marking the beginning of a block.
|
dest
required |
|
Location to render the template to on the remote machine.
|
force
(added in 2.4) |
|
the default is
yes , which will replace the remote file when contents are different than the source. If no , the file will only be transferred if the destination does not exist. |
newline_sequence
(added in 2.4) |
|
Specify the newline sequence to use for templating files.
|
src
required |
|
Path of a Jinja2 formatted template on the local server. This can be a relative or absolute path.
|
trim_blocks
(added in 2.4) |
Default:
no
|
If this is set to True the first newline after a block is removed (block, not variable tag!).
|
variable_end_string
(added in 2.4) |
Default:
}}
|
The string marking the end of a print statement.
|
variable_start_string
(added in 2.4) |
Default:
{{
|
The string marking the beginning of a print statement.
|
Note
- name: Create a file from a Jinja2 template
win_template:
src: /mytemplates/file.conf.j2
dest: C:\temp\file.conf
- name: Create a Unix-style file from a Jinja2 template
win_template:
src: unix/config.conf.j2
dest: C:\share\unix\config.conf
newline_sequence: '\n'
This module is flagged as stableinterface which means that the maintainers for this module guarantee that no backward incompatible interface changes will be made.
For more information about Red Hat’s support of this module, please refer to this Knowledge Base article
Hint
If you notice any issues in this documentation you can edit this document to improve it.