I'm writing a lot of Salt states and I want to use the do tag extension as suggested in this StackOverflow answer.
According to the Salt docs, I should be able to edit /etc/salt/master
to add these lines:
jinja_env:
extensions: ['jinja2.ext.do']
jinja_sls_env:
extensions: ['jinja2.ext.do']
and then restart the salt-master
service and have access to the do
tag. However, I tried that and I get the same error as before, so it's not recognizing the tag.
I've confirmed that the extension is available on the server by testing it at the command line:
>>> import jinja2
>>> jinja2.Environment(extensions=['jinja2.ext.do']).parse(open('/path/to/mytemplate.jinja').read())
Template(body=[...])
What am I missing? How do I configure Salt to use the {% do %}
Jinja tag?