I have some variables defined in a role such as:
---
# file: roles/consul/defaults/main.yml
consul_server: yes
And then I have a JSON template file with many settings for the software I am provisioning, but just for example:
{
"server": {{ consul_server | bool }}
}
When Ansible/Jinja2 process the template I end up with an invalid JSON object because 'True' is not a valid JSON keyword:
I ended up doing this:
{
"server": {{ consul_server | bool | lower }}
}
Which works... but it gets sloppy when there are a ton of variables in a file.
So my question, what is the proper way to interpolate boolean values in a JSON file?
Thank you for reading. Looking forward to the response(s).
Regards,
Phil