Open zet694 opened 9 months ago
When I examine such files, they are valid JSON. I suspect something else is going wrong here. Can you please paste the literal contents of said JSON files from your hosts after running this role?
@nre-ableton I just ran into this this morning. The problem is here. https://github.com/ansible-collections/ansible-consul/blob/master/templates/config.json.j2#L37 when these options are used...
vars:
consul_tls_enable: false
consul_dnsmasq_enable: false
I changed ...
{% if consul_version is version_compare('1.14.0', '>=') %}
"grpc_tls": "{{ consul_addresses.grpc_tls }}",
{% endif %}
to
{% if consul_version is version_compare('1.14.0', '>=') and consul_tls_enable %}
"grpc_tls": "{{ consul_addresses.grpc_tls }}",
{% endif %}
To work around the problem.
[edit] maybe this isn't the same problem but the issue search took me here :)
@matutter Very nice, that makes sense. Would you be so kind as to submit a PR? :pray:
Hi! When I use the default templates they come out in str format and not json as I expect, why can this happen?
This is the case with all files in which the template is used (consul.json, server.json, bootstrap.json etc).
Ansible version:
My variables: