I’m just getting started with playing with templates, having never used jinja2 before. I’ve written a very simple template:
stacktype={{ stacktype }}
{% if stacktype == “stg” %}
test
{% endif %}
end
My hosts script defines the stacktype variable:
“stacktype” : [
“stg”
],
When I run my playbook and look at the resulting file I get the following:
stacktype=[u’stg’]
end
Why is the variable being reported as [u’stg’] instead of just “stg”? What’s the correct way to use this in a jinja2 conditional?
-Bruce