More ansible-lint fixes
This commit is contained in:
		| @@ -521,11 +521,11 @@ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret: "" | ||||
| matrix_synapse_ext_password_provider_shared_secret_auth_m_login_password_support_enabled: true | ||||
| # We'd like to enable this, but it causes trouble for Element: https://github.com/vector-im/element-web/issues/19605 | ||||
| matrix_synapse_ext_password_provider_shared_secret_auth_com_devture_shared_secret_auth_support_enabled: false | ||||
| matrix_synapse_ext_password_provider_shared_secret_config: "{{ matrix_synapse_ext_password_provider_shared_secret_config_yaml|from_yaml }}" | ||||
| matrix_synapse_ext_password_provider_shared_secret_config: "{{ matrix_synapse_ext_password_provider_shared_secret_config_yaml | from_yaml }}" | ||||
| matrix_synapse_ext_password_provider_shared_secret_config_yaml: | | ||||
|   shared_secret: {{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret|string|to_json }} | ||||
|   m_login_password_support_enabled: {{ matrix_synapse_ext_password_provider_shared_secret_auth_m_login_password_support_enabled|to_json }} | ||||
|   com_devture_shared_secret_auth_support_enabled: {{ matrix_synapse_ext_password_provider_shared_secret_auth_com_devture_shared_secret_auth_support_enabled|to_json }} | ||||
|   shared_secret: {{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret|string | to_json }} | ||||
|   m_login_password_support_enabled: {{ matrix_synapse_ext_password_provider_shared_secret_auth_m_login_password_support_enabled | to_json }} | ||||
|   com_devture_shared_secret_auth_support_enabled: {{ matrix_synapse_ext_password_provider_shared_secret_auth_com_devture_shared_secret_auth_support_enabled | to_json }} | ||||
|  | ||||
| # Enable this to activate LDAP password provider | ||||
| matrix_synapse_ext_password_provider_ldap_enabled: false | ||||
| @@ -586,11 +586,11 @@ matrix_synapse_ext_encryption_disabler_deny_encryption_for_rooms_of: ["{{ matrix | ||||
| # Enabling this may have incompatiblity consequences with servers / clients. | ||||
| # Familiarize yourself with the caveats upstream: https://github.com/digitalentity/matrix_encryption_disabler | ||||
| matrix_synapse_ext_encryption_disabler_patch_power_levels: false | ||||
| matrix_synapse_ext_encryption_config: "{{ matrix_synapse_ext_encryption_config_yaml|from_yaml }}" | ||||
| matrix_synapse_ext_encryption_config: "{{ matrix_synapse_ext_encryption_config_yaml | from_yaml }}" | ||||
| matrix_synapse_ext_encryption_config_yaml: | | ||||
|   deny_encryption_for_users_of: {{ matrix_synapse_ext_encryption_disabler_deny_encryption_for_users_of|to_json }} | ||||
|   deny_encryption_for_rooms_of: {{ matrix_synapse_ext_encryption_disabler_deny_encryption_for_rooms_of|to_json }} | ||||
|   patch_power_levels: {{ matrix_synapse_ext_encryption_disabler_patch_power_levels|to_json }} | ||||
|   deny_encryption_for_users_of: {{ matrix_synapse_ext_encryption_disabler_deny_encryption_for_users_of | to_json }} | ||||
|   deny_encryption_for_rooms_of: {{ matrix_synapse_ext_encryption_disabler_deny_encryption_for_rooms_of | to_json }} | ||||
|   patch_power_levels: {{ matrix_synapse_ext_encryption_disabler_patch_power_levels | to_json }} | ||||
|  | ||||
|  | ||||
| matrix_s3_media_store_enabled: false | ||||
| @@ -678,8 +678,8 @@ matrix_synapse_configuration_extension_yaml: | | ||||
|   #   system_mxid_avatar_url: "mxc://server.com/oumMVlgDnLYFaPVkExemNVVZ" | ||||
|   #   room_name: "Server Notices" | ||||
|  | ||||
| matrix_synapse_configuration_extension: "{{ matrix_synapse_configuration_extension_yaml|from_yaml if matrix_synapse_configuration_extension_yaml|from_yaml is mapping else {} }}" | ||||
| matrix_synapse_configuration_extension: "{{ matrix_synapse_configuration_extension_yaml | from_yaml if matrix_synapse_configuration_extension_yaml | from_yaml is mapping else {} }}" | ||||
|  | ||||
| # Holds the final Synapse configuration (a combination of the default and its extension). | ||||
| # You most likely don't need to touch this variable. Instead, see `matrix_synapse_configuration_yaml`. | ||||
| matrix_synapse_configuration: "{{ matrix_synapse_configuration_yaml|from_yaml|combine(matrix_synapse_configuration_extension, recursive=True) }}" | ||||
| matrix_synapse_configuration: "{{ matrix_synapse_configuration_yaml | from_yaml|combine(matrix_synapse_configuration_extension, recursive=True) }}" | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| --- | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/encryption-disabler/setup_install.yml" | ||||
|   when: matrix_synapse_ext_encryption_disabler_enabled|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/encryption-disabler/setup_install.yml" | ||||
|   when: matrix_synapse_ext_encryption_disabler_enabled | bool | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/encryption-disabler/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_ext_encryption_disabler_enabled|bool" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/encryption-disabler/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_ext_encryption_disabler_enabled | bool" | ||||
|   | ||||
| @@ -16,7 +16,7 @@ | ||||
| - ansible.builtin.set_fact: | ||||
|     matrix_synapse_modules: | | ||||
|       {{ | ||||
|         matrix_synapse_modules|default([]) | ||||
|         matrix_synapse_modules | default([]) | ||||
|         + | ||||
|         [ | ||||
|           { | ||||
| @@ -28,7 +28,7 @@ | ||||
|  | ||||
|     matrix_synapse_container_extra_arguments: > | ||||
|       {{ | ||||
|         matrix_synapse_container_extra_arguments|default([]) | ||||
|         matrix_synapse_container_extra_arguments | default([]) | ||||
|         + | ||||
|         ["--mount type=bind,src={{ matrix_synapse_ext_path }}/matrix_e2ee_filter.py,dst={{ matrix_synapse_in_container_python_packages_path }}/matrix_e2ee_filter.py,ro"] | ||||
|       }} | ||||
|   | ||||
| @@ -9,4 +9,4 @@ | ||||
|        + | ||||
|         [{'name': 'ldap_auth_provider', 'level': 'INFO'}] | ||||
|       }} | ||||
|   when: matrix_synapse_ext_password_provider_ldap_enabled|bool | ||||
|   when: matrix_synapse_ext_password_provider_ldap_enabled | bool | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| --- | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/mjolnir-antispam/setup_install.yml" | ||||
|   when: matrix_synapse_ext_spam_checker_mjolnir_antispam_enabled|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/mjolnir-antispam/setup_install.yml" | ||||
|   when: matrix_synapse_ext_spam_checker_mjolnir_antispam_enabled | bool | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/mjolnir-antispam/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_ext_spam_checker_mjolnir_antispam_enabled|bool" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/mjolnir-antispam/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_ext_spam_checker_mjolnir_antispam_enabled | bool" | ||||
|   | ||||
| @@ -50,7 +50,7 @@ | ||||
|  | ||||
|     matrix_synapse_container_extra_arguments: > | ||||
|       {{ | ||||
|         matrix_synapse_container_extra_arguments|default([]) | ||||
|         matrix_synapse_container_extra_arguments | default([]) | ||||
|         + | ||||
|         ["--mount type=bind,src={{ matrix_synapse_ext_path }}/mjolnir/synapse_antispam/mjolnir,dst={{ matrix_synapse_in_container_python_packages_path }}/mjolnir,ro"] | ||||
|       }} | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| --- | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/rest-auth/setup_install.yml" | ||||
|   when: matrix_synapse_ext_password_provider_rest_auth_enabled|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/rest-auth/setup_install.yml" | ||||
|   when: matrix_synapse_ext_password_provider_rest_auth_enabled | bool | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/rest-auth/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_ext_password_provider_rest_auth_enabled|bool" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/rest-auth/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_ext_password_provider_rest_auth_enabled | bool" | ||||
|   | ||||
| @@ -23,7 +23,7 @@ | ||||
|  | ||||
|     matrix_synapse_container_extra_arguments: > | ||||
|       {{ | ||||
|         matrix_synapse_container_extra_arguments|default([]) | ||||
|         matrix_synapse_container_extra_arguments | default([]) | ||||
|         + | ||||
|         ["--mount type=bind,src={{ matrix_synapse_ext_path }}/rest_auth_provider.py,dst={{ matrix_synapse_in_container_python_packages_path }}/rest_auth_provider.py,ro"] | ||||
|       }} | ||||
|   | ||||
| @@ -1,13 +1,13 @@ | ||||
| --- | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/encryption-disabler/setup.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/encryption-disabler/setup.yml" | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/rest-auth/setup.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/rest-auth/setup.yml" | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/shared-secret-auth/setup.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/shared-secret-auth/setup.yml" | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/ldap-auth/setup.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/ldap-auth/setup.yml" | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/synapse-simple-antispam/setup.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/synapse-simple-antispam/setup.yml" | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/mjolnir-antispam/setup.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/mjolnir-antispam/setup.yml" | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| --- | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/shared-secret-auth/setup_install.yml" | ||||
|   when: matrix_synapse_ext_password_provider_shared_secret_auth_enabled|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/shared-secret-auth/setup_install.yml" | ||||
|   when: matrix_synapse_ext_password_provider_shared_secret_auth_enabled | bool | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/shared-secret-auth/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_ext_password_provider_shared_secret_auth_enabled|bool" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/shared-secret-auth/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_ext_password_provider_shared_secret_auth_enabled | bool" | ||||
|   | ||||
| @@ -26,7 +26,7 @@ | ||||
| - ansible.builtin.set_fact: | ||||
|     matrix_synapse_modules: | | ||||
|       {{ | ||||
|         matrix_synapse_modules|default([]) | ||||
|         matrix_synapse_modules | default([]) | ||||
|         + | ||||
|         [ | ||||
|           { | ||||
| @@ -38,7 +38,7 @@ | ||||
|  | ||||
|     matrix_synapse_container_extra_arguments: > | ||||
|       {{ | ||||
|         matrix_synapse_container_extra_arguments|default([]) | ||||
|         matrix_synapse_container_extra_arguments | default([]) | ||||
|         + | ||||
|         ["--mount type=bind,src={{ matrix_synapse_ext_path }}/shared_secret_authenticator.py,dst={{ matrix_synapse_in_container_python_packages_path }}/shared_secret_authenticator.py,ro"] | ||||
|       }} | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| --- | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/synapse-simple-antispam/setup_install.yml" | ||||
|   when: matrix_synapse_ext_spam_checker_synapse_simple_antispam_enabled|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/synapse-simple-antispam/setup_install.yml" | ||||
|   when: matrix_synapse_ext_spam_checker_synapse_simple_antispam_enabled | bool | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/synapse-simple-antispam/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_ext_spam_checker_synapse_simple_antispam_enabled|bool" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/synapse-simple-antispam/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_ext_spam_checker_synapse_simple_antispam_enabled | bool" | ||||
|   | ||||
| @@ -52,7 +52,7 @@ | ||||
|  | ||||
|     matrix_synapse_container_extra_arguments: > | ||||
|       {{ | ||||
|         matrix_synapse_container_extra_arguments|default([]) | ||||
|         matrix_synapse_container_extra_arguments | default([]) | ||||
|         + | ||||
|         ["--mount type=bind,src={{ matrix_synapse_ext_path }}/synapse-simple-antispam/synapse_simple_antispam,dst={{ matrix_synapse_in_container_python_packages_path }}/synapse_simple_antispam,ro"] | ||||
|       }} | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| --- | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/goofys/setup_install.yml" | ||||
|   when: matrix_s3_media_store_enabled|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/goofys/setup_install.yml" | ||||
|   when: matrix_s3_media_store_enabled | bool | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/goofys/setup_uninstall.yml" | ||||
|   when: "not matrix_s3_media_store_enabled|bool" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/goofys/setup_uninstall.yml" | ||||
|   when: "not matrix_s3_media_store_enabled | bool" | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_fuse_installed.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_fuse_installed.yml" | ||||
|  | ||||
| - name: Ensure Goofys Docker image is pulled | ||||
|   docker_image: | ||||
| @@ -15,7 +15,7 @@ | ||||
|  | ||||
| # This will throw a Permission Denied error if already mounted | ||||
| - name: Check Matrix Goofys external storage mountpoint path | ||||
|   stat: | ||||
|   ansible.builtin.stat: | ||||
|     path: "{{ matrix_s3_media_store_path }}" | ||||
|   register: local_path_matrix_s3_media_store_path_stat | ||||
|   ignore_errors: true | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| --- | ||||
|  | ||||
| - name: Check existence of matrix-goofys service | ||||
|   stat: | ||||
|   ansible.builtin.stat: | ||||
|     path: "{{ matrix_systemd_path }}/matrix-goofys.service" | ||||
|   register: matrix_goofys_service_stat | ||||
|  | ||||
|   | ||||
| @@ -10,10 +10,10 @@ | ||||
| - name: Fail if media store is on Amazon S3 | ||||
|   ansible.builtin.fail: | ||||
|     msg: "Your media store is on Amazon S3. Due to technical limitations, restoring is not supported." | ||||
|   when: matrix_s3_media_store_enabled|bool | ||||
|   when: matrix_s3_media_store_enabled | bool | ||||
|  | ||||
| - name: Check if the provided media store directory exists | ||||
|   stat: | ||||
|   ansible.builtin.stat: | ||||
|     path: "{{ server_path_media_store }}" | ||||
|   register: server_path_media_store_stat | ||||
|  | ||||
| @@ -23,12 +23,12 @@ | ||||
|   when: "not server_path_media_store_stat.stat.exists or not server_path_media_store_stat.stat.isdir" | ||||
|  | ||||
| - name: Check if media store contains local_content | ||||
|   stat: | ||||
|   ansible.builtin.stat: | ||||
|     path: "{{ server_path_media_store }}/local_content" | ||||
|   register: server_path_media_store_local_content_stat | ||||
|  | ||||
| - name: Check if media store contains remote_content | ||||
|   stat: | ||||
|   ansible.builtin.stat: | ||||
|     path: "{{ server_path_media_store }}/remote_content" | ||||
|   register: server_path_media_store_remote_content_stat | ||||
|  | ||||
| @@ -69,7 +69,7 @@ | ||||
|     owner: "{{ matrix_user_username }}" | ||||
|     group: "{{ matrix_user_groupname }}" | ||||
|     recurse: true | ||||
|   when: "not matrix_s3_media_store_enabled|bool" | ||||
|   when: "not matrix_s3_media_store_enabled | bool" | ||||
|  | ||||
| # We don't chown for Goofys, because due to the way it's mounted, | ||||
| # all files become owned by whoever needs to own them. | ||||
|   | ||||
| @@ -8,23 +8,23 @@ | ||||
|  | ||||
| # Unless `matrix_synapse_workers_enabled_list` is explicitly defined, | ||||
| # we'll generate it dynamically. | ||||
| - import_tasks: "{{ role_path }}/tasks/synapse/workers/init.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/synapse/workers/init.yml" | ||||
|   when: "matrix_synapse_enabled and matrix_synapse_workers_enabled and matrix_synapse_workers_enabled_list|length == 0" | ||||
|  | ||||
| - ansible.builtin.set_fact: | ||||
|     matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-synapse.service'] }}" | ||||
|   when: matrix_synapse_enabled|bool | ||||
|   when: matrix_synapse_enabled | bool | ||||
|  | ||||
| - name: Ensure systemd services for workers are injected | ||||
|   include_tasks: "{{ role_path }}/tasks/synapse/workers/util/inject_systemd_services_for_worker.yml" | ||||
|   ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/util/inject_systemd_services_for_worker.yml" | ||||
|   with_items: "{{ matrix_synapse_workers_enabled_list }}" | ||||
|   loop_control: | ||||
|     loop_var: matrix_synapse_worker_details | ||||
|   when: matrix_synapse_enabled|bool and matrix_synapse_workers_enabled|bool | ||||
|   when: matrix_synapse_enabled | bool and matrix_synapse_workers_enabled | bool | ||||
|  | ||||
| - ansible.builtin.set_fact: | ||||
|     matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-goofys.service'] }}" | ||||
|   when: matrix_s3_media_store_enabled|bool | ||||
|   when: matrix_s3_media_store_enabled | bool | ||||
|  | ||||
| - block: | ||||
|     - name: Fail if matrix-nginx-proxy role already executed | ||||
| @@ -34,13 +34,13 @@ | ||||
|           but it's pointless since the matrix-nginx-proxy role had already executed. | ||||
|           To fix this, please change the order of roles in your playbook, | ||||
|           so that the matrix-nginx-proxy role would run after the matrix-synapse role. | ||||
|       when: matrix_nginx_proxy_role_executed|default(False)|bool | ||||
|       when: matrix_nginx_proxy_role_executed | default(False) | bool | ||||
|  | ||||
|     - name: Generate synapse metrics proxying configuration for matrix-nginx-proxy (matrix.DOMAIN/metrics/synapse/main-process) | ||||
|       ansible.builtin.set_fact: | ||||
|         matrix_synapse_nginx_metrics_configuration_block: | | ||||
|           location /metrics/synapse/main-process { | ||||
|             {% if matrix_nginx_proxy_enabled|default(False) %} | ||||
|             {% if matrix_nginx_proxy_enabled | default(False) %} | ||||
|               {# Use the embedded DNS resolver in Docker containers to discover the service #} | ||||
|               resolver 127.0.0.11 valid=5s; | ||||
|               set $backend "matrix-synapse:{{ matrix_synapse_metrics_port }}"; | ||||
| @@ -55,7 +55,7 @@ | ||||
|       ansible.builtin.set_fact: | ||||
|         matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks: | | ||||
|           {{ | ||||
|             matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks|default([]) | ||||
|             matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks | default([]) | ||||
|             + | ||||
|             [matrix_synapse_nginx_metrics_configuration_block] | ||||
|           }} | ||||
| @@ -79,9 +79,9 @@ | ||||
|       ansible.builtin.set_fact: | ||||
|         matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks: | | ||||
|           {{ | ||||
|             matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks|default([]) | ||||
|             matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks | default([]) | ||||
|             + | ||||
|             [matrix_synapse_worker_nginx_metrics_configuration_block] | ||||
|           }} | ||||
|       when: matrix_synapse_workers_enabled_list|length > 0 | ||||
|   when: matrix_synapse_enabled|bool and matrix_synapse_metrics_proxying_enabled|bool | ||||
|   when: matrix_synapse_enabled | bool and matrix_synapse_metrics_proxying_enabled | bool | ||||
|   | ||||
| @@ -1,52 +1,52 @@ | ||||
| --- | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/init.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml" | ||||
|   tags: | ||||
|     - always | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/validate_config.yml" | ||||
|   when: run_setup|bool and matrix_synapse_enabled|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml" | ||||
|   when: run_setup | bool and matrix_synapse_enabled | bool | ||||
|   tags: | ||||
|     - setup-all | ||||
|     - setup-synapse | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/setup_synapse.yml" | ||||
|   when: run_setup|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_synapse.yml" | ||||
|   when: run_setup | bool | ||||
|   tags: | ||||
|     - setup-all | ||||
|     - setup-synapse | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/import_media_store.yml" | ||||
|   when: run_synapse_import_media_store|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/import_media_store.yml" | ||||
|   when: run_synapse_import_media_store | bool | ||||
|   tags: | ||||
|     - import-synapse-media-store | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/register_user.yml" | ||||
|   when: run_synapse_register_user|bool and matrix_synapse_enabled|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/register_user.yml" | ||||
|   when: run_synapse_register_user | bool and matrix_synapse_enabled | bool | ||||
|   tags: | ||||
|     - register-user | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/self_check_client_api.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/self_check_client_api.yml" | ||||
|   delegate_to: 127.0.0.1 | ||||
|   become: false | ||||
|   when: run_self_check|bool | ||||
|   when: run_self_check | bool | ||||
|   tags: | ||||
|     - self-check | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/self_check_federation_api.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/self_check_federation_api.yml" | ||||
|   delegate_to: 127.0.0.1 | ||||
|   become: false | ||||
|   when: run_self_check|bool | ||||
|   when: run_self_check | bool | ||||
|   tags: | ||||
|     - self-check | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/update_user_password.yml" | ||||
|   when: run_synapse_update_user_password|bool and matrix_synapse_enabled|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/update_user_password.yml" | ||||
|   when: run_synapse_update_user_password | bool and matrix_synapse_enabled | bool | ||||
|   tags: | ||||
|     - update-user-password | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/rust-synapse-compress-state/main.yml" | ||||
|   when: run_synapse_rust_synapse_compress_state|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/rust-synapse-compress-state/main.yml" | ||||
|   when: run_synapse_rust_synapse_compress_state | bool | ||||
|   tags: | ||||
|     - rust-synapse-compress-state | ||||
|  | ||||
|   | ||||
| @@ -23,7 +23,7 @@ | ||||
|   register: start_result | ||||
|  | ||||
| - name: Wait a while, so that Synapse can manage to start | ||||
|   pause: | ||||
|   ansible.builtin.pause: | ||||
|     seconds: 7 | ||||
|   when: "start_result.changed" | ||||
|  | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
| - name: Fail if Postgres not enabled | ||||
|   ansible.builtin.fail: | ||||
|     msg: "Postgres via the matrix-postgres role is not enabled (`matrix_postgres_enabled`). Cannot use rust-synapse-compress-state." | ||||
|   when: "not matrix_postgres_enabled|bool" | ||||
|   when: "not matrix_postgres_enabled | bool" | ||||
|  | ||||
|  | ||||
| # Defaults | ||||
| @@ -12,24 +12,24 @@ | ||||
| - name: Set matrix_synapse_rust_synapse_compress_state_find_rooms_command_wait_time, if not provided | ||||
|   ansible.builtin.set_fact: | ||||
|     matrix_synapse_rust_synapse_compress_state_find_rooms_command_wait_time: 1800 | ||||
|   when: "matrix_synapse_rust_synapse_compress_state_find_rooms_command_wait_time|default('') == ''" | ||||
|   when: "matrix_synapse_rust_synapse_compress_state_find_rooms_command_wait_time | default('') == ''" | ||||
|  | ||||
| - name: Set matrix_synapse_rust_synapse_compress_state_compress_room_time, if not provided | ||||
|   ansible.builtin.set_fact: | ||||
|     matrix_synapse_rust_synapse_compress_state_compress_room_time: 3600 | ||||
|   when: "matrix_synapse_rust_synapse_compress_state_compress_room_time|default('') == ''" | ||||
|   when: "matrix_synapse_rust_synapse_compress_state_compress_room_time | default('') == ''" | ||||
|  | ||||
| - name: Set matrix_synapse_rust_synapse_compress_state_psql_import_time, if not provided | ||||
|   ansible.builtin.set_fact: | ||||
|     matrix_synapse_rust_synapse_compress_state_psql_import_time: 3600 | ||||
|   when: "matrix_synapse_rust_synapse_compress_state_psql_import_time|default('') == ''" | ||||
|   when: "matrix_synapse_rust_synapse_compress_state_psql_import_time | default('') == ''" | ||||
|  | ||||
| - name: Set matrix_synapse_rust_synapse_compress_state_min_state_groups_required, if not provided | ||||
|   ansible.builtin.set_fact: | ||||
|     # The minimum number of state groups we're looking for before we consider a room eligible for compression. | ||||
|     # Rooms with a smaller state groups count will not be compressed. | ||||
|     matrix_synapse_rust_synapse_compress_state_min_state_groups_required: 100000 | ||||
|   when: "matrix_synapse_rust_synapse_compress_state_min_state_groups_required|default('') == ''" | ||||
|   when: "matrix_synapse_rust_synapse_compress_state_min_state_groups_required | default('') == ''" | ||||
|  | ||||
|  | ||||
| # Actual compression work | ||||
| @@ -108,7 +108,7 @@ | ||||
|           {{ matrix_synapse_rust_synapse_compress_state_eligible_rooms }} | ||||
|  | ||||
|     - name: Compress room state | ||||
|       include_tasks: "{{ role_path }}/tasks/rust-synapse-compress-state/compress_room.yml" | ||||
|       ansible.builtin.include_tasks: "{{ role_path }}/tasks/rust-synapse-compress-state/compress_room.yml" | ||||
|       with_items: "{{ matrix_synapse_rust_synapse_compress_state_eligible_rooms }}" | ||||
|       loop_control: | ||||
|         loop_var: room_details | ||||
|   | ||||
| @@ -8,14 +8,14 @@ | ||||
|   register: result_matrix_synapse_client_api | ||||
|   ignore_errors: true | ||||
|   check_mode: false | ||||
|   when: matrix_synapse_enabled|bool | ||||
|   when: matrix_synapse_enabled | bool | ||||
|  | ||||
| - name: Fail if Matrix Client API not working | ||||
|   ansible.builtin.fail: | ||||
|     msg: "Failed checking Matrix Client API is up at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_synapse_client_api_url_endpoint_public }}`). Is Synapse running? Is port 443 open in your firewall? Full error: {{ result_matrix_synapse_client_api }}" | ||||
|   when: "matrix_synapse_enabled|bool and (result_matrix_synapse_client_api.failed or 'json' not in result_matrix_synapse_client_api)" | ||||
|   when: "matrix_synapse_enabled | bool and (result_matrix_synapse_client_api.failed or 'json' not in result_matrix_synapse_client_api)" | ||||
|  | ||||
| - name: Report working Matrix Client API | ||||
|   ansible.builtin.debug: | ||||
|     msg: "The Matrix Client API at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_synapse_client_api_url_endpoint_public }}`) is working" | ||||
|   when: matrix_synapse_enabled|bool | ||||
|   when: matrix_synapse_enabled | bool | ||||
|   | ||||
| @@ -8,19 +8,19 @@ | ||||
|   register: result_matrix_synapse_federation_api | ||||
|   ignore_errors: true | ||||
|   check_mode: false | ||||
|   when: matrix_synapse_enabled|bool | ||||
|   when: matrix_synapse_enabled | bool | ||||
|  | ||||
| - name: Fail if Matrix Federation API not working | ||||
|   ansible.builtin.fail: | ||||
|     msg: "Failed checking Matrix Federation API is up at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_synapse_federation_api_url_endpoint_public }}`). Is Synapse running? Is port {{ matrix_federation_public_port }} open in your firewall? Full error: {{ result_matrix_synapse_federation_api }}" | ||||
|   when: "matrix_synapse_enabled|bool and matrix_synapse_federation_enabled|bool and (result_matrix_synapse_federation_api.failed or 'json' not in result_matrix_synapse_federation_api)" | ||||
|   when: "matrix_synapse_enabled | bool and matrix_synapse_federation_enabled | bool and (result_matrix_synapse_federation_api.failed or 'json' not in result_matrix_synapse_federation_api)" | ||||
|  | ||||
| - name: Fail if Matrix Federation API unexpectedly enabled | ||||
|   ansible.builtin.fail: | ||||
|     msg: "Matrix Federation API is up at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_synapse_federation_api_url_endpoint_public }}`) despite being disabled." | ||||
|   when: "matrix_synapse_enabled|bool and not matrix_synapse_federation_enabled|bool and not result_matrix_synapse_federation_api.failed" | ||||
|   when: "matrix_synapse_enabled | bool and not matrix_synapse_federation_enabled | bool and not result_matrix_synapse_federation_api.failed" | ||||
|  | ||||
| - name: Report working Matrix Federation API | ||||
|   ansible.builtin.debug: | ||||
|     msg: "The Matrix Federation API at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_synapse_federation_api_url_endpoint_public }}`) is working" | ||||
|   when: "matrix_synapse_enabled|bool and matrix_synapse_federation_enabled|bool" | ||||
|   when: "matrix_synapse_enabled | bool and matrix_synapse_federation_enabled | bool" | ||||
|   | ||||
| @@ -14,12 +14,12 @@ | ||||
|     # We handle matrix_synapse_media_store_path elsewhere (in ./synapse/setup_install.yml), | ||||
|     # because if it's using Goofys and it's already mounted (from before), | ||||
|     # trying to chown/chmod it here will cause trouble. | ||||
|   when: "(matrix_synapse_enabled|bool or matrix_s3_media_store_enabled|bool) and item.when" | ||||
|   when: "(matrix_synapse_enabled | bool or matrix_s3_media_store_enabled | bool) and item.when" | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/ext/setup.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/ext/setup.yml" | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/synapse/workers/setup.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/synapse/workers/setup.yml" | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/synapse/setup.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/synapse/setup.yml" | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/goofys/setup.yml" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/goofys/setup.yml" | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| --- | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/synapse/setup_install.yml" | ||||
|   when: matrix_synapse_enabled|bool | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/synapse/setup_install.yml" | ||||
|   when: matrix_synapse_enabled | bool | ||||
|  | ||||
| - import_tasks: "{{ role_path }}/tasks/synapse/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_enabled|bool" | ||||
| - ansible.builtin.import_tasks: "{{ role_path }}/tasks/synapse/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_enabled | bool" | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  | ||||
| # This will throw a Permission Denied error if already mounted using fuse | ||||
| - name: Check Synapse media store path | ||||
|   stat: | ||||
|   ansible.builtin.stat: | ||||
|     path: "{{ matrix_synapse_media_store_path }}" | ||||
|   register: local_path_media_store_stat | ||||
|   ignore_errors: true | ||||
| @@ -46,8 +46,8 @@ | ||||
|           . | ||||
|       environment: | ||||
|         DOCKER_BUILDKIT: 1 | ||||
|       when: "matrix_synapse_git_pull_results.changed|bool or matrix_synapse_docker_image_check_result.stdout == ''" | ||||
|   when: "matrix_synapse_container_image_self_build|bool" | ||||
|       when: "matrix_synapse_git_pull_results.changed | bool or matrix_synapse_docker_image_check_result.stdout == ''" | ||||
|   when: "matrix_synapse_container_image_self_build | bool" | ||||
|  | ||||
| - name: Ensure Synapse Docker image is pulled | ||||
|   docker_image: | ||||
| @@ -62,7 +62,7 @@ | ||||
|   until: result is not failed | ||||
|  | ||||
| - name: Check if a Synapse signing key exists | ||||
|   stat: | ||||
|   ansible.builtin.stat: | ||||
|     path: "{{ matrix_synapse_config_dir_path }}/{{ matrix_server_fqn_matrix }}.signing.key" | ||||
|   register: matrix_synapse_signing_key_stat | ||||
|  | ||||
| @@ -90,7 +90,7 @@ | ||||
|  | ||||
| - name: Ensure Synapse homeserver config installed | ||||
|   ansible.builtin.copy: | ||||
|     content: "{{ matrix_synapse_configuration|to_nice_yaml(indent=2, width=999999) }}" | ||||
|     content: "{{ matrix_synapse_configuration | to_nice_yaml(indent=2, width=999999) }}" | ||||
|     dest: "{{ matrix_synapse_config_dir_path }}/homeserver.yaml" | ||||
|     mode: 0644 | ||||
|     owner: "{{ matrix_user_username }}" | ||||
| @@ -127,4 +127,4 @@ | ||||
|     owner: "{{ matrix_user_username }}" | ||||
|     group: "{{ matrix_user_groupname }}" | ||||
|     mode: 0644 | ||||
|   when: matrix_synapse_metrics_proxying_enabled|bool | ||||
|   when: matrix_synapse_metrics_proxying_enabled | bool | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| --- | ||||
|  | ||||
| - name: Check existence of matrix-synapse service | ||||
|   stat: | ||||
|   ansible.builtin.stat: | ||||
|     path: "{{ matrix_systemd_path }}/matrix-synapse.service" | ||||
|   register: matrix_synapse_service_stat | ||||
|  | ||||
| @@ -34,4 +34,4 @@ | ||||
|   ansible.builtin.file: | ||||
|     path: "{{ matrix_synapse_base_path }}/external_prometheus.yml.example" | ||||
|     state: absent | ||||
|   when: "not matrix_synapse_metrics_proxying_enabled|bool" | ||||
|   when: "not matrix_synapse_metrics_proxying_enabled | bool" | ||||
|   | ||||
| @@ -12,7 +12,7 @@ | ||||
|       port: "{{ matrix_synapse_workers_generic_workers_port_range_start + item }}" | ||||
|       metrics_port: "{{ matrix_synapse_workers_generic_workers_metrics_range_start + item }}" | ||||
|   register: "matrix_synapse_workers_list_results_generic_workers" | ||||
|   loop: "{{ range(0, matrix_synapse_workers_generic_workers_count|int)|list }}" | ||||
|   loop: "{{ range(0, matrix_synapse_workers_generic_workers_count|int) | list }}" | ||||
|  | ||||
| - name: Build federation sender workers | ||||
|   ansible.builtin.set_fact: | ||||
| @@ -22,7 +22,7 @@ | ||||
|       port: 0 | ||||
|       metrics_port: "{{ matrix_synapse_workers_federation_sender_workers_metrics_range_start + item }}" | ||||
|   register: "matrix_synapse_workers_list_results_federation_sender_workers" | ||||
|   loop: "{{ range(0, matrix_synapse_workers_federation_sender_workers_count|int)|list }}" | ||||
|   loop: "{{ range(0, matrix_synapse_workers_federation_sender_workers_count|int) | list }}" | ||||
|  | ||||
| # This type of worker can only have a count of 1, at most | ||||
| - name: Build pusher workers | ||||
| @@ -33,7 +33,7 @@ | ||||
|       port: 0 | ||||
|       metrics_port: "{{ matrix_synapse_workers_pusher_workers_metrics_range_start + item }}" | ||||
|   register: "matrix_synapse_workers_list_results_pusher_workers" | ||||
|   loop: "{{ range(0, matrix_synapse_workers_pusher_workers_count|int)|list }}" | ||||
|   loop: "{{ range(0, matrix_synapse_workers_pusher_workers_count|int) | list }}" | ||||
|  | ||||
| # This type of worker can only have a count of 1, at most | ||||
| - name: Build appservice workers | ||||
| @@ -44,7 +44,7 @@ | ||||
|       port: 0 | ||||
|       metrics_port: "{{ matrix_synapse_workers_appservice_workers_metrics_range_start + item }}" | ||||
|   register: "matrix_synapse_workers_list_results_appservice_workers" | ||||
|   loop: "{{ range(0, matrix_synapse_workers_appservice_workers_count|int)|list }}" | ||||
|   loop: "{{ range(0, matrix_synapse_workers_appservice_workers_count|int) | list }}" | ||||
|  | ||||
| - name: Build media_repository workers | ||||
|   ansible.builtin.set_fact: | ||||
| @@ -54,7 +54,7 @@ | ||||
|       port: "{{ matrix_synapse_workers_media_repository_workers_port_range_start + item }}" | ||||
|       metrics_port: "{{ matrix_synapse_workers_media_repository_workers_metrics_range_start + item }}" | ||||
|   register: "matrix_synapse_workers_list_results_media_repository_workers" | ||||
|   loop: "{{ range(0, matrix_synapse_workers_media_repository_workers_count|int)|list }}" | ||||
|   loop: "{{ range(0, matrix_synapse_workers_media_repository_workers_count|int) | list }}" | ||||
|  | ||||
| - name: Build frontend_proxy workers | ||||
|   ansible.builtin.set_fact: | ||||
| @@ -64,10 +64,10 @@ | ||||
|       port: "{{ matrix_synapse_workers_frontend_proxy_workers_port_range_start + item }}" | ||||
|       metrics_port: "{{ matrix_synapse_workers_frontend_proxy_workers_metrics_range_start + item }}" | ||||
|   register: "matrix_synapse_workers_list_results_frontend_proxy_workers" | ||||
|   loop: "{{ range(0, matrix_synapse_workers_frontend_proxy_workers_count|int)|list }}" | ||||
|   loop: "{{ range(0, matrix_synapse_workers_frontend_proxy_workers_count|int) | list }}" | ||||
|  | ||||
| - ansible.builtin.set_fact: | ||||
|     matrix_synapse_dynamic_workers_list: "{{ matrix_synapse_dynamic_workers_list|default([]) + [item.ansible_facts.worker] }}" | ||||
|     matrix_synapse_dynamic_workers_list: "{{ matrix_synapse_dynamic_workers_list | default([]) + [item.ansible_facts.worker] }}" | ||||
|   with_items: | | ||||
|     {{ | ||||
|       matrix_synapse_workers_list_results_generic_workers.results | ||||
|   | ||||
| @@ -14,8 +14,8 @@ | ||||
|     path: "{{ matrix_local_bin_path }}/matrix-synapse-worker-write-pid" | ||||
|     state: absent | ||||
|  | ||||
| - include_tasks: "{{ role_path }}/tasks/synapse/workers/setup_install.yml" | ||||
|   when: "matrix_synapse_enabled|bool and matrix_synapse_workers_enabled|bool" | ||||
| - ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/setup_install.yml" | ||||
|   when: "matrix_synapse_enabled | bool and matrix_synapse_workers_enabled | bool" | ||||
|  | ||||
| - include_tasks: "{{ role_path }}/tasks/synapse/workers/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_workers_enabled|bool" | ||||
| - ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/setup_uninstall.yml" | ||||
|   when: "not matrix_synapse_workers_enabled | bool" | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| --- | ||||
|  | ||||
| - name: Determine current worker configs | ||||
|   find: | ||||
|   ansible.builtin.find: | ||||
|     path: "{{ matrix_synapse_config_dir_path }}" | ||||
|     patterns: "worker.*.yaml" | ||||
|     use_regex: true | ||||
| @@ -15,7 +15,7 @@ | ||||
|   with_items: "{{ matrix_synapse_workers_current_config_files.files }}" | ||||
|  | ||||
| - name: Determine current worker systemd services | ||||
|   find: | ||||
|   ansible.builtin.find: | ||||
|     path: "{{ matrix_systemd_path }}" | ||||
|     patterns: "matrix-synapse-worker.*.service" | ||||
|     use_regex: true | ||||
| @@ -23,11 +23,11 @@ | ||||
|  | ||||
| - name: Ensure unnecessary worker systemd services are stopped and disabled | ||||
|   ansible.builtin.service: | ||||
|     name: "{{ item.path|basename }}" | ||||
|     name: "{{ item.path | basename }}" | ||||
|     state: stopped | ||||
|     enabled: false | ||||
|   with_items: "{{ matrix_synapse_workers_current_systemd_services.files }}" | ||||
|   when: "not ansible_check_mode and item.path|basename not in matrix_systemd_services_list" | ||||
|   when: "not ansible_check_mode and item.path | basename not in matrix_systemd_services_list" | ||||
|  | ||||
| - name: Ensure unnecessary worker systemd services are cleaned | ||||
|   ansible.builtin.file: | ||||
| @@ -36,7 +36,7 @@ | ||||
|   with_items: "{{ matrix_synapse_workers_current_systemd_services.files }}" | ||||
|  | ||||
| - name: Ensure creation of worker systemd service files and configuration files | ||||
|   include_tasks: "{{ role_path }}/tasks/synapse/workers/util/setup_files_for_worker.yml" | ||||
|   ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/util/setup_files_for_worker.yml" | ||||
|   with_items: "{{ matrix_synapse_workers_enabled_list }}" | ||||
|   loop_control: | ||||
|     loop_var: matrix_synapse_worker_details | ||||
|   | ||||
| @@ -1,17 +1,17 @@ | ||||
| --- | ||||
|  | ||||
| - name: Populate service facts | ||||
|   service_facts: | ||||
|   ansible.builtin.service_facts: | ||||
|  | ||||
| - name: Ensure any worker services are stopped | ||||
|   ansible.builtin.service: | ||||
|     name: "{{ item.key }}" | ||||
|     state: stopped | ||||
|   with_dict: "{{ ansible_facts.services|default({})|dict2items|selectattr('key', 'match', 'matrix-synapse-worker-.+\\.service')|list|items2dict }}" | ||||
|   with_dict: "{{ ansible_facts.services | default({})|dict2items|selectattr('key', 'match', 'matrix-synapse-worker-.+\\.service')|list|items2dict }}" | ||||
|   when: "item.value['status'] != 'not-found'"  # see https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1461 | ||||
|  | ||||
| - name: Find worker configs to be cleaned | ||||
|   find: | ||||
|   ansible.builtin.find: | ||||
|     path: "{{ matrix_synapse_config_dir_path }}" | ||||
|     patterns: "worker.*.yaml" | ||||
|     use_regex: true | ||||
| @@ -24,7 +24,7 @@ | ||||
|   with_items: "{{ matrix_synapse_workers_current_config_files.files }}" | ||||
|  | ||||
| - name: Find worker systemd services to be cleaned | ||||
|   find: | ||||
|   ansible.builtin.find: | ||||
|     path: "{{ matrix_systemd_path }}" | ||||
|     patterns: "matrix-synapse-worker.*.service" | ||||
|     use_regex: true | ||||
|   | ||||
| @@ -9,7 +9,7 @@ | ||||
| # Our own code which dynamically builds `matrix_synapse_workers_enabled_list` does things right. | ||||
| - name: Fail if instanceId not defined for worker | ||||
|   ansible.builtin.fail: | ||||
|     msg: "Synapse workers (like {{ matrix_synapse_worker_details|to_json }}) need to define an instanceId property (type + instanceId must be unique)" | ||||
|     msg: "Synapse workers (like {{ matrix_synapse_worker_details | to_json }}) need to define an instanceId property (type + instanceId must be unique)" | ||||
|   when: "'instanceId' not in matrix_synapse_worker_details" | ||||
|  | ||||
| - ansible.builtin.set_fact: | ||||
|   | ||||
| @@ -13,7 +13,7 @@ | ||||
| - name: Fail if not using matrix-postgres container | ||||
|   ansible.builtin.fail: | ||||
|     msg: "This command is working only when matrix-postgres container is being used" | ||||
|   when: "not matrix_postgres_enabled|bool" | ||||
|   when: "not matrix_postgres_enabled | bool" | ||||
|  | ||||
| - name: Ensure matrix-synapse is started | ||||
|   ansible.builtin.service: | ||||
| @@ -31,7 +31,7 @@ | ||||
|  | ||||
|  | ||||
| - name: Wait a while, so that Matrix Synapse can manage to start | ||||
|   pause: | ||||
|   ansible.builtin.pause: | ||||
|     seconds: 7 | ||||
|   when: "start_result.changed or postgres_start_result.changed" | ||||
|  | ||||
|   | ||||
| @@ -6,7 +6,7 @@ matrix_synapse_federation_api_url_endpoint_public: "https://{{ matrix_server_fqn | ||||
| # Tells whether this role had executed or not. Toggled to `true` during runtime. | ||||
| matrix_synapse_role_executed: false | ||||
|  | ||||
| matrix_synapse_media_store_directory_name: "{{ matrix_synapse_media_store_path|basename }}" | ||||
| matrix_synapse_media_store_directory_name: "{{ matrix_synapse_media_store_path | basename }}" | ||||
|  | ||||
| # A Synapse generic worker can handle both federation and client-server API endpoints. | ||||
| # We wish to split these, as we normally serve federation separately and don't want them mixed up. | ||||
| @@ -24,11 +24,11 @@ matrix_synapse_media_store_directory_name: "{{ matrix_synapse_media_store_path|b | ||||
| # so it's not that important whether we forward them or not. | ||||
| # | ||||
| # Basically, we aim to cover most things. Skipping `/_synapse/client` or a few other minor things doesn't matter too much. | ||||
| matrix_synapse_workers_generic_worker_client_server_endpoints: "{{ matrix_synapse_workers_generic_worker_endpoints|default([]) | map('regex_search', '.*/_matrix/client.*')| list | difference([none]) }}" | ||||
| matrix_synapse_workers_generic_worker_client_server_endpoints: "{{ matrix_synapse_workers_generic_worker_endpoints | default([]) | map('regex_search', '.*/_matrix/client.*' | list | difference([none]) }}" | ||||
|  | ||||
| # A Synapse generic worker can handle both federation and client-server API endpoints. | ||||
| # We wish to split these, as we normally serve federation separately and don't want them mixed up. | ||||
| # | ||||
| # This is some ugly Ansible/Jinja2 hack (seen here: https://stackoverflow.com/a/47831492), | ||||
| # which takes a list of various strings and removes the ones NOT containing `/_matrix/federation` or `/_matrix/key` anywhere in them. | ||||
| matrix_synapse_workers_generic_worker_federation_endpoints: "{{ matrix_synapse_workers_generic_worker_endpoints|default([]) | map('regex_search', '.*(/_matrix/federation|/_matrix/key).*')| list | difference([none]) }}" | ||||
| matrix_synapse_workers_generic_worker_federation_endpoints: "{{ matrix_synapse_workers_generic_worker_endpoints | default([]) | map('regex_search', '.*(/_matrix/federation|/_matrix/key).*' | list | difference([none]) }}" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user