diff --git a/roles/custom/matrix-appservice-draupnir-for-all/tasks/validate_config.yml b/roles/custom/matrix-appservice-draupnir-for-all/tasks/validate_config.yml index b07a2d2f4..b4a8945b3 100644 --- a/roles/custom/matrix-appservice-draupnir-for-all/tasks/validate_config.yml +++ b/roles/custom/matrix-appservice-draupnir-for-all/tasks/validate_config.yml @@ -13,7 +13,7 @@ with_items: - "matrix_appservice_draupnir_for_all_config_adminRoom" - "matrix_bot_draupnir_container_network" - when: "vars[item] == '' or vars[item] is none" + when: "lookup('vars', item, default='') == '' or lookup('vars', item, default='') is none" - name: (Deprecation) Catch and report renamed matrix-appservice-draupnir-for-all settings ansible.builtin.fail: diff --git a/roles/custom/matrix-authentication-service/tasks/mas_cli_syn2mas.yml b/roles/custom/matrix-authentication-service/tasks/mas_cli_syn2mas.yml index b058d87d8..93ffc4dcc 100644 --- a/roles/custom/matrix-authentication-service/tasks/mas_cli_syn2mas.yml +++ b/roles/custom/matrix-authentication-service/tasks/mas_cli_syn2mas.yml @@ -19,7 +19,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] | string | length == 0" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_authentication_service_syn2mas_synapse_homeserver_config_path', when: true} diff --git a/roles/custom/matrix-bot-matrix-registration-bot/tasks/validate_config.yml b/roles/custom/matrix-bot-matrix-registration-bot/tasks/validate_config.yml index 3021c8537..cf6946fd9 100644 --- a/roles/custom/matrix-bot-matrix-registration-bot/tasks/validate_config.yml +++ b/roles/custom/matrix-bot-matrix-registration-bot/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - "matrix_bot_matrix_registration_bot_bot_password" - "matrix_bot_matrix_registration_bot_api_base_url" diff --git a/roles/custom/matrix-bot-mjolnir/tasks/validate_config.yml b/roles/custom/matrix-bot-mjolnir/tasks/validate_config.yml index 53ef0fdd4..91622e32f 100644 --- a/roles/custom/matrix-bot-mjolnir/tasks/validate_config.yml +++ b/roles/custom/matrix-bot-mjolnir/tasks/validate_config.yml @@ -18,14 +18,14 @@ - {'name': 'matrix_bot_mjolnir_raw_homeserver_url', when: true} - {'name': 'matrix_bot_mjolnir_pantalaimon_username', when: "{{ matrix_bot_mjolnir_pantalaimon_use }}"} - {'name': 'matrix_bot_mjolnir_pantalaimon_password', when: "{{ matrix_bot_mjolnir_pantalaimon_use }}"} - when: "item.when | bool and (vars[item.name] == '' or vars[item.name] is none)" + when: "item.when | bool and (lookup('vars', item.name, default='') == '' or lookup('vars', item.name, default='') is none)" - name: Fail if inappropriate variables are defined ansible.builtin.fail: msg: "The `{{ item.name }}` variable must be undefined or have a null value." with_items: - {'name': 'matrix_bot_mjolnir_access_token', when: "{{ matrix_bot_mjolnir_pantalaimon_use }}"} - when: "item.when | bool and not (vars[item.name] == '' or vars[item.name] is none)" + when: "item.when | bool and not (lookup('vars', item.name, default='') == '' or lookup('vars', item.name, default='') is none)" - name: (Deprecation) Catch and report renamed Mjolnir settings ansible.builtin.fail: diff --git a/roles/custom/matrix-bridge-mautrix-wsproxy/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-wsproxy/tasks/validate_config.yml index 244da474f..8d0a4860a 100644 --- a/roles/custom/matrix-bridge-mautrix-wsproxy/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-wsproxy/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - "matrix_mautrix_androidsms_appservice_token" - "matrix_mautrix_androidsms_homeserver_token" diff --git a/roles/custom/matrix-bridge-sms/tasks/validate_config.yml b/roles/custom/matrix-bridge-sms/tasks/validate_config.yml index 2830ae8bb..ef1069d29 100644 --- a/roles/custom/matrix-bridge-sms/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-sms/tasks/validate_config.yml @@ -11,7 +11,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - "matrix_sms_bridge_appservice_token" - "matrix_sms_bridge_homeserver_hostname" diff --git a/roles/custom/matrix-cactus-comments-client/tasks/validate_config.yml b/roles/custom/matrix-cactus-comments-client/tasks/validate_config.yml index fc3901551..b76cc963a 100644 --- a/roles/custom/matrix-cactus-comments-client/tasks/validate_config.yml +++ b/roles/custom/matrix-cactus-comments-client/tasks/validate_config.yml @@ -8,7 +8,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - matrix_cactus_comments_client_hostname - matrix_cactus_comments_client_path_prefix diff --git a/roles/custom/matrix-cactus-comments/tasks/validate_config.yml b/roles/custom/matrix-cactus-comments/tasks/validate_config.yml index 71ae8f935..c1df48a06 100644 --- a/roles/custom/matrix-cactus-comments/tasks/validate_config.yml +++ b/roles/custom/matrix-cactus-comments/tasks/validate_config.yml @@ -24,7 +24,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - "matrix_cactus_comments_as_token" - "matrix_cactus_comments_hs_token" diff --git a/roles/custom/matrix-client-fluffychat/tasks/validate_config.yml b/roles/custom/matrix-client-fluffychat/tasks/validate_config.yml index f11b81d65..01b6f93e0 100644 --- a/roles/custom/matrix-client-fluffychat/tasks/validate_config.yml +++ b/roles/custom/matrix-client-fluffychat/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item }}`) for using FluffyChat Web. - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - matrix_client_fluffychat_container_network @@ -27,7 +27,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - matrix_client_fluffychat_container_labels_traefik_hostname - matrix_client_fluffychat_container_labels_traefik_path_prefix diff --git a/roles/custom/matrix-client-hydrogen/tasks/validate_config.yml b/roles/custom/matrix-client-hydrogen/tasks/validate_config.yml index 6f1ced098..9a048b56e 100644 --- a/roles/custom/matrix-client-hydrogen/tasks/validate_config.yml +++ b/roles/custom/matrix-client-hydrogen/tasks/validate_config.yml @@ -30,7 +30,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - matrix_client_hydrogen_container_labels_traefik_hostname - matrix_client_hydrogen_container_labels_traefik_path_prefix diff --git a/roles/custom/matrix-client-schildichat/tasks/validate_config.yml b/roles/custom/matrix-client-schildichat/tasks/validate_config.yml index df87b4356..d0477fe2e 100644 --- a/roles/custom/matrix-client-schildichat/tasks/validate_config.yml +++ b/roles/custom/matrix-client-schildichat/tasks/validate_config.yml @@ -20,7 +20,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item }}`) for using SchildiChat Web. - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - matrix_client_schildichat_default_hs_url - matrix_client_schildichat_container_network @@ -39,7 +39,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - matrix_client_schildichat_container_labels_traefik_hostname - matrix_client_schildichat_container_labels_traefik_path_prefix diff --git a/roles/custom/matrix-ldap-registration-proxy/tasks/validate_config.yml b/roles/custom/matrix-ldap-registration-proxy/tasks/validate_config.yml index 3fc080949..289dd570a 100644 --- a/roles/custom/matrix-ldap-registration-proxy/tasks/validate_config.yml +++ b/roles/custom/matrix-ldap-registration-proxy/tasks/validate_config.yml @@ -11,7 +11,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - "matrix_ldap_registration_proxy_hostname" - "matrix_ldap_registration_proxy_ldap_uri" diff --git a/roles/custom/matrix-pantalaimon/tasks/validate_config.yml b/roles/custom/matrix-pantalaimon/tasks/validate_config.yml index a6b764815..7117741cf 100644 --- a/roles/custom/matrix-pantalaimon/tasks/validate_config.yml +++ b/roles/custom/matrix-pantalaimon/tasks/validate_config.yml @@ -9,7 +9,7 @@ msg: "The `{{ item }}` variable must be defined and have a non-null value." with_items: - "matrix_pantalaimon_homeserver_url" - when: "vars[item] == '' or vars[item] is none" + when: "lookup('vars', item, default='') == '' or lookup('vars', item, default='') is none" - name: (Deprecation) Catch and report renamed Pantalaimon variables ansible.builtin.fail: diff --git a/roles/custom/matrix-rageshake/tasks/validate_config.yml b/roles/custom/matrix-rageshake/tasks/validate_config.yml index 4b1249372..19edb6197 100644 --- a/roles/custom/matrix-rageshake/tasks/validate_config.yml +++ b/roles/custom/matrix-rageshake/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - matrix_rageshake_hostname - matrix_rageshake_path_prefix @@ -29,7 +29,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - matrix_rageshake_container_labels_traefik_hostname - matrix_rageshake_container_labels_traefik_path_prefix diff --git a/roles/custom/matrix-sygnal/tasks/validate_config.yml b/roles/custom/matrix-sygnal/tasks/validate_config.yml index dfb806a18..a524fc1f4 100644 --- a/roles/custom/matrix-sygnal/tasks/validate_config.yml +++ b/roles/custom/matrix-sygnal/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - matrix_sygnal_hostname - matrix_sygnal_path_prefix @@ -21,7 +21,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - matrix_sygnal_container_labels_traefik_hostname - matrix_sygnal_container_labels_traefik_path_prefix diff --git a/roles/custom/matrix-synapse/tasks/validate_config.yml b/roles/custom/matrix-synapse/tasks/validate_config.yml index 3f25cc934..7e0595eff 100644 --- a/roles/custom/matrix-synapse/tasks/validate_config.yml +++ b/roles/custom/matrix-synapse/tasks/validate_config.yml @@ -138,7 +138,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`) when enabling `matrix_synapse_container_image_customizations_templates_enabled`. - when: "vars[item] == ''" + when: "lookup('vars', item, default='') == ''" with_items: - matrix_synapse_container_image_customizations_templates_git_repository_url - matrix_synapse_container_image_customizations_templates_git_repository_branch @@ -147,7 +147,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`) when enabling `matrix_synapse_container_image_customizations_templates_git_repository_keyscan`. - when: "matrix_synapse_container_image_customizations_templates_git_repository_keyscan_enabled | bool and vars[item] == ''" + when: "matrix_synapse_container_image_customizations_templates_git_repository_keyscan_enabled | bool and lookup('vars', item, default='') == ''" with_items: - matrix_synapse_container_image_customizations_templates_git_repository_keyscan_hostname