.. _template: template `````````````````````````````` Templates are processed by the Jinja2 templating language (http://jinja.pocoo.org/docs/) - documentation on the template formatting can be found in the Template Designer Documentation (http://jinja.pocoo.org/docs/templates/). .. raw:: html
parameter | required | default | choices | comments |
---|---|---|---|---|
dest | yes | Location to render the template to on the remote machine. | ||
src | yes | Path of a Jinja2 formatted template on the local server. This can be a relative or absolute path. | ||
backup | no | no |
|
Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. |
others | no | all arguments accepted by the file module also work here |
Example from Ansible Playbooks
template src=/mytemplates/foo.j2 dest=/etc/file.conf owner=bin group=wheel mode=0644
Since Ansible version 0.9, templates are loaded with trim_blocks=True
.