Howdy,
One of the changes to 1.6.6 dropped support for jinja2 template
directives: https://github.com/ansible/ansible/commit/3761bc113295e20771544491d007f1d328f40b99
I'd been leaning on that pretty heavily to convert a project to
Ansible, and I'm not really looking forward to auditing a couple
hundred templates. Is there a different way to disable trim_blocks?
Cheers,
Yes, they did, and this was unfortunate.
This was a fix to prevent nodes from returning facts that contain Jinja2 expressions (which long story short could result in some hijinx), and because the filter choices are made in the template here, we had to remove the feature for allowing the block delimiters like {{ and {% to be changed in order to reliably filter these out.
Now, I think what we should probably do (it would have to be on the devel branch) is make this option ONLY be able to set trim_blocks (and maybe another whitelist of certain options).
Is this something you might like to take a crack at?
trim_blocks themselves was never a problem.
The end/start block functionality is very useful, I’m thinking it could be made ‘safe’ by ‘re cleaning’ the data if they get changed on override. I have the patch 1/2 done in my head, I should be able to tackle it this weekend if this approach is acceptable.
Would totally be open to looking at it…
Yes: https://github.com/ansible/ansible/pull/8026
It doesn’t raise an error for settings Ansible no longer supports, primarily because I couldn’t figure out the plumbing. But it is a whitelist, and it does work, so there’s that.
I’ve merged this now on devel for people that need this feature. We’re open to expanding the whitelist if needed, and will also see what Brian comes up with in terms of upgrades.
Thanks!