I have some variables defined in a role such as:
`
I have some variables defined in a role such as:
`
Hi Phil
Don’t know if there is an official short way to do this, but there is a ‘to_json’ filter which seems to work on simple booleans, which could be slightly preferable to ‘lower’?
Tom
the capitalized boolean happens because this is how valid booleans
work in jinja2/python, which is what ansible uses internally.
as @tom suggested there is a to_json filter which will output correct
json from ansible data structures/variables.
Maybe to_json is better than to_yaml and apparently have been superseded by to_nice_json / to_nice_yaml but the to_yaml / to_nice_yaml filters are crap, not well documented within jinja2, and require understanding the actual pyyaml library function interface to make work. In short, all of it feels bad.