Stop using deprecated vars variable

This commit is contained in:
Slavi Pantaleev
2025-11-26 11:35:09 +02:00
parent 889970314a
commit 430f350733
12 changed files with 20 additions and 20 deletions

View File

@@ -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] | string | length == 0"
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
with_items:
- {'name': 'matrix_authentication_service_hostname', when: true}
- {'name': 'matrix_authentication_service_config_database_username', when: true}

View File

@@ -44,7 +44,7 @@
- {'name': 'matrix_bot_draupnir_config_rawHomeserverUrl', when: true}
- {'name': 'matrix_bot_draupnir_pantalaimon_username', when: "{{ matrix_bot_draupnir_pantalaimon_use }}"}
- {'name': 'matrix_bot_draupnir_pantalaimon_password', when: "{{ matrix_bot_draupnir_pantalaimon_use }}"}
when: "item.when | bool and (vars[item.name] == '' or vars[item.name] is none)"
when: "item.when | bool and (lookup('vars', item.name, default='') == '' or lookup('vars', item.name, default='') is none)"
- name: Fail if Draupnir room hijacking enabled without enabling the Synapse Admin API
ansible.builtin.fail:
@@ -57,7 +57,7 @@
with_items:
- {'name': 'matrix_bot_draupnir_config_accessToken', when: "{{ matrix_bot_draupnir_pantalaimon_use }}"}
- {'name': 'matrix_bot_draupnir_config_accessToken', when: "{{ matrix_bot_draupnir_login_native }}"}
when: "item.when | bool and not (vars[item.name] == '' or vars[item.name] is none)"
when: "item.when | bool and not (lookup('vars', item.name, default='') == '' or lookup('vars', item.name, default='') is none)"
- name: Fail when matrix_bot_draupnir_config_experimentalRustCrypto is enabled together with matrix_bot_draupnir_pantalaimon_use
ansible.builtin.fail:

View File

@@ -51,7 +51,7 @@
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
when: "lookup('vars', item, default='') == ''"
with_items:
- "matrix_hookshot_appservice_token"
- "matrix_hookshot_homeserver_address"
@@ -62,7 +62,7 @@
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`) to enable GitHub.
when: "matrix_hookshot_github_enabled and vars[item] == ''"
when: "matrix_hookshot_github_enabled and lookup('vars', item, default='') == ''"
with_items:
- "matrix_hookshot_github_auth_id"
- "matrix_hookshot_github_webhook_secret"
@@ -71,7 +71,7 @@
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`) to enable GitHub OAuth.
when: "matrix_hookshot_github_oauth_enabled and vars[item] == ''"
when: "matrix_hookshot_github_oauth_enabled and lookup('vars', item, default='') == ''"
with_items:
- "matrix_hookshot_github_oauth_client_id"
- "matrix_hookshot_github_oauth_client_secret"
@@ -80,7 +80,7 @@
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`) to enable Jira.
when: "matrix_hookshot_jira_enabled and vars[item] == ''"
when: "matrix_hookshot_jira_enabled and lookup('vars', item, default='') == ''"
with_items:
- "matrix_hookshot_jira_webhook_secret"
@@ -88,7 +88,7 @@
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`) to enable Jira OAuth.
when: "matrix_hookshot_jira_oauth_enabled and vars[item] == ''"
when: "matrix_hookshot_jira_oauth_enabled and lookup('vars', item, default='') == ''"
with_items:
- "matrix_hookshot_jira_oauth_client_id"
- "matrix_hookshot_jira_oauth_client_secret"

View File

@@ -36,7 +36,7 @@
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
when: "lookup('vars', item, default='') == ''"
with_items:
- matrix_client_cinny_container_labels_traefik_hostname
- matrix_client_cinny_container_labels_traefik_path_prefix

View File

@@ -10,7 +10,7 @@
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`) for using matrix-corporal.
when: "vars[item] == ''"
when: "lookup('vars', item, default='') == ''"
with_items:
- "matrix_corporal_container_network"
- "matrix_corporal_matrix_homeserver_api_endpoint"

View File

@@ -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] | string | length == 0"
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
with_items:
- {'name': 'matrix_livekit_jwt_service_hostname', when: true}
- {'name': 'matrix_livekit_jwt_service_container_network', when: true}

View File

@@ -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] | string | length == 0"
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
with_items:
- {'name': 'matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_hostname', when: "{{ matrix_static_files_container_labels_well_known_matrix_endpoint_enabled }}"}
- {'name': 'matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_path_prefix', when: "{{ matrix_static_files_container_labels_well_known_matrix_endpoint_enabled }}"}

View File

@@ -26,7 +26,7 @@
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
when: "lookup('vars', item, default='') == ''"
with_items:
- matrix_synapse_admin_container_labels_traefik_hostname
- matrix_synapse_admin_container_labels_traefik_path_prefix

View File

@@ -20,7 +20,7 @@
ansible.builtin.fail:
msg: >
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
when: "lookup('vars', item, default='') == ''"
with_items:
- matrix_synapse_auto_compressor_database_hostname
- matrix_synapse_auto_compressor_database_password

View File

@@ -9,7 +9,7 @@
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`) for using s3-storage-provider.
when: "vars[item] == ''"
when: "lookup('vars', item, default='') == ''"
with_items:
- "matrix_synapse_ext_synapse_s3_storage_provider_config_bucket"
- "matrix_synapse_ext_synapse_s3_storage_provider_config_region_name"
@@ -19,7 +19,7 @@
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`) for using s3-storage-provider.
when: "not matrix_synapse_ext_synapse_s3_storage_provider_config_ec2_instance_profile | bool and vars[item] == ''"
when: "not matrix_synapse_ext_synapse_s3_storage_provider_config_ec2_instance_profile | bool and lookup('vars', item, default='') == ''"
with_items:
- "matrix_synapse_ext_synapse_s3_storage_provider_config_access_key_id"
- "matrix_synapse_ext_synapse_s3_storage_provider_config_secret_access_key"

View File

@@ -8,7 +8,7 @@
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`) for using synapse-http-antispam.
when: "vars[item] == ''"
when: "lookup('vars', item, default='') == ''"
with_items:
- "matrix_synapse_ext_synapse_http_antispam_enabled"
- "matrix_synapse_ext_synapse_http_antispam_config_base_url"

View File

@@ -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] | string | length == 0"
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
with_items:
- {'name': 'matrix_synapse_username', when: true}
- {'name': 'matrix_synapse_uid', when: true}
@@ -48,7 +48,7 @@
ansible.builtin.fail:
msg: >-
`{{ item }}` cannot be more than 1. This is a single-instance worker.
when: "vars[item] | int > 1"
when: "lookup('vars', item, default='') | int > 1"
with_items:
- "matrix_synapse_workers_appservice_workers_count"
- "matrix_synapse_workers_user_dir_workers_count"
@@ -166,7 +166,7 @@
- name: Fail if known Synapse password provider modules are enabled when auth is delegated to Matrix Authentication Service
ansible.builtin.fail:
msg: "When Synapse is delegating authentication to Matrix Authentication Service (`matrix_synapse_matrix_authentication_service_enabled: true`), it does not make sense to enable password provider modules, because it is not Synapse that is handling authentication. Please disable {{ item }} before enabling Matrix Authentication Service integration for Synapse. Synapse will refuse to start otherwise."
when: matrix_synapse_matrix_authentication_service_enabled and vars[item] | bool
when: matrix_synapse_matrix_authentication_service_enabled and lookup('vars', item, default='') | bool
with_items:
- matrix_synapse_ext_password_provider_rest_auth_enabled
- matrix_synapse_ext_password_provider_shared_secret_auth_enabled