Przeglądaj źródła

Fix "'list object' has no attribute 'keys'" in deprecation checks

The variables holding matched deprecated variable names used to be
dictionaries (built via `vars | dict2items | ... | items2dict`), so
calling `.keys()` on them was correct.

Since a1f6ee4dc9b92fdb520627ec22265b800f73a6f8, they are lists produced
by the `ansible.builtin.varnames` lookup, but 15 of the messages
consuming them were left calling `.keys()`.

The failing tasks are gated behind a `| length > 0` condition, so only
people who actually still carry one of these deprecated variables would
hit this. Such people were greeted by a cryptic templating error instead
of the message telling them what to rename or remove.

Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/5491

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pull/5494/head
Slavi Pantaleev 2 dni temu
rodzic
commit
bd8a79c974
1 zmienionych plików z 15 dodań i 15 usunięć
  1. +15
    -15
      roles/custom/matrix_playbook_migration/tasks/validate_config.yml

+ 15
- 15
roles/custom/matrix_playbook_migration/tasks/validate_config.yml Wyświetl plik

@@ -188,7 +188,7 @@

After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so.

The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_vars.keys() | join(', ') }}
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_vars | join(', ') }}
when: "matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_vars | length > 0"

- when: matrix_playbook_migration_matrix_backup_borg_migration_validation_enabled | bool
@@ -207,7 +207,7 @@

After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so.

The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_backup_borg_migration_vars.keys() | join(', ') }}
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_backup_borg_migration_vars | join(', ') }}
when: "matrix_playbook_migration_backup_borg_migration_vars | length > 0"

- when: matrix_playbook_migration_matrix_grafana_migration_validation_enabled | bool
@@ -226,7 +226,7 @@

After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so.

The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_grafana_migration_vars.keys() | join(', ') }}
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_grafana_migration_vars | join(', ') }}
when: "matrix_playbook_migration_grafana_migration_vars | length > 0"

- when: matrix_playbook_migration_matrix_ntfy_migration_validation_enabled | bool
@@ -245,7 +245,7 @@

After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so.

The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_ntfy_migration_vars.keys() | join(', ') }}
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_ntfy_migration_vars | join(', ') }}
when: "matrix_playbook_migration_ntfy_migration_vars | length > 0"

- when: matrix_playbook_migration_matrix_redis_migration_validation_enabled | bool
@@ -264,7 +264,7 @@

After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so.

The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_redis_migration_vars.keys() | join(', ') }}
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_redis_migration_vars | join(', ') }}
when: "matrix_playbook_migration_redis_migration_vars | length > 0"

- when: matrix_playbook_migration_redis_valkey_migration_validation_enabled | bool
@@ -282,7 +282,7 @@

After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so.

The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_redis_migration_vars.keys() | join(', ') }}
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_redis_migration_vars | join(', ') }}
when: "matrix_playbook_migration_redis_migration_vars | length > 0"

- when: matrix_playbook_migration_keydb_valkey_migration_validation_enabled | bool
@@ -300,7 +300,7 @@

After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so.

The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_keydb_migration_vars.keys() | join(', ') }}
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_keydb_migration_vars | join(', ') }}
when: "matrix_playbook_migration_keydb_migration_vars | length > 0"

- when: matrix_playbook_migration_matrix_etherpad_migration_validation_enabled | bool
@@ -319,7 +319,7 @@

After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so.

The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_etherpad_migration_vars.keys() | join(', ') }}
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_etherpad_migration_vars | join(', ') }}
when: "matrix_playbook_migration_etherpad_migration_vars | length > 0"

- when: matrix_playbook_migration_matrix_aux_migration_validation_enabled | bool
@@ -338,7 +338,7 @@

After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so.

The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_aux_migration_vars.keys() | join(', ') }}
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_aux_migration_vars | join(', ') }}
when: "matrix_playbook_migration_aux_migration_vars | length > 0"

- when: matrix_playbook_migration_matrix_jitsi_migration_validation_enabled | bool
@@ -357,7 +357,7 @@

After renaming them, please do not forget to fetch the Ansible role. See docs/maintenance-upgrading-services.md for details about how to do so.

The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_jitsi_migration_vars.keys() | join(', ') }}
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_jitsi_migration_vars | join(', ') }}
when: "matrix_playbook_migration_jitsi_migration_vars | length > 0"

- when: matrix_playbook_migration_matrix_bridge_postmoogle_migration_validation_enabled | bool
@@ -373,7 +373,7 @@

Please rename all variables (`matrix_bot_postmoogle_` -> `matrix_bridge_postmoogle_`) on your configuration file (vars.yml).

The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_postmoogle_migration_vars.keys() | join(', ') }}
The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_postmoogle_migration_vars | join(', ') }}
when: "matrix_playbook_migration_postmoogle_migration_vars | length > 0"

- when: matrix_playbook_migration_matrix_nginx_proxy_elimination_variable_transition_checks_enabled | bool
@@ -479,7 +479,7 @@

You should remove all its variables (`matrix_nginx_proxy_*`) from your configuration file (vars.yml).

The following variables in your configuration should be renamed: {{ matrix_playbook_migration_nginx_proxy_migration_vars.keys() | join(', ') }}
The following variables in your configuration should be renamed: {{ matrix_playbook_migration_nginx_proxy_migration_vars | join(', ') }}
when: "matrix_playbook_migration_nginx_proxy_migration_vars | length > 0"

- when: matrix_playbook_migration_matrix_ssl_leftover_variable_checks_enabled | bool
@@ -495,7 +495,7 @@

You should remove all its variables (`matrix_ssl_*`) from your configuration file (vars.yml).

The following variables in your configuration should be renamed: {{ matrix_playbook_migration_ssl_migration_vars.keys() | join(', ') }}
The following variables in your configuration should be renamed: {{ matrix_playbook_migration_ssl_migration_vars | join(', ') }}
when: "matrix_playbook_migration_ssl_migration_vars | length > 0"

- block:
@@ -506,7 +506,7 @@
- name: (Deprecation) Catch and report matrix_ssl variables
ansible.builtin.fail:
msg: >-
We found usage of the following variables which are now removed: {{ matrix_playbook_migration_matrix_synapse_container_labels_public_client_synapse_oidc_vars.keys() | join(', ') }}
We found usage of the following variables which are now removed: {{ matrix_playbook_migration_matrix_synapse_container_labels_public_client_synapse_oidc_vars | join(', ') }}
when: "matrix_playbook_migration_matrix_synapse_container_labels_public_client_synapse_oidc_vars | length > 0"

- block:
@@ -517,7 +517,7 @@
- name: (Deprecation) Catch and report matrix_ssl variables
ansible.builtin.fail:
msg: >-
We found usage of the following variables which are now removed: {{ matrix_playbook_migration_matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_oidc_vars.keys() | join(', ') }}
We found usage of the following variables which are now removed: {{ matrix_playbook_migration_matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_oidc_vars | join(', ') }}
when: "matrix_playbook_migration_matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_oidc_vars | length > 0"

- name: (Deprecation) Catch and report devture_postgres_backup variables


Ładowanie…
Anuluj
Zapisz