From 1f6c3766b04b5a5ae44b710c9c5a1b0468cc498e Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 15 Jun 2016 17:01:46 -0400 Subject: [PATCH] restored incorrectly removed docs, jinja2 override --- lib/ansible/modules/files/template.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/files/template.py b/lib/ansible/modules/files/template.py index acdae6e40fd..6b38a925752 100644 --- a/lib/ansible/modules/files/template.py +++ b/lib/ansible/modules/files/template.py @@ -63,7 +63,13 @@ options: default: "yes" notes: - "Since Ansible version 0.9, templates are loaded with C(trim_blocks=True)." -requirements: [] + - "Also, you can override jinja2 settings by adding a special header to template file. + i.e. C(#jinja2:variable_start_string:'[%' , variable_end_string:'%]', trim_blocks: False) + which changes the variable interpolation markers to [% var %] instead of {{ var }}. + This is the best way to prevent evaluation of things that look like, but should not be Jinja2. + raw/endraw in Jinja2 will not work as you expect because templates in Ansible are recursively evaluated." + + author: - Ansible Core Team - Michael DeHaan