Fix all 300+ ansible-lint-reported errors

This commit is contained in:
Slavi Pantaleev
2023-03-07 17:28:10 +02:00
parent bf95204860
commit dddfee16bc
98 changed files with 942 additions and 895 deletions

View File

@ -1,60 +1,60 @@
---
# encryption-disabler
- block:
- tags:
- setup-all
- setup-synapse
block:
- when: matrix_synapse_ext_encryption_disabler_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/encryption-disabler/setup_install.yml"
tags:
- setup-all
- setup-synapse
# rest-auth
- block:
- tags:
- setup-all
- setup-synapse
block:
- when: matrix_synapse_ext_password_provider_rest_auth_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/rest-auth/setup_install.yml"
tags:
- setup-all
- setup-synapse
# shared-secret-auth
- block:
- tags:
- setup-all
- setup-synapse
block:
- when: matrix_synapse_ext_password_provider_shared_secret_auth_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/shared-secret-auth/setup_install.yml"
tags:
- setup-all
- setup-synapse
# ldap-auth
- block:
- tags:
- setup-all
- setup-synapse
block:
- when: matrix_synapse_ext_password_provider_ldap_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/ldap-auth/setup_install.yml"
tags:
- setup-all
- setup-synapse
# synapse-simple-antispam
- block:
- tags:
- setup-all
- setup-synapse
block:
- when: matrix_synapse_ext_spam_checker_synapse_simple_antispam_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/synapse-simple-antispam/setup_install.yml"
tags:
- setup-all
- setup-synapse
# mjolnir-antispam
- block:
- when: matrix_synapse_ext_spam_checker_mjolnir_antispam_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/mjolnir-antispam/setup_install.yml"
tags:
- tags:
- setup-all
- setup-synapse
block:
- when: matrix_synapse_ext_spam_checker_mjolnir_antispam_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/mjolnir-antispam/setup_install.yml"
# s3-storage-provider
- block:
- tags:
- setup-all
- setup-synapse
block:
- when: matrix_synapse_ext_synapse_s3_storage_provider_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/s3-storage-provider/validate_config.yml"
- when: matrix_synapse_ext_synapse_s3_storage_provider_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/s3-storage-provider/setup_install.yml"
tags:
- setup-all
- setup-synapse

View File

@ -1,52 +1,52 @@
---
# encryption-disabler
- block:
- tags:
- setup-all
- setup-synapse
block:
- when: not matrix_synapse_ext_encryption_disabler_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/encryption-disabler/setup_uninstall.yml"
tags:
- setup-all
- setup-synapse
# rest-auth
- block:
- tags:
- setup-all
- setup-synapse
block:
- when: not matrix_synapse_ext_password_provider_rest_auth_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/rest-auth/setup_uninstall.yml"
tags:
- setup-all
- setup-synapse
# shared-secret-auth
- block:
- when: not matrix_synapse_ext_password_provider_shared_secret_auth_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/shared-secret-auth/setup_uninstall.yml"
tags:
- tags:
- setup-all
- setup-synapse
block:
- when: not matrix_synapse_ext_password_provider_shared_secret_auth_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/shared-secret-auth/setup_uninstall.yml"
# ldap-auth has no uninstall tasks
# synapse-simple-antispam
- block:
- tags:
- setup-all
- setup-synapse
block:
- when: not matrix_synapse_ext_spam_checker_synapse_simple_antispam_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/synapse-simple-antispam/setup_uninstall.yml"
tags:
- setup-all
- setup-synapse
# mjolnir-antispam
- block:
- tags:
- setup-all
- setup-synapse
block:
- when: not matrix_synapse_ext_spam_checker_mjolnir_antispam_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/mjolnir-antispam/setup_uninstall.yml"
tags:
- setup-all
- setup-synapse
# s3-storage-provider
- block:
- when: not matrix_synapse_ext_synapse_s3_storage_provider_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/s3-storage-provider/setup_uninstall.yml"
tags:
- tags:
- setup-all
- setup-synapse
block:
- when: not matrix_synapse_ext_synapse_s3_storage_provider_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/s3-storage-provider/setup_uninstall.yml"

View File

@ -1,9 +1,6 @@
---
- block:
- when: matrix_synapse_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/init.yml"
tags:
- tags:
- setup-all
- setup-synapse
- install-all
@ -19,55 +16,58 @@
- stop
- stop-all
- stop-group
block:
- when: matrix_synapse_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/init.yml"
- block:
- tags:
- setup-all
- setup-synapse
- install-all
- install-synapse
block:
- when: matrix_synapse_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
- when: matrix_synapse_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
tags:
- tags:
- setup-all
- setup-synapse
- install-all
- install-synapse
- block:
block:
- when: not matrix_synapse_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
tags:
- setup-all
- setup-synapse
- block:
- tags:
- import-synapse-media-store
block:
- when: matrix_synapse_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/import_media_store.yml"
tags:
- import-synapse-media-store
- block:
- tags:
- register-user
block:
- when: matrix_synapse_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/register_user.yml"
tags:
- register-user
- block:
- tags:
- update-user-password
block:
- when: matrix_synapse_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/update_user_password.yml"
tags:
- update-user-password
- block:
- tags:
- rust-synapse-compress-state
block:
- when: matrix_synapse_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/rust-synapse-compress-state/main.yml"
tags:
- rust-synapse-compress-state
- block:
- tags:
- self-check
block:
- when: matrix_synapse_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/self_check_client_api.yml"
- when: matrix_synapse_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/self_check_federation_api.yml"
tags:
- self-check

View File

@ -23,33 +23,33 @@
# trying to chown/chmod it here will cause trouble.
when: item.when | bool
- block:
- tags:
- setup-all
- setup-synapse
block:
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/setup_install.yml"
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/setup_uninstall.yml"
tags:
- tags:
- setup-all
- setup-synapse
- block:
block:
- when: matrix_synapse_workers_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/setup_install.yml"
tags:
- tags:
- setup-all
- setup-synapse
- block:
block:
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/setup_install.yml"
tags:
- tags:
- setup-all
- setup-synapse
- block:
block:
- when: matrix_s3_media_store_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/goofys/setup_install.yml"
- when: not matrix_s3_media_store_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/goofys/setup_uninstall.yml"
tags:
- setup-all
- setup-synapse

View File

@ -1,27 +1,27 @@
---
- block:
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/setup_uninstall.yml"
tags:
- tags:
- setup-all
- setup-synapse
block:
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/ext/setup_uninstall.yml"
- block:
- tags:
- setup-all
- setup-synapse
block:
- when: not matrix_synapse_workers_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/setup_uninstall.yml"
tags:
- tags:
- setup-all
- setup-synapse
- block:
block:
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/setup_uninstall.yml"
tags:
- tags:
- setup-all
- setup-synapse
- block:
block:
- when: not matrix_s3_media_store_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/goofys/setup_uninstall.yml"
tags:
- setup-all
- setup-synapse

View File

@ -48,6 +48,7 @@
.
environment:
DOCKER_BUILDKIT: 1
changed_when: true
when: "matrix_synapse_git_pull_results.changed | bool or matrix_synapse_docker_image_check_result.stdout == ''"
- name: Ensure Synapse Docker image is pulled
@ -82,11 +83,6 @@
path: "{{ matrix_synapse_customized_docker_src_files_path }}"
nocache: "{{ matrix_synapse_docker_image_customized_build_nocache }}"
- name: Check if a Synapse signing key exists
ansible.builtin.stat:
path: "{{ matrix_synapse_config_dir_path }}/{{ matrix_server_fqn_matrix }}.signing.key"
register: matrix_synapse_signing_key_stat
# We do this so that the signing key would get generated.
#
# This will also generate a default homeserver.yaml configuration file and a log configuration file.
@ -95,19 +91,20 @@
# We don't use the `docker_container` module, because using it with `cap_drop` requires
# a very recent docker-py version, which is not available for a lot of people yet.
- name: Generate initial Synapse config and signing key
ansible.builtin.command: |
docker run
--rm
--name=matrix-config
--user={{ matrix_synapse_uid }}:{{ matrix_synapse_gid }}
--cap-drop=ALL
--mount type=bind,src={{ matrix_synapse_config_dir_path }},dst=/data
-e SYNAPSE_CONFIG_PATH=/data/homeserver.yaml
-e SYNAPSE_SERVER_NAME={{ matrix_server_fqn_matrix }}
-e SYNAPSE_REPORT_STATS=no
{{ matrix_synapse_docker_image }}
generate
when: "not matrix_synapse_signing_key_stat.stat.exists"
ansible.builtin.command:
cmd: |
docker run
--rm
--name=matrix-config
--user={{ matrix_synapse_uid }}:{{ matrix_synapse_gid }}
--cap-drop=ALL
--mount type=bind,src={{ matrix_synapse_config_dir_path }},dst=/data
-e SYNAPSE_CONFIG_PATH=/data/homeserver.yaml
-e SYNAPSE_SERVER_NAME={{ matrix_server_fqn_matrix }}
-e SYNAPSE_REPORT_STATS=no
{{ matrix_synapse_docker_image }}
generate
creates: "{{ matrix_synapse_config_dir_path }}/{{ matrix_server_fqn_matrix }}.signing.key"
- name: Ensure Synapse homeserver config installed
ansible.builtin.copy: