ansible/docsite/rst/modules/template.rst
2012-10-08 07:44:38 -04:00

1.6 KiB

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/).

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
      • yes
      • 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
        


        Notes

        Since Ansible version 0.9, templates are loaded with trim_blocks=True.