I’m attempting to use Ansible to install Exim configs using the template module, which is problematic since Exim uses both dollars and curly braces as part of its config syntax.
The only workaround I’ve found is to wrap things in the {% raw %} … {% endraw %} tags, which is clumsy. From reading around it sounds like it is possible to change the delimiter but only at the Python API level.
Assuming I need to template the configs, is there some way of stopping Jinja2 from trying to expand {{ … }} and ${ … } in selected templates?
Sounds good, and I'd like to help out but unfortunately I'm not well tooled to create such a patch, not having much Python hacking experience so far. Pointers where to look would help to encourage me to try fixing this.
the trick about making it a config option would make it that way for
ALL templates, so I was proposing we have some way to include that
info commented out at the top of the template, almost like a shebang
interpeter line
I was trying to avoid either opening the file before calling jinja2 or forcing jinja2 to reevaluate it’s own environment and reprocess the current template, but it does give you the most ‘flexible’ interface for the person writing the template.
It should not be too hard to write, just need some time.