jinja2-cli
jinja2-cli copied to clipboard
Parse ansible '#jinja2:' overrides
This change allows to use ansible templates as is
Is there documentation around what this format is? I've never seen this before.
Is there documentation around what this format is? I've never seen this before.
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_module.html
Also, you can override jinja2 settings by adding a special header to template file. i.e. #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.
Basically, any jinja2 environment variables can be set this way