瀏覽代碼

Stop using deprecated `vars` variable

pull/4759/head
Slavi Pantaleev 3 月之前
父節點
當前提交
430f350733
共有 12 個檔案被更改,包括 20 行新增20 行删除
  1. +1
    -1
      roles/custom/matrix-authentication-service/tasks/validate_config.yml
  2. +2
    -2
      roles/custom/matrix-bot-draupnir/tasks/validate_config.yml
  3. +5
    -5
      roles/custom/matrix-bridge-hookshot/tasks/validate_config.yml
  4. +1
    -1
      roles/custom/matrix-client-cinny/tasks/validate_config.yml
  5. +1
    -1
      roles/custom/matrix-corporal/tasks/validate_config.yml
  6. +1
    -1
      roles/custom/matrix-livekit-jwt-service/tasks/validate_config.yml
  7. +1
    -1
      roles/custom/matrix-static-files/tasks/validate_config.yml
  8. +1
    -1
      roles/custom/matrix-synapse-admin/tasks/validate_config.yml
  9. +1
    -1
      roles/custom/matrix-synapse-auto-compressor/tasks/validate_config.yml
  10. +2
    -2
      roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/validate_config.yml
  11. +1
    -1
      roles/custom/matrix-synapse/tasks/ext/synapse-http-antispam/validate_config.yml
  12. +3
    -3
      roles/custom/matrix-synapse/tasks/validate_config.yml

+ 1
- 1
roles/custom/matrix-authentication-service/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] | 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}


+ 2
- 2
roles/custom/matrix-bot-draupnir/tasks/validate_config.yml 查看文件

@@ -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:


+ 5
- 5
roles/custom/matrix-bridge-hookshot/tasks/validate_config.yml 查看文件

@@ -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"


+ 1
- 1
roles/custom/matrix-client-cinny/tasks/validate_config.yml 查看文件

@@ -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


+ 1
- 1
roles/custom/matrix-corporal/tasks/validate_config.yml 查看文件

@@ -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"


+ 1
- 1
roles/custom/matrix-livekit-jwt-service/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] | 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}


+ 1
- 1
roles/custom/matrix-static-files/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] | 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 }}"}


+ 1
- 1
roles/custom/matrix-synapse-admin/tasks/validate_config.yml 查看文件

@@ -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


+ 1
- 1
roles/custom/matrix-synapse-auto-compressor/tasks/validate_config.yml 查看文件

@@ -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

+ 2
- 2
roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/validate_config.yml 查看文件

@@ -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"


+ 1
- 1
roles/custom/matrix-synapse/tasks/ext/synapse-http-antispam/validate_config.yml 查看文件

@@ -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"


+ 3
- 3
roles/custom/matrix-synapse/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] | 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


Loading…
取消
儲存