diff --git a/roles/custom/matrix-alertmanager-receiver/tasks/validate_config.yml b/roles/custom/matrix-alertmanager-receiver/tasks/validate_config.yml index 77ecdce2a..3a75616d6 100644 --- a/roles/custom/matrix-alertmanager-receiver/tasks/validate_config.yml +++ b/roles/custom/matrix-alertmanager-receiver/tasks/validate_config.yml @@ -7,7 +7,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_alertmanager_receiver_hostname', when: true} - {'name': 'matrix_alertmanager_receiver_path_prefix', when: true} @@ -21,6 +21,6 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_alertmanager_receiver_container_image_name_prefix', 'new': 'matrix_alertmanager_receiver_container_image_registry_prefix'} diff --git a/roles/custom/matrix-appservice-double-puppet/tasks/validate_config.yml b/roles/custom/matrix-appservice-double-puppet/tasks/validate_config.yml index abe7b371b..97d482d6e 100644 --- a/roles/custom/matrix-appservice-double-puppet/tasks/validate_config.yml +++ b/roles/custom/matrix-appservice-double-puppet/tasks/validate_config.yml @@ -7,7 +7,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_appservice_double_puppet_registration_as_token', when: true} - {'name': 'matrix_appservice_double_puppet_registration_as_token', when: true} 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 95ed9fde3..b07a2d2f4 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 @@ -20,7 +20,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_appservice_draupnir_for_all_docker_image_name_prefix', 'new': 'matrix_appservice_draupnir_for_all_docker_image_registry_prefix'} - {'old': 'matrix_appservice_draupnir_for_all_enable_room_state_backing_store', 'new': 'matrix_appservice_draupnir_for_all_config_roomStateBackingStore_enabled'} diff --git a/roles/custom/matrix-authentication-service/tasks/validate_config.yml b/roles/custom/matrix-authentication-service/tasks/validate_config.yml index d3c47844f..675e0a13f 100644 --- a/roles/custom/matrix-authentication-service/tasks/validate_config.yml +++ b/roles/custom/matrix-authentication-service/tasks/validate_config.yml @@ -40,7 +40,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_authentication_service_container_image_name_prefix', 'new': 'matrix_authentication_service_container_image_registry_prefix'} - {'old': 'matrix_authentication_service_syn2mas_container_image_name_prefix', 'new': 'matrix_authentication_service_syn2mas_container_image_registry_prefix'} diff --git a/roles/custom/matrix-base/tasks/validate_config.yml b/roles/custom/matrix-base/tasks/validate_config.yml index f3f4eb166..93e1ded81 100644 --- a/roles/custom/matrix-base/tasks/validate_config.yml +++ b/roles/custom/matrix-base/tasks/validate_config.yml @@ -20,7 +20,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'host_specific_hostname_identity', 'new': 'matrix_domain'} - {'old': 'hostname_identity', 'new': 'matrix_domain'} @@ -97,7 +97,7 @@ To get rid of this error, remove all `matrix_mx_puppet_*` references from your configuration. To clean up your server from mx-puppet-skype's presence, see this changelog entry: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/CHANGELOG.md#mx-puppet-skype-removal. If you still need bridging to Skype, consider switching to the go-skype bridge instead. See `docs/configuring-playbook-bridge-go-skype-bridge.md`. - when: "'matrix_mx_puppet_skype_enabled' in vars" + when: "lookup('ansible.builtin.varnames', '^matrix_mx_puppet_skype_enabled$', wantlist=True) | length > 0" - name: Fail if mautrix-instagram and mautrix-meta-instagram are in conflict ansible.builtin.fail: diff --git a/roles/custom/matrix-bot-baibot/tasks/validate_config.yml b/roles/custom/matrix-bot-baibot/tasks/validate_config.yml index ee4eae03c..14d155b6e 100644 --- a/roles/custom/matrix-bot-baibot/tasks/validate_config.yml +++ b/roles/custom/matrix-bot-baibot/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_bot_baibot_config_user_mxid_localpart', when: true} - {'name': 'matrix_bot_baibot_config_user_password', when: true} @@ -37,6 +37,6 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_bot_baibot_container_image_name_prefix', 'new': 'matrix_bot_baibot_container_image_registry_prefix'} diff --git a/roles/custom/matrix-bot-buscarron/tasks/validate_config.yml b/roles/custom/matrix-bot-buscarron/tasks/validate_config.yml index 45e6690e2..97b765235 100644 --- a/roles/custom/matrix-bot-buscarron/tasks/validate_config.yml +++ b/roles/custom/matrix-bot-buscarron/tasks/validate_config.yml @@ -10,7 +10,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_bot_buscarron_noencryption', 'new': ''} - {'old': 'matrix_bot_buscarron_spam_hosts', 'new': ''} @@ -22,7 +22,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_bot_buscarron_password', when: true} - {'name': 'matrix_bot_buscarron_hostname', when: true} diff --git a/roles/custom/matrix-bot-chatgpt/tasks/validate_config.yml b/roles/custom/matrix-bot-chatgpt/tasks/validate_config.yml index 0c7a36ba6..2c175b4a5 100644 --- a/roles/custom/matrix-bot-chatgpt/tasks/validate_config.yml +++ b/roles/custom/matrix-bot-chatgpt/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_bot_chatgpt_openai_api_key', when: true} - {'name': 'matrix_bot_chatgpt_matrix_bot_username', when: true} @@ -22,7 +22,7 @@ msg: >- Your configuration contains a variable that is no longer used. Please change your configuration to remove the variable (`{{ item.name }}`). - when: "item.name in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.name + '$'), wantlist=True) | length > 0" with_items: - {'name': 'matrix_bot_chatgpt_openai_email'} - {'name': 'matrix_bot_chatgpt_openai_password'} @@ -33,7 +33,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_bot_chatgpt_docker_image', 'new': 'matrix_bot_chatgpt_container_image'} - {'old': 'matrix_bot_chatgpt_docker_image_name_prefix', 'new': 'matrix_bot_chatgpt_container_image_name_prefix'} diff --git a/roles/custom/matrix-bot-draupnir/tasks/validate_config.yml b/roles/custom/matrix-bot-draupnir/tasks/validate_config.yml index fd7ddca2b..e81663db3 100644 --- a/roles/custom/matrix-bot-draupnir/tasks/validate_config.yml +++ b/roles/custom/matrix-bot-draupnir/tasks/validate_config.yml @@ -11,7 +11,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_bot_draupnir_container_image_name_prefix', 'new': 'matrix_bot_draupnir_container_image_registry_prefix'} - {'old': 'matrix_bot_draupnir_enable_room_state_backing_store', 'new': 'matrix_bot_draupnir_config_roomStateBackingStore_enabled'} diff --git a/roles/custom/matrix-bot-honoroit/tasks/validate_config.yml b/roles/custom/matrix-bot-honoroit/tasks/validate_config.yml index fcaa04b68..6c0c12a19 100644 --- a/roles/custom/matrix-bot-honoroit/tasks/validate_config.yml +++ b/roles/custom/matrix-bot-honoroit/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_bot_honoroit_homeserver', when: true} - {'name': 'matrix_bot_honoroit_password', when: true} @@ -22,6 +22,6 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_bot_honoroit_container_image_name_prefix', 'new': 'matrix_bot_honoroit_container_image_registry_prefix'} 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 8fc291061..3021c8537 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 @@ -20,7 +20,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_bot_matrix_registration_bot_bot_access_token', 'new': ''} - {'old': 'matrix_bot_matrix_registration_bot_matrix_homeserver_url', 'new': 'matrix_bot_matrix_registration_bot_api_base_url'} diff --git a/roles/custom/matrix-bot-matrix-reminder-bot/tasks/validate_config.yml b/roles/custom/matrix-bot-matrix-reminder-bot/tasks/validate_config.yml index 06781bd19..51fb49de5 100644 --- a/roles/custom/matrix-bot-matrix-reminder-bot/tasks/validate_config.yml +++ b/roles/custom/matrix-bot-matrix-reminder-bot/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_bot_matrix_reminder_bot_matrix_user_password', when: true} - {'name': 'matrix_bot_matrix_reminder_bot_reminders_timezone', when: true} @@ -23,7 +23,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_bot_matrix_reminder_bot_container_self_build', 'new': 'matrix_bot_matrix_reminder_bot_container_image_self_build'} - {'old': 'matrix_bot_matrix_reminder_bot_container_image_name_prefix', 'new': 'matrix_bot_matrix_reminder_bot_container_image_registry_prefix'} diff --git a/roles/custom/matrix-bot-maubot/tasks/validate_config.yml b/roles/custom/matrix-bot-maubot/tasks/validate_config.yml index 11c53f8ca..f1a247aee 100644 --- a/roles/custom/matrix-bot-maubot/tasks/validate_config.yml +++ b/roles/custom/matrix-bot-maubot/tasks/validate_config.yml @@ -12,7 +12,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_bot_maubot_management_interface_port', 'new': 'matrix_bot_maubot_server_port'} - {'old': 'matrix_bot_maubot_management_interface_http_bind_port', 'new': 'matrix_bot_maubot_container_management_interface_http_bind_port'} @@ -23,7 +23,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_bot_maubot_hostname', when: true} - {'name': 'matrix_bot_maubot_path_prefix', when: true} diff --git a/roles/custom/matrix-bot-mjolnir/tasks/validate_config.yml b/roles/custom/matrix-bot-mjolnir/tasks/validate_config.yml index 6b9ae0030..53ef0fdd4 100644 --- a/roles/custom/matrix-bot-mjolnir/tasks/validate_config.yml +++ b/roles/custom/matrix-bot-mjolnir/tasks/validate_config.yml @@ -32,6 +32,6 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_bot_mjolnir_container_image_name_prefix', 'new': 'matrix_bot_mjolnir_container_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-appservice-discord/tasks/validate_config.yml b/roles/custom/matrix-bridge-appservice-discord/tasks/validate_config.yml index e2be8da0a..6b46cbcb8 100644 --- a/roles/custom/matrix-bridge-appservice-discord/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-appservice-discord/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_appservice_discord_client_id', when: true} - {'name': 'matrix_appservice_discord_bot_token', when: true} @@ -24,7 +24,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_appservice_discord_container_expose_client_server_api_port', 'new': ''} - {'old': 'matrix_appservice_discord_container_image_name_prefix', 'new': 'matrix_appservice_discord_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-appservice-irc/tasks/validate_config.yml b/roles/custom/matrix-bridge-appservice-irc/tasks/validate_config.yml index fb7d77281..00124dc40 100644 --- a/roles/custom/matrix-bridge-appservice-irc/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-appservice-irc/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_appservice_irc_appservice_token', when: true} - {'name': 'matrix_appservice_irc_homeserver_url', when: true} @@ -39,7 +39,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_appservice_irc_container_expose_client_server_api_port', 'new': ''} - {'old': 'matrix_appservice_irc_container_self_build', 'new': 'matrix_appservice_irc_container_image_self_build'} diff --git a/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/validate_config.yml b/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/validate_config.yml index ebabe36aa..a22214c05 100644 --- a/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_appservice_kakaotalk_appservice_token', when: true} - {'name': 'matrix_appservice_kakaotalk_homeserver_address', when: true} @@ -22,7 +22,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_appservice_kakaotalk_node_docker_image_name_prefix', 'new': 'matrix_appservice_kakaotalk_node_docker_image_registry_prefix'} - {'old': 'matrix_appservice_kakaotalk_docker_image_name_prefix', 'new': 'matrix_appservice_kakaotalk_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-appservice-slack/tasks/validate_config.yml b/roles/custom/matrix-bridge-appservice-slack/tasks/validate_config.yml index b35e2cdb6..ceb4e4a75 100644 --- a/roles/custom/matrix-bridge-appservice-slack/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-appservice-slack/tasks/validate_config.yml @@ -11,7 +11,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_appservice_slack_control_room_id', when: true} - {'name': 'matrix_appservice_slack_appservice_token', when: true} @@ -28,6 +28,6 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_appservice_slack_container_self_build', 'new': 'matrix_appservice_slack_container_image_self_build'} diff --git a/roles/custom/matrix-bridge-appservice-webhooks/tasks/validate_config.yml b/roles/custom/matrix-bridge-appservice-webhooks/tasks/validate_config.yml index 7f0d8bfec..5742c4c49 100644 --- a/roles/custom/matrix-bridge-appservice-webhooks/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-appservice-webhooks/tasks/validate_config.yml @@ -27,6 +27,6 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_appservice_webhooks_docker_image_name_prefix', 'new': 'matrix_appservice_webhooks_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-beeper-linkedin/tasks/validate_config.yml b/roles/custom/matrix-bridge-beeper-linkedin/tasks/validate_config.yml index 1bc9de53a..2d9cbb3e6 100644 --- a/roles/custom/matrix-bridge-beeper-linkedin/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-beeper-linkedin/tasks/validate_config.yml @@ -11,7 +11,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_beeper_linkedin_appservice_token', when: true} - {'name': 'matrix_beeper_linkedin_homeserver_address', when: true} @@ -24,7 +24,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_beeper_linkedin_login_shared_secret', 'new': ''} - {'old': 'matrix_beeper_linkedin_docker_image_name_prefix', 'new': 'matrix_beeper_linkedin_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-go-skype-bridge/tasks/validate_config.yml b/roles/custom/matrix-bridge-go-skype-bridge/tasks/validate_config.yml index d7d20b94d..b1c73a99c 100644 --- a/roles/custom/matrix-bridge-go-skype-bridge/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-go-skype-bridge/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_go_skype_bridge_appservice_token', when: true} - {'name': 'matrix_go_skype_bridge_homeserver_address', when: true} @@ -23,6 +23,6 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_go_skype_bridge_docker_image_name_prefix', 'new': 'matrix_go_skype_bridge_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-heisenbridge/tasks/validate_config.yml b/roles/custom/matrix-bridge-heisenbridge/tasks/validate_config.yml index 34e63877f..43f900514 100644 --- a/roles/custom/matrix-bridge-heisenbridge/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-heisenbridge/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_heisenbridge_container_network', when: true} - {'name': 'matrix_heisenbridge_homeserver_url', when: true} diff --git a/roles/custom/matrix-bridge-hookshot/tasks/validate_config.yml b/roles/custom/matrix-bridge-hookshot/tasks/validate_config.yml index 9735668ae..5364b063c 100644 --- a/roles/custom/matrix-bridge-hookshot/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-hookshot/tasks/validate_config.yml @@ -11,7 +11,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_hookshot_feeds_interval', 'new': 'matrix_hookshot_feeds_pollIntervalSeconds'} - {'old': 'matrix_hookshot_generic_urlprefix', 'new': 'matrix_hookshot_generic_urlPrefix'} @@ -116,4 +116,4 @@ with_items: - matrix_hookshot_proxy_metrics - matrix_hookshot_metrics_endpoint - when: "item in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item + '$'), wantlist=True) | length > 0" diff --git a/roles/custom/matrix-bridge-mautrix-bluesky/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-bluesky/tasks/validate_config.yml index e14168283..cc73aedd6 100644 --- a/roles/custom/matrix-bridge-mautrix-bluesky/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-bluesky/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_bluesky_appservice_token', when: true} - {'name': 'matrix_mautrix_bluesky_homeserver_address', when: true} @@ -25,6 +25,6 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_bluesky_docker_image_name_prefix', 'new': 'matrix_mautrix_bluesky_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-mautrix-discord/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-discord/tasks/validate_config.yml index a354dbcd6..d61b33e97 100644 --- a/roles/custom/matrix-bridge-mautrix-discord/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-discord/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_discord_appservice_token', when: true} - {'name': 'matrix_mautrix_discord_homeserver_address', when: true} @@ -26,7 +26,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_discord_login_shared_secret', 'new': ''} - {'old': 'matrix_mautrix_discord_homeserver_public_address', 'new': 'matrix_mautrix_discord_bridge_public_address'} diff --git a/roles/custom/matrix-bridge-mautrix-facebook/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-facebook/tasks/validate_config.yml index aaab4839f..8d141ec08 100644 --- a/roles/custom/matrix-bridge-mautrix-facebook/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-facebook/tasks/validate_config.yml @@ -12,7 +12,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_facebook_public_endpoint', 'new': 'matrix_mautrix_facebook_appservice_public_prefix'} - {'old': 'matrix_mautrix_facebook_docker_image_name_prefix', 'new': 'matrix_mautrix_facebook_docker_image_registry_prefix'} @@ -21,7 +21,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_facebook_appservice_public_hostname', when: "{{ matrix_mautrix_facebook_appservice_public_enabled }}"} - {'name': 'matrix_mautrix_facebook_appservice_public_prefix', when: "{{ matrix_mautrix_facebook_appservice_public_enabled }}"} diff --git a/roles/custom/matrix-bridge-mautrix-gmessages/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-gmessages/tasks/validate_config.yml index 6b1b76e1d..ddd142b72 100644 --- a/roles/custom/matrix-bridge-mautrix-gmessages/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-gmessages/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_gmessages_appservice_token', when: true} - {'name': 'matrix_mautrix_gmessages_homeserver_address', when: true} @@ -25,7 +25,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_gmessages_log_level', 'new': 'matrix_mautrix_gmessages_logging_level'} - {'old': 'matrix_mautrix_gmessages_bridge_mute_bridging', 'new': ''} diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/validate_config.yml index 9e2b20132..ea1359c35 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/validate_config.yml @@ -11,7 +11,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_googlechat_public_endpoint', when: true} - {'name': 'matrix_mautrix_googlechat_appservice_token', when: true} @@ -29,6 +29,6 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_googlechat_docker_image_name_prefix', 'new': 'matrix_mautrix_googlechat_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-mautrix-instagram/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-instagram/tasks/validate_config.yml index f86e3e243..80259cbda 100644 --- a/roles/custom/matrix-bridge-mautrix-instagram/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-instagram/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_instagram_appservice_token', when: true} - {'name': 'matrix_mautrix_instagram_homeserver_address', when: true} @@ -24,6 +24,6 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_instagram_docker_image_name_prefix', 'new': 'matrix_mautrix_instagram_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/validate_config.yml index 62ea8d204..6df63b15c 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_meta_instagram_metrics_proxying_hostname', when: "{{ matrix_mautrix_meta_instagram_metrics_proxying_enabled }}"} - {'name': 'matrix_mautrix_meta_instagram_metrics_proxying_path_prefix', when: "{{ matrix_mautrix_meta_instagram_metrics_proxying_enabled }}"} @@ -25,7 +25,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_meta_instagram_bridge_login_shared_secret', 'new': ''} - {'old': 'matrix_mautrix_meta_instagram_bridge_login_shared_secret_map_custom', 'new': ''} diff --git a/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/validate_config.yml index db8bb4fb1..5a005f1e2 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_meta_messenger_metrics_proxying_hostname', when: "{{ matrix_mautrix_meta_messenger_metrics_proxying_enabled }}"} - {'name': 'matrix_mautrix_meta_messenger_metrics_proxying_path_prefix', when: "{{ matrix_mautrix_meta_messenger_metrics_proxying_enabled }}"} @@ -25,7 +25,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_meta_messenger_bridge_login_shared_secret', 'new': ''} - {'old': 'matrix_mautrix_meta_messenger_bridge_login_shared_secret_map_custom', 'new': ''} diff --git a/roles/custom/matrix-bridge-mautrix-signal/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-signal/tasks/validate_config.yml index 1f08f1feb..93d99763d 100644 --- a/roles/custom/matrix-bridge-mautrix-signal/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-signal/tasks/validate_config.yml @@ -12,7 +12,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_signal_appservice_token', when: true} - {'name': 'matrix_mautrix_signal_homeserver_address', when: true} @@ -27,7 +27,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_signal_log_level', 'new': 'matrix_mautrix_signal_logging_level'} - {'old': 'matrix_mautrix_signal_bridge_restricted_rooms', 'new': ''} diff --git a/roles/custom/matrix-bridge-mautrix-slack/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-slack/tasks/validate_config.yml index d4b8edf32..0d3adfdec 100644 --- a/roles/custom/matrix-bridge-mautrix-slack/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-slack/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_slack_appservice_token', when: true} - {'name': 'matrix_mautrix_slack_homeserver_address', when: true} @@ -32,7 +32,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_slack_login_shared_secret', 'new': ''} - {'old': 'matrix_mautrix_slack_bridge_login_shared_secret_map', 'new': ''} diff --git a/roles/custom/matrix-bridge-mautrix-telegram/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-telegram/tasks/validate_config.yml index 20bad5816..3a234223d 100644 --- a/roles/custom/matrix-bridge-mautrix-telegram/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-telegram/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_telegram_hostname', when: true} - {'name': 'matrix_mautrix_telegram_path_prefix', when: true} @@ -30,7 +30,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_telegram_container_exposed_port_number', 'new': ''} - {'old': 'matrix_mautrix_telegram_container_self_build', 'new': 'matrix_mautrix_telegram_container_image_self_build'} diff --git a/roles/custom/matrix-bridge-mautrix-twitter/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-twitter/tasks/validate_config.yml index 0a30cd1d7..94623c041 100644 --- a/roles/custom/matrix-bridge-mautrix-twitter/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-twitter/tasks/validate_config.yml @@ -11,7 +11,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_twitter_appservice_token', when: true} - {'name': 'matrix_mautrix_twitter_homeserver_address', when: true} @@ -26,7 +26,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_twitter_login_shared_secret', 'new': ''} - {'old': 'matrix_mautrix_twitter_appservice_database', 'new': 'matrix_mautrix_twitter_database_uri'} diff --git a/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/validate_config.yml index a1f7605f3..ca5ef9458 100644 --- a/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/validate_config.yml @@ -12,7 +12,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mautrix_whatsapp_appservice_token', when: true} - {'name': 'matrix_mautrix_whatsapp_homeserver_address', when: true} @@ -24,7 +24,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mautrix_whatsapp_log_level', 'new': 'matrix_mautrix_whatsapp_logging_level'} - {'old': 'matrix_mautrix_whatsapp_login_shared_secret', 'new': ''} diff --git a/roles/custom/matrix-bridge-mx-puppet-discord/tasks/validate_config.yml b/roles/custom/matrix-bridge-mx-puppet-discord/tasks/validate_config.yml index d343fbba6..ba90eb314 100644 --- a/roles/custom/matrix-bridge-mx-puppet-discord/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mx-puppet-discord/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mx_puppet_discord_appservice_token', when: true} - {'name': 'matrix_mx_puppet_discord_homeserver_address', when: true} @@ -21,6 +21,6 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mx_puppet_discord_docker_image_name_prefix', 'new': 'matrix_mx_puppet_discord_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/validate_config.yml b/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/validate_config.yml index 8d195daff..b1647db23 100644 --- a/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mx_puppet_groupme_appservice_token', when: true} - {'name': 'matrix_mx_puppet_groupme_homeserver_address', when: true} @@ -21,6 +21,6 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mx_puppet_groupme_docker_image_name_prefix', 'new': 'matrix_mx_puppet_groupme_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/validate_config.yml b/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/validate_config.yml index 13a9fbf7d..2afd623f4 100644 --- a/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mx_puppet_instagram_appservice_token', when: true} - {'name': 'matrix_mx_puppet_instagram_homeserver_address', when: true} @@ -21,6 +21,6 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mx_puppet_instagram_docker_image_name_prefix', 'new': 'matrix_mx_puppet_instagram_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-mx-puppet-slack/tasks/validate_config.yml b/roles/custom/matrix-bridge-mx-puppet-slack/tasks/validate_config.yml index 8ede9eed3..ffe171fd4 100644 --- a/roles/custom/matrix-bridge-mx-puppet-slack/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mx-puppet-slack/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mx_puppet_slack_hostname', when: true} - {'name': 'matrix_mx_puppet_slack_path_prefix', when: true} @@ -25,7 +25,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mx_puppet_slack_redirect_path', 'new': 'matrix_mx_puppet_slack_oauth_redirect_path, but setting matrix_mx_puppet_slack_path_prefix is better'} - {'old': 'matrix_mx_puppet_slack_redirect_uri', 'new': '- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mx_puppet_steam_appservice_token', when: true} - {'name': 'matrix_mx_puppet_steam_homeserver_address', when: true} @@ -21,6 +21,6 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mx_puppet_steam_docker_image_name_prefix', 'new': 'matrix_mx_puppet_steam_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/validate_config.yml b/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/validate_config.yml index 84e2c1c76..286305106 100644 --- a/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_mx_puppet_twitter_hostname', when: true} - {'name': 'matrix_mx_puppet_twitter_path_prefix', when: true} @@ -25,7 +25,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_mx_puppet_twitter_webhook_path', 'new': '- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_postmoogle_password', when: true} - {'name': 'matrix_postmoogle_container_network', when: true} @@ -21,6 +21,6 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_postmoogle_docker_image_name_prefix', 'new': 'matrix_postmoogle_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-bridge-wechat/tasks/validate_config.yml b/roles/custom/matrix-bridge-wechat/tasks/validate_config.yml index c74f26390..324cb8e1a 100644 --- a/roles/custom/matrix-bridge-wechat/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-wechat/tasks/validate_config.yml @@ -8,7 +8,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_wechat_appservice_token', when: true} - {'name': 'matrix_wechat_homeserver_address', when: true} @@ -26,7 +26,7 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_wechat_container_image_name_prefix', 'new': 'matrix_wechat_container_image_registry_prefix'} - {'old': 'matrix_wechat_agent_container_image_name_prefix', 'new': 'matrix_wechat_agent_container_image_registry_prefix'} diff --git a/roles/custom/matrix-cactus-comments/tasks/validate_config.yml b/roles/custom/matrix-cactus-comments/tasks/validate_config.yml index 125b4b858..71ae8f935 100644 --- a/roles/custom/matrix-cactus-comments/tasks/validate_config.yml +++ b/roles/custom/matrix-cactus-comments/tasks/validate_config.yml @@ -11,7 +11,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_bot_cactus_comments_systemd_required_services_list', 'new': 'matrix_cactus_comments_systemd_required_services_list'} - {'old': 'matrix_bot_cactus_comments_systemd_wanted_services_list', 'new': 'matrix_cactus_comments_systemd_wanted_services_list'} diff --git a/roles/custom/matrix-client-cinny/tasks/validate_config.yml b/roles/custom/matrix-client-cinny/tasks/validate_config.yml index b3e324a38..fee52fe3c 100644 --- a/roles/custom/matrix-client-cinny/tasks/validate_config.yml +++ b/roles/custom/matrix-client-cinny/tasks/validate_config.yml @@ -8,7 +8,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item }}`) to use Cinny. - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_client_cinny_default_hs_url', when: true} - {'name': 'matrix_client_cinny_container_network', when: true} @@ -18,7 +18,7 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_client_cinny_container_image_name_prefix', 'new': 'matrix_client_cinny_container_image_registry_prefix'} diff --git a/roles/custom/matrix-client-element/tasks/validate_config.yml b/roles/custom/matrix-client-element/tasks/validate_config.yml index 7ff71cc2f..ad44193d0 100644 --- a/roles/custom/matrix-client-element/tasks/validate_config.yml +++ b/roles/custom/matrix-client-element/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item }}`) for using Element Web. - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_client_element_default_hs_url', when: true} - {'name': 'matrix_client_element_container_network', when: true} @@ -29,18 +29,16 @@ msg: >- Riot has been renamed to Element (https://element.io/blog/welcome-to-element/). The playbook will migrate your existing configuration and data automatically, but you need to adjust variable names. - Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). + Please rename these variable (`matrix_riot_web_*` -> `matrix_client_element_*`) on your configuration file (vars.yml): {{ lookup('ansible.builtin.varnames', '^matrix_riot_web_.+', wantlist=True) | join(', ') }} Also note that DNS configuration changes may be necessary. - when: "vars | dict2items | selectattr('key', 'match', item.old) | list | items2dict" - with_items: - - {'old': 'matrix_riot_web_.*', 'new': 'matrix_client_element_.*'} + when: "lookup('ansible.builtin.varnames', '^matrix_riot_web_.+', wantlist=True) | length > 0" - name: (Deprecation) Catch and report renamed element-web settings ansible.builtin.fail: msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_client_element_showLabsSettings', 'new': 'matrix_client_element_show_lab_settings'} - {'old': 'matrix_client_element_permalinkPrefix', 'new': 'matrix_client_element_permalink_prefix'} @@ -59,7 +57,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" + when: "lookup('vars', item, default='') | string | length == 0" with_items: - matrix_client_element_container_labels_traefik_hostname - matrix_client_element_container_labels_traefik_path_prefix diff --git a/roles/custom/matrix-client-fluffychat/tasks/validate_config.yml b/roles/custom/matrix-client-fluffychat/tasks/validate_config.yml index f5a5ae961..f11b81d65 100644 --- a/roles/custom/matrix-client-fluffychat/tasks/validate_config.yml +++ b/roles/custom/matrix-client-fluffychat/tasks/validate_config.yml @@ -17,7 +17,7 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_client_fluffychat_container_image_name_prefix', 'new': 'matrix_client_fluffychat_container_image_registry_prefix'} diff --git a/roles/custom/matrix-client-hydrogen/tasks/validate_config.yml b/roles/custom/matrix-client-hydrogen/tasks/validate_config.yml index 2bd1ae7ff..6f1ced098 100644 --- a/roles/custom/matrix-client-hydrogen/tasks/validate_config.yml +++ b/roles/custom/matrix-client-hydrogen/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item }}`) to use Hydrogen. - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_client_hydrogen_default_hs_url', when: "{{ matrix_client_hydrogen_container_image_self_build }}"} - {'name': 'matrix_client_hydrogen_container_network', when: true} @@ -20,7 +20,7 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_client_hydrogen_container_image_name_prefix', 'new': 'matrix_client_hydrogen_container_image_registry_prefix'} diff --git a/roles/custom/matrix-client-schildichat/tasks/validate_config.yml b/roles/custom/matrix-client-schildichat/tasks/validate_config.yml index 09ef97434..df87b4356 100644 --- a/roles/custom/matrix-client-schildichat/tasks/validate_config.yml +++ b/roles/custom/matrix-client-schildichat/tasks/validate_config.yml @@ -11,7 +11,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_client_schildichat_welcome_user_id', 'new': ''} - {'old': 'matrix_client_schildichat_container_image_name_prefix', 'new': 'matrix_client_schildichat_container_image_registry_prefix'} diff --git a/roles/custom/matrix-conduit/tasks/validate_config.yml b/roles/custom/matrix-conduit/tasks/validate_config.yml index 2e5bdc3e2..5500c7fc5 100644 --- a/roles/custom/matrix-conduit/tasks/validate_config.yml +++ b/roles/custom/matrix-conduit/tasks/validate_config.yml @@ -8,7 +8,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_conduit_hostname', when: true} - {'name': 'matrix_conduit_container_network', when: true} @@ -18,6 +18,6 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_conduit_container_image_name_prefix', 'new': 'matrix_conduit_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-conduwuit/tasks/validate_config.yml b/roles/custom/matrix-conduwuit/tasks/validate_config.yml index acb95bec1..d044ddf3d 100644 --- a/roles/custom/matrix-conduwuit/tasks/validate_config.yml +++ b/roles/custom/matrix-conduwuit/tasks/validate_config.yml @@ -8,7 +8,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_conduwuit_hostname', when: true} - {'name': 'matrix_conduwuit_container_network', when: true} diff --git a/roles/custom/matrix-continuwuity/tasks/validate_config.yml b/roles/custom/matrix-continuwuity/tasks/validate_config.yml index a5859d948..dd84f682a 100644 --- a/roles/custom/matrix-continuwuity/tasks/validate_config.yml +++ b/roles/custom/matrix-continuwuity/tasks/validate_config.yml @@ -8,7 +8,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_continuwuity_hostname', when: true} - {'name': 'matrix_continuwuity_container_network', when: true} @@ -19,7 +19,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_continuwuity_allowed_remote_server_names', 'new': 'matrix_continuwuity_config_allowed_remote_server_names'} - {'old': 'matrix_continuwuity_forbidden_remote_room_directory_server_names', 'new': 'matrix_continuwuity_config_forbidden_remote_room_directory_server_names'} diff --git a/roles/custom/matrix-corporal/tasks/validate_config.yml b/roles/custom/matrix-corporal/tasks/validate_config.yml index 366527fcb..cb394b81c 100644 --- a/roles/custom/matrix-corporal/tasks/validate_config.yml +++ b/roles/custom/matrix-corporal/tasks/validate_config.yml @@ -28,7 +28,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_corporal_container_expose_ports', 'new': ''} - {'old': 'matrix_corporal_reconciliation_user_id_local_part', 'new': 'matrix_corporal_corporal_user_id_local_part'} diff --git a/roles/custom/matrix-coturn/tasks/validate_config.yml b/roles/custom/matrix-coturn/tasks/validate_config.yml index 4d7568cee..3fe51d9ea 100644 --- a/roles/custom/matrix-coturn/tasks/validate_config.yml +++ b/roles/custom/matrix-coturn/tasks/validate_config.yml @@ -10,7 +10,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_coturn_docker_network', 'new': 'matrix_coturn_container_network'} - {'old': 'matrix_coturn_container_stun_plain_host_bind_port', 'new': 'superseded by matrix_coturn_container_stun_plain_host_bind_port_tcp and matrix_coturn_container_stun_plain_host_bind_port_udp'} @@ -27,7 +27,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_coturn_turn_static_auth_secret', when: "{{ matrix_coturn_authentication_method == 'auth-secret' }}"} - {'name': 'matrix_coturn_lt_cred_mech_username', when: "{{ matrix_coturn_authentication_method == 'lt-cred-mech' }}"} diff --git a/roles/custom/matrix-dendrite/tasks/validate_config.yml b/roles/custom/matrix-dendrite/tasks/validate_config.yml index 2f91bfa74..bff7aded0 100644 --- a/roles/custom/matrix-dendrite/tasks/validate_config.yml +++ b/roles/custom/matrix-dendrite/tasks/validate_config.yml @@ -12,7 +12,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_dendrite_enable_registration_captcha', 'new': 'matrix_dendrite_client_api_enable_registration_captcha'} - {'old': 'matrix_dendrite_recaptcha_public_key', 'new': 'matrix_dendrite_client_api_recaptcha_public_key'} @@ -40,7 +40,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_dendrite_hostname', when: true} - {'name': 'matrix_dendrite_client_api_registration_shared_secret', when: true} diff --git a/roles/custom/matrix-dimension/tasks/validate_config.yml b/roles/custom/matrix-dimension/tasks/validate_config.yml index 39120d536..5800d658f 100644 --- a/roles/custom/matrix-dimension/tasks/validate_config.yml +++ b/roles/custom/matrix-dimension/tasks/validate_config.yml @@ -13,7 +13,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_dimension_hostname', when: true} - {'name': 'matrix_dimension_container_network', when: true} @@ -28,7 +28,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_dimension_container_expose_port', 'new': ''} - {'old': 'matrix_dimension_container_image_name_prefix', 'new': 'matrix_dimension_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-dynamic-dns/tasks/validate_config.yml b/roles/custom/matrix-dynamic-dns/tasks/validate_config.yml index e86ae2317..b358bd3d3 100644 --- a/roles/custom/matrix-dynamic-dns/tasks/validate_config.yml +++ b/roles/custom/matrix-dynamic-dns/tasks/validate_config.yml @@ -24,7 +24,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_dynamic_dns_container_network', when: true} @@ -32,6 +32,6 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_dynamic_dns_container_image_name_prefix', 'new': 'matrix_dynamic_dns_docker_image_registry_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 fc2d870b5..3fc080949 100644 --- a/roles/custom/matrix-ldap-registration-proxy/tasks/validate_config.yml +++ b/roles/custom/matrix-ldap-registration-proxy/tasks/validate_config.yml @@ -25,7 +25,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_ldap_registration_proxy_registration_addr_with_container', 'new': ''} - {'old': 'matrix_ldap_registration_proxy_registration_addr_sans_container', 'new': ''} diff --git a/roles/custom/matrix-ma1sd/tasks/validate_config.yml b/roles/custom/matrix-ma1sd/tasks/validate_config.yml index 14c8acb4e..0f90eaebf 100644 --- a/roles/custom/matrix-ma1sd/tasks/validate_config.yml +++ b/roles/custom/matrix-ma1sd/tasks/validate_config.yml @@ -13,7 +13,7 @@ The `{{ item }}` variable defined in your configuration is not used by this playbook anymore! You'll need to adapt to the new way of extending ma1sd configuration. See the CHANGELOG and the `matrix_ma1sd_configuration_extension_yaml` variable for more information and examples. - when: "item in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item + '$'), wantlist=True) | length > 0" with_items: - 'matrix_ma1sd_ldap_enabled' - 'matrix_ma1sd_ldap_connection_host' @@ -50,7 +50,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_ma1sd_hostname', when: true} - {'name': 'matrix_ma1sd_threepid_medium_email_connectors_smtp_host', when: true} @@ -68,7 +68,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_ma1sd_container_expose_port', 'new': ''} - {'old': 'matrix_ma1sd_threepid_medium_email_custom_unbind_fraudulent_template', 'new': 'matrix_ma1sd_threepid_medium_email_custom_session_unbind_notification_template'} @@ -82,7 +82,5 @@ msg: >- mxisd is deprecated and has been replaced with ma1sd (https://github.com/ma1uta/ma1sd), a compatible fork. The playbook will migrate your existing mxisd configuration and data automatically, but you need to adjust variable names. - Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "vars | dict2items | selectattr('key', 'match', item.old) | list | items2dict" - with_items: - - {'old': 'matrix_mxisd_.*', 'new': 'matrix_ma1sd_.*'} + Please rename these variables (`matrix_mxisd_*` -> `matrix_ma1sd_*`) on your configuration file (vars.yml): {{ lookup('ansible.builtin.varnames', '^matrix_mxisd_.+', wantlist=True) | join(', ') }} + when: "lookup('ansible.builtin.varnames', '^matrix_mxisd_.+', wantlist=True) | length > 0" diff --git a/roles/custom/matrix-media-repo/tasks/validate_config.yml b/roles/custom/matrix-media-repo/tasks/validate_config.yml index 4d10a44ed..a531b0a4b 100644 --- a/roles/custom/matrix-media-repo/tasks/validate_config.yml +++ b/roles/custom/matrix-media-repo/tasks/validate_config.yml @@ -10,7 +10,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_media_repo_database_hostname', when: true} - {'name': 'matrix_media_repo_container_labels_traefik_internal_media_entrypoints', when: "{{ matrix_media_repo_container_labels_traefik_internal_media_enabled }}"} @@ -21,7 +21,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_media_repo_access_tokens', 'new': ''} - {'old': 'matrix_media_repo_datastores', 'new': ''} diff --git a/roles/custom/matrix-pantalaimon/tasks/validate_config.yml b/roles/custom/matrix-pantalaimon/tasks/validate_config.yml index ff3116355..a6b764815 100644 --- a/roles/custom/matrix-pantalaimon/tasks/validate_config.yml +++ b/roles/custom/matrix-pantalaimon/tasks/validate_config.yml @@ -15,6 +15,6 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_pantalaimon_docker_image_name_prefix', 'new': 'matrix_pantalaimon_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-prometheus-nginxlog-exporter/tasks/validate_config.yml b/roles/custom/matrix-prometheus-nginxlog-exporter/tasks/validate_config.yml index 4137efc24..e484c9d94 100644 --- a/roles/custom/matrix-prometheus-nginxlog-exporter/tasks/validate_config.yml +++ b/roles/custom/matrix-prometheus-nginxlog-exporter/tasks/validate_config.yml @@ -11,7 +11,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_prometheus_nginxlog_exporter_container_hostname', 'new': 'matrix_prometheus_nginxlog_exporter_identifier'} - {'old': 'matrix_prometheus_nginxlog_exporter_docker_image_name_prefix', 'new': 'matrix_prometheus_nginxlog_exporter_docker_image_registry_prefix'} @@ -37,7 +37,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_prometheus_nginxlog_exporter_metrics_proxying_hostname', when: "{{ matrix_prometheus_nginxlog_exporter_metrics_proxying_enabled }}"} - {'name': 'matrix_prometheus_nginxlog_exporter_metrics_proxying_path_prefix', when: "{{ matrix_prometheus_nginxlog_exporter_metrics_proxying_enabled }}"} diff --git a/roles/custom/matrix-rageshake/tasks/validate_config.yml b/roles/custom/matrix-rageshake/tasks/validate_config.yml index 80db54151..4b1249372 100644 --- a/roles/custom/matrix-rageshake/tasks/validate_config.yml +++ b/roles/custom/matrix-rageshake/tasks/validate_config.yml @@ -19,7 +19,7 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_rageshake_docker_image_name_prefix', 'new': 'matrix_rageshake_docker_image_registry_prefix'} diff --git a/roles/custom/matrix-registration/tasks/validate_config.yml b/roles/custom/matrix-registration/tasks/validate_config.yml index dba8f7497..4a8793cae 100644 --- a/roles/custom/matrix-registration/tasks/validate_config.yml +++ b/roles/custom/matrix-registration/tasks/validate_config.yml @@ -9,7 +9,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_registration_hostname', when: true} - {'name': 'matrix_registration_path_prefix', when: true} @@ -24,7 +24,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_registration_docker_repo', 'new': 'matrix_registration_container_image_self_build_repo'} - {'old': 'matrix_registration_public_endpoint', 'new': 'matrix_registration_path_prefix'} diff --git a/roles/custom/matrix-sliding-sync/tasks/validate_config.yml b/roles/custom/matrix-sliding-sync/tasks/validate_config.yml index 24a29539d..a4d3d26b3 100644 --- a/roles/custom/matrix-sliding-sync/tasks/validate_config.yml +++ b/roles/custom/matrix-sliding-sync/tasks/validate_config.yml @@ -8,7 +8,7 @@ ansible.builtin.fail: msg: > You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_sliding_sync_hostname', when: true} - {'name': 'matrix_sliding_sync_path_prefix', when: true} @@ -23,6 +23,6 @@ ansible.builtin.fail: msg: >- The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_sliding_sync_container_image_name_prefix', 'new': 'matrix_sliding_sync_container_image_registry_prefix'} diff --git a/roles/custom/matrix-synapse-admin/tasks/validate_config.yml b/roles/custom/matrix-synapse-admin/tasks/validate_config.yml index d0e953d24..d86fb5fac 100644 --- a/roles/custom/matrix-synapse-admin/tasks/validate_config.yml +++ b/roles/custom/matrix-synapse-admin/tasks/validate_config.yml @@ -11,7 +11,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_synapse_admin_docker_repo', 'new': 'matrix_synapse_admin_container_self_build_repo'} - {'old': 'matrix_synapse_admin_container_self_build', 'new': 'matrix_synapse_admin_container_image_self_build'} diff --git a/roles/custom/matrix-synapse-auto-compressor/tasks/validate_config.yml b/roles/custom/matrix-synapse-auto-compressor/tasks/validate_config.yml index ccaf4b42a..60a2cc996 100644 --- a/roles/custom/matrix-synapse-auto-compressor/tasks/validate_config.yml +++ b/roles/custom/matrix-synapse-auto-compressor/tasks/validate_config.yml @@ -9,7 +9,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - "old": "matrix_synapse_auto_compressor_calendar" "new": "matrix_synapse_auto_compressor_schedule" diff --git a/roles/custom/matrix-synapse-reverse-proxy-companion/tasks/validate_config.yml b/roles/custom/matrix-synapse-reverse-proxy-companion/tasks/validate_config.yml index 429c12ed2..0cd90bd8d 100644 --- a/roles/custom/matrix-synapse-reverse-proxy-companion/tasks/validate_config.yml +++ b/roles/custom/matrix-synapse-reverse-proxy-companion/tasks/validate_config.yml @@ -8,7 +8,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_synapse_reverse_proxy_companion_container_network', when: true} diff --git a/roles/custom/matrix-synapse-usage-exporter/tasks/validate_config.yml b/roles/custom/matrix-synapse-usage-exporter/tasks/validate_config.yml index c6fa07e23..996b7c461 100644 --- a/roles/custom/matrix-synapse-usage-exporter/tasks/validate_config.yml +++ b/roles/custom/matrix-synapse-usage-exporter/tasks/validate_config.yml @@ -10,6 +10,6 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_synapse_usage_exporter_docker_image_name_prefix', 'new': 'matrix_synapse_usage_exporter_container_image_registry_prefix'} diff --git a/roles/custom/matrix-synapse/tasks/validate_config.yml b/roles/custom/matrix-synapse/tasks/validate_config.yml index 66f6e0296..47156c801 100644 --- a/roles/custom/matrix-synapse/tasks/validate_config.yml +++ b/roles/custom/matrix-synapse/tasks/validate_config.yml @@ -82,7 +82,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_synapse_email_riot_base_url', 'new': ''} - {'old': 'matrix_synapse_container_expose_api_port', 'new': ''} diff --git a/roles/custom/matrix-user-verification-service/tasks/validate_config.yml b/roles/custom/matrix-user-verification-service/tasks/validate_config.yml index 449cad532..5f824ce93 100644 --- a/roles/custom/matrix-user-verification-service/tasks/validate_config.yml +++ b/roles/custom/matrix-user-verification-service/tasks/validate_config.yml @@ -33,7 +33,7 @@ ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and vars[item.name] == ''" + when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'matrix_user_verification_service_uvs_homeserver_url', when: true} - {'name': 'matrix_user_verification_service_container_network', when: true} @@ -43,6 +43,6 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_user_verification_service_docker_image_name_prefix', 'new': 'matrix_user_verification_service_docker_image_registry_prefix'} diff --git a/roles/custom/matrix_playbook_migration/tasks/validate_config.yml b/roles/custom/matrix_playbook_migration/tasks/validate_config.yml index 437d1fc69..483293121 100644 --- a/roles/custom/matrix_playbook_migration/tasks/validate_config.yml +++ b/roles/custom/matrix_playbook_migration/tasks/validate_config.yml @@ -11,7 +11,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_vars_yml_snapshotting_enabled', 'new': 'devture_playbook_state_preserver_vars_preservation_enabled'} - {'old': 'matrix_vars_yml_snapshotting_src', 'new': 'devture_playbook_state_preserver_vars_preservation_src'} @@ -86,8 +86,8 @@ 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: {{ vars | dict2items | selectattr('key', 'match', 'matrix_postgres_.*') | map(attribute='key') | join(', ') }} - when: "vars | dict2items | selectattr('key', 'match', 'matrix_postgres_.*') | list | items2dict" + The following variables in your configuration need to be renamed: {{ lookup('ansible.builtin.varnames', '^matrix_postgres_.+', wantlist=True) | join(', ') }} + when: "lookup('ansible.builtin.varnames', '^matrix_postgres_.+', wantlist=True) | length > 0" - name: (Deprecation) Catch and report matrix_mailer_ variables ansible.builtin.fail: @@ -99,14 +99,14 @@ 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: {{ vars | dict2items | selectattr('key', 'match', 'matrix_mailer_.*') | map(attribute='key') | join(', ') }} - when: "vars | dict2items | selectattr('key', 'match', 'matrix_mailer_.*') | list | items2dict" + The following variables in your configuration need to be renamed: {{ lookup('ansible.builtin.varnames', '^matrix_mailer_.+', wantlist=True) | join(', ') }} + when: "lookup('ansible.builtin.varnames', '^matrix_mailer_.+', wantlist=True) | length > 0" - when: matrix_playbook_migration_matrix_prometheus_node_exporter_migration_validation_enabled | bool block: - ansible.builtin.set_fact: matrix_playbook_migration_matrix_prometheus_node_exporter_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_prometheus_node_exporter_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_prometheus_node_exporter_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_prometheus_node_exporter variables ansible.builtin.fail: @@ -118,14 +118,14 @@ 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_node_exporter_migration_vars.keys() | join(', ') }} + The following variables in your configuration need to be renamed: {{ matrix_playbook_migration_matrix_prometheus_node_exporter_migration_vars | join(', ') }} when: "matrix_playbook_migration_matrix_prometheus_node_exporter_migration_vars | length > 0" - when: matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_validation_enabled | bool block: - ansible.builtin.set_fact: matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_prometheus_postgres_exporter_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_prometheus_postgres_exporter_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_prometheus_postgres_exporter variables ansible.builtin.fail: @@ -144,7 +144,7 @@ block: - ansible.builtin.set_fact: matrix_playbook_migration_backup_borg_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_backup_borg_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_backup_borg_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_backup_borg variables ansible.builtin.fail: @@ -163,7 +163,7 @@ block: - ansible.builtin.set_fact: matrix_playbook_migration_grafana_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_grafana_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_grafana_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_grafana variables ansible.builtin.fail: @@ -182,7 +182,7 @@ block: - ansible.builtin.set_fact: matrix_playbook_migration_ntfy_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_ntfy_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_ntfy_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_ntfy variables ansible.builtin.fail: @@ -201,7 +201,7 @@ block: - ansible.builtin.set_fact: matrix_playbook_migration_redis_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_redis_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_redis_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_redis variables ansible.builtin.fail: @@ -220,7 +220,7 @@ block: - ansible.builtin.set_fact: matrix_playbook_migration_redis_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'redis_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^redis_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_redis variables ansible.builtin.fail: @@ -238,7 +238,7 @@ block: - ansible.builtin.set_fact: matrix_playbook_migration_keydb_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'keydb_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^keydb_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_redis variables ansible.builtin.fail: @@ -256,7 +256,7 @@ block: - ansible.builtin.set_fact: matrix_playbook_migration_etherpad_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_etherpad_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_etherpad_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_etherpad variables ansible.builtin.fail: @@ -275,7 +275,7 @@ block: - ansible.builtin.set_fact: matrix_playbook_migration_aux_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_aux_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_aux_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_aux variables ansible.builtin.fail: @@ -294,7 +294,7 @@ block: - ansible.builtin.set_fact: matrix_playbook_migration_jitsi_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_jitsi_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_jitsi_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_jitsi variables ansible.builtin.fail: @@ -313,7 +313,7 @@ block: - ansible.builtin.set_fact: matrix_playbook_migration_postmoogle_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_bot_postmoogle_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_bot_postmoogle_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_bot_postmoogle variables ansible.builtin.fail: @@ -332,7 +332,7 @@ msg: >- Your configuration contains a variable, which now has a different name. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "item.old in vars" + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" with_items: - {'old': 'matrix_nginx_proxy_proxy_matrix_metrics_enabled', 'new': 'matrix_metrics_exposure_enabled'} - {'old': 'matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_enabled', 'new': 'matrix_metrics_exposure_http_basic_auth_enabled'} @@ -419,7 +419,7 @@ block: - ansible.builtin.set_fact: matrix_playbook_migration_nginx_proxy_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_nginx_proxy_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_nginx_proxy_.+', wantlist=True) }} - name: (Deprecation) Catch and report leftover matrix_nginx_proxy variables ansible.builtin.fail: @@ -435,7 +435,7 @@ block: - ansible.builtin.set_fact: matrix_playbook_migration_ssl_migration_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_ssl_.*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_ssl_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_ssl variables ansible.builtin.fail: @@ -450,7 +450,7 @@ - block: - ansible.builtin.set_fact: matrix_playbook_migration_matrix_synapse_container_labels_public_client_synapse_oidc_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_synapse_container_labels_public_client_synapse_oidc_*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_synapse_container_labels_public_client_synapse_oidc_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_ssl variables ansible.builtin.fail: @@ -461,7 +461,7 @@ - block: - ansible.builtin.set_fact: matrix_playbook_migration_matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_oidc_vars: |- - {{ vars | dict2items | selectattr('key', 'match', 'matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_oidc_*') | list | items2dict }} + {{ lookup('ansible.builtin.varnames', '^matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_oidc_.+', wantlist=True) }} - name: (Deprecation) Catch and report matrix_ssl variables ansible.builtin.fail: @@ -479,8 +479,8 @@ 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: {{ vars | dict2items | selectattr('key', 'match', 'devture_postgres_backup_.*') | map(attribute='key') | join(', ') }} - when: "vars | dict2items | selectattr('key', 'match', 'devture_postgres_backup_.*') | list | items2dict" + The following variables in your configuration need to be renamed: {{ lookup('ansible.builtin.varnames', '^devture_postgres_backup_.+', wantlist=True) | join(', ') }} + when: "lookup('ansible.builtin.varnames', '^devture_postgres_backup_.+', wantlist=True) | length > 0" - name: (Deprecation) Catch and report devture_postgres variables ansible.builtin.fail: @@ -492,8 +492,8 @@ 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: {{ vars | dict2items | selectattr('key', 'match', 'devture_postgres_.*') | map(attribute='key') | join(', ') }} - when: "vars | dict2items | selectattr('key', 'match', 'devture_postgres_.*') | list | items2dict" + The following variables in your configuration need to be renamed: {{ lookup('ansible.builtin.varnames', '^devture_postgres_.+', wantlist=True) | join(', ') }} + when: "lookup('ansible.builtin.varnames', '^devture_postgres_.+', wantlist=True) | length > 0" - name: (Deprecation) Catch and report traefik_certs_dumper variables ansible.builtin.fail: @@ -505,8 +505,8 @@ 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: {{ vars | dict2items | selectattr('key', 'match', 'devture_traefik_certs_dumper_.*') | map(attribute='key') | join(', ') }} - when: "vars | dict2items | selectattr('key', 'match', 'devture_traefik_certs_dumper_.*') | list | items2dict" + The following variables in your configuration need to be renamed: {{ lookup('ansible.builtin.varnames', '^devture_traefik_certs_dumper_.+', wantlist=True) | join(', ') }} + when: "lookup('ansible.builtin.varnames', '^devture_traefik_certs_dumper_.+', wantlist=True) | length > 0" - name: (Deprecation) Catch and report devture_traefik variables ansible.builtin.fail: @@ -518,8 +518,8 @@ 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: {{ vars | dict2items | selectattr('key', 'match', 'devture_traefik_.*') | map(attribute='key') | join(', ') }} - when: "vars | dict2items | selectattr('key', 'match', 'devture_traefik_.*') | list | items2dict" + The following variables in your configuration need to be renamed: {{ lookup('ansible.builtin.varnames', '^devture_traefik_.+', wantlist=True) | join(', ') }} + when: "lookup('ansible.builtin.varnames', '^devture_traefik_.+', wantlist=True) | length > 0" - name: (Deprecation) Catch and report devture_container_socket_proxy variables ansible.builtin.fail: @@ -531,8 +531,8 @@ 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: {{ vars | dict2items | selectattr('key', 'match', 'devture_container_socket_proxy_.*') | map(attribute='key') | join(', ') }} - when: "vars | dict2items | selectattr('key', 'match', 'devture_container_socket_proxy_.*') | list | items2dict" + The following variables in your configuration need to be renamed: {{ lookup('ansible.builtin.varnames', '^devture_container_socket_proxy_.+', wantlist=True) | join(', ') }} + when: "lookup('ansible.builtin.varnames', '^devture_container_socket_proxy_.+', wantlist=True) | length > 0" - name: (Deprecation) Catch and report mautrix-hangouts variables ansible.builtin.fail: @@ -544,8 +544,8 @@ You may also wish to uninstall the bridge manually. See `docs/configuring-playbook-bridge-mautrix-hangouts.md` for more information. - The following variables in your configuration need to be removed: {{ vars | dict2items | selectattr('key', 'match', 'matrix_mautrix_hangouts_.*') | map(attribute='key') | join(', ') }} - when: "vars | dict2items | selectattr('key', 'match', 'matrix_mautrix_hangouts_.*') | list | items2dict" + The following variables in your configuration need to be removed: {{ lookup('ansible.builtin.varnames', '^matrix_mautrix_hangouts_.+', wantlist=True) | join(', ') }} + when: "lookup('ansible.builtin.varnames', '^matrix_mautrix_hangouts_.+', wantlist=True) | length > 0" - name: (Deprecation) Catch and report Email2Matrix variables ansible.builtin.fail: @@ -556,5 +556,5 @@ You may also wish to uninstall the bridge manually. See `docs/configuring-playbook-email2matrix.md` for more information. - The following variables in your configuration need to be removed: {{ vars | dict2items | selectattr('key', 'match', 'matrix_email2matrix_.*') | map(attribute='key') | join(', ') }} - when: "vars | dict2items | selectattr('key', 'match', 'matrix_email2matrix_.*') | list | items2dict" + The following variables in your configuration need to be removed: {{ lookup('ansible.builtin.varnames', '^matrix_email2matrix_.+', wantlist=True) | join(', ') }} + when: "lookup('ansible.builtin.varnames', '^matrix_email2matrix_.+', wantlist=True) | length > 0"