templating templates??

27 views
Skip to first unread message

Dick Davies

unread,
Mar 19, 2015, 6:52:09 AM3/19/15
to ansible list
Morning

I need to push out a Go template file that needs some environment
specific settings, so tried to template the template
(yes, a bit 'yo dawg' i know).

Of course this blows up as both jinja2 and go templating use double
mustaches '{{ foo }}' .

Has anyone got a workaround for this?

Maybe changing the jinja2 delimiters just for this one file?

Dick Davies

unread,
Mar 19, 2015, 7:09:42 AM3/19/15
to ansible list
Never mind, just found {% raw %} ..... {% endraw %}

Jon Soul

unread,
Mar 19, 2015, 7:10:08 AM3/19/15
to ansible...@googlegroups.com, di...@hellooperator.net
Is this what you're looking for: http://jinja.pocoo.org/docs/dev/templates/#escaping?

Either use {% raw % } or {{ '{{' }} depending on your use case.
Reply all
Reply to author
Forward
0 new messages