1
0
mirror of https://github.com/spantaleev/matrix-docker-ansible-deploy.git synced 2025-08-04 21:43:06 +02:00

Explicitly tell template-lookup to not auto-parse JSON files

ansible-core>=2.19.0 only auto-parses YAML files, not JSON.

Previous ansible-core versions auto-parsed JSON as well, but ansible-core>=2.19.0
doesn't, so we added a `from_json` post-filter.
However, older versions auto-parsing JSON and turning it into a dict, on
which we later run `from_json` is no good.

In this patch, we try to equalize behavior and configure Ansible to never parse JSON,
hopefully making old-Ansible behave like new Ansible.

Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/4458

Ref: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_lookup.html#parameter-convert_data
This commit is contained in:
Slavi Pantaleev
2025-07-27 07:42:54 +03:00
parent 4ef78bdb7f
commit d876da4186
7 changed files with 11 additions and 11 deletions

View File

@ -170,7 +170,7 @@ matrix_client_hydrogen_bugReportEndpointUrl: "https://element.io/bugreports/subm
#
# The side-effect of this lookup is that Ansible would even parse the JSON for us, returning a dict.
# This is unlike what it does when looking up YAML template files (no automatic parsing there).
matrix_client_hydrogen_configuration_default: "{{ lookup('template', 'templates/config.json.j2') | from_json }}"
matrix_client_hydrogen_configuration_default: "{{ lookup('template', 'templates/config.json.j2', convert_data=False) | from_json }}"
# Your custom JSON configuration for Hydrogen should go to `matrix_client_hydrogen_configuration_extension_json`.
# This configuration extends the default starting configuration (`matrix_client_hydrogen_configuration_default`).