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

Pass the result of JSON-file template lookups through from_json for better ansible-core>=2.19.0 compatibility

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

It seems like ansible-core 2.19.0 no longer automatically parses template lookup content
as JSON (into a dict) when dealing with template files (be it `file.json.j2` or `file.j2`).

For files detected to contain YAML (`.ya?ml.j2`, but possibly others),
it automatically parses YAML, because the `convert_data` option
for the template lookup defaults to `true`.
Ref: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_lookup.html
This commit is contained in:
Slavi Pantaleev
2025-07-26 18:41:40 +03:00
parent f2524902af
commit 90813b3739
7 changed files with 11 additions and 11 deletions

View File

@ -231,7 +231,7 @@ matrix_client_schildichat_setting_defaults_custom_themes: [] # noqa var-naming
#
# 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_schildichat_configuration_default: "{{ lookup('template', 'templates/config.json.j2') }}"
matrix_client_schildichat_configuration_default: "{{ lookup('template', 'templates/config.json.j2') | from_json }}"
# Your custom JSON configuration for SchildiChat Web should go to `matrix_client_schildichat_configuration_extension_json`.
# This configuration extends the default starting configuration (`matrix_client_schildichat_configuration_default`).
@ -269,7 +269,7 @@ matrix_client_schildichat_location_sharing_enabled: false
#
# 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_schildichat_location_sharing_map_style_default: "{{ lookup('template', 'templates/map_style.json.j2') }}"
matrix_client_schildichat_location_sharing_map_style_default: "{{ lookup('template', 'templates/map_style.json.j2') | from_json }}"
# Your custom JSON configuration for SchildiChat location sharing map style should go to `matrix_client_schildichat_location_sharing_map_style_extension_json`.
# This configuration extends the default starting configuration (`matrix_client_schildichat_location_sharing_map_style_default`).