From 7e5b88c3b7ac42ba9f333867f985cf959834d0d3 Mon Sep 17 00:00:00 2001 From: Marko Weltzer Date: Sat, 5 Feb 2022 21:32:54 +0100 Subject: [PATCH 1/6] fix: all praise the allmighty yamllinter --- .github/FUNDING.yml | 1 + .yamllint | 5 + collections/requirements.yml | 2 +- docs/configuring-playbook-bot-go-neb.md | 6 +- docs/configuring-playbook-bot-mjolnir.md | 2 +- ...guring-playbook-bridge-mautrix-facebook.md | 2 +- ...ring-playbook-bridge-mautrix-googlechat.md | 2 +- ...guring-playbook-bridge-mautrix-hangouts.md | 2 +- ...figuring-playbook-bridge-mautrix-signal.md | 2 +- ...guring-playbook-bridge-mautrix-telegram.md | 2 +- ...guring-playbook-bridge-mautrix-whatsapp.md | 2 +- docs/configuring-playbook-dimension.md | 2 +- docs/configuring-playbook-email2matrix.md | 2 +- docs/updating-users-passwords.md | 2 +- examples/haproxy/docker-compose.yml | 3 +- examples/vars.yml | 1 + group_vars/matrix_servers | 22 +-- roles/matrix-aux/tasks/main.yml | 2 + roles/matrix-awx/defaults/main.yml | 2 + roles/matrix-awx/tasks/backup_server.yml | 11 +- .../tasks/bridge_discord_appservice.yml | 5 +- .../tasks/cache_matrix_variables.yml | 1 + .../matrix-awx/tasks/create_session_token.yml | 3 +- roles/matrix-awx/tasks/create_user.yml | 1 + .../tasks/customise_website_access_export.yml | 18 +- roles/matrix-awx/tasks/export_server.yml | 6 +- .../tasks/load_hosting_and_org_variables.yml | 6 +- .../tasks/load_matrix_variables.yml | 4 +- roles/matrix-awx/tasks/main.yml | 54 +++--- .../matrix-awx/tasks/purge_database_main.yml | 42 ++--- roles/matrix-awx/tasks/purge_media_main.yml | 27 +-- roles/matrix-awx/tasks/rotate_ssh.yml | 2 +- roles/matrix-awx/tasks/self_check.yml | 24 +-- .../tasks/set_variables_corporal.yml | 4 +- .../tasks/set_variables_dimension.yml | 14 +- .../tasks/set_variables_element.yml | 4 +- .../tasks/set_variables_element_subdomain.yml | 4 +- .../matrix-awx/tasks/set_variables_jitsi.yml | 6 +- .../matrix-awx/tasks/set_variables_ma1sd.yml | 9 +- .../matrix-awx/tasks/set_variables_mailer.yml | 4 +- .../tasks/set_variables_synapse.yml | 7 +- .../tasks/set_variables_synapse_admin.yml | 6 +- roles/matrix-awx/tasks/update_variables.yml | 4 +- roles/matrix-base/defaults/main.yml | 1 + .../matrix-base/tasks/clean_up_old_files.yml | 2 +- roles/matrix-base/tasks/main.yml | 2 + roles/matrix-base/tasks/server_base/setup.yml | 6 +- .../tasks/server_base/setup_archlinux.yml | 2 +- .../tasks/server_base/setup_centos.yml | 2 +- .../tasks/server_base/setup_centos8.yml | 4 +- .../tasks/server_base/setup_debian.yml | 6 +- .../tasks/server_base/setup_raspbian.yml | 6 +- roles/matrix-base/tasks/setup_matrix_user.yml | 4 +- roles/matrix-base/tasks/setup_well_known.yml | 1 + .../tasks/util/ensure_fuse_installed.yml | 2 +- .../tasks/util/ensure_openssl_installed.yml | 2 +- roles/matrix-base/vars/main.yml | 1 + roles/matrix-bot-go-neb/defaults/main.yml | 6 +- roles/matrix-bot-go-neb/tasks/init.yml | 2 + roles/matrix-bot-go-neb/tasks/main.yml | 2 + .../matrix-bot-go-neb/tasks/setup_install.yml | 8 +- .../tasks/setup_uninstall.yml | 6 +- roles/matrix-bot-honoroit/defaults/main.yml | 1 + roles/matrix-bot-honoroit/tasks/init.yml | 2 + roles/matrix-bot-honoroit/tasks/main.yml | 2 + .../tasks/setup_install.yml | 12 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 2 + .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 12 +- .../tasks/setup_uninstall.yml | 6 +- roles/matrix-bot-mjolnir/defaults/main.yml | 2 +- roles/matrix-bot-mjolnir/tasks/init.yml | 1 + roles/matrix-bot-mjolnir/tasks/main.yml | 2 + .../tasks/setup_install.yml | 12 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 1 + .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 6 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 1 + .../tasks/main.yml | 2 + .../tasks/migrate_nedb_to_postgres.yml | 4 +- .../tasks/setup_install.yml | 14 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 63 +++---- .../tasks/main.yml | 2 + .../tasks/migrate_nedb_to_postgres.yml | 4 +- .../tasks/setup_install.yml | 12 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 67 +++---- .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 12 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 2 + .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 70 +++---- .../tasks/setup_uninstall.yml | 6 +- .../tasks/validate_config.yml | 1 - .../defaults/main.yml | 7 +- .../matrix-bridge-heisenbridge/tasks/init.yml | 1 + .../matrix-bridge-heisenbridge/tasks/main.yml | 2 + .../tasks/setup_install.yml | 6 +- .../tasks/setup_uninstall.yml | 6 +- .../matrix-bridge-hookshot/defaults/main.yml | 8 +- roles/matrix-bridge-hookshot/tasks/init.yml | 171 +++++++++--------- roles/matrix-bridge-hookshot/tasks/main.yml | 2 + .../tasks/setup_install.yml | 2 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 1 + .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 63 +++---- .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- .../tasks/validate_config.yml | 2 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 63 +++---- .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- .../tasks/validate_config.yml | 2 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 1 + .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 15 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 2 + .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 6 +- .../tasks/setup_uninstall.yml | 10 +- .../defaults/main.yml | 3 +- .../tasks/init.yml | 63 +++---- .../tasks/main.yml | 1 + .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 2 + .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 14 +- .../tasks/setup_uninstall.yml | 4 +- .../defaults/main.yml | 3 +- .../tasks/init.yml | 1 + .../tasks/main.yml | 1 + .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- .../tasks/validate_config.yml | 1 - .../defaults/main.yml | 1 + .../tasks/init.yml | 1 + .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 1 + .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 2 +- .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 12 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 1 + .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 63 +++---- .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 1 + .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- .../defaults/main.yml | 2 + .../tasks/init.yml | 63 +++---- .../tasks/main.yml | 2 + .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- roles/matrix-bridge-sms/defaults/main.yml | 1 + roles/matrix-bridge-sms/tasks/init.yml | 2 + roles/matrix-bridge-sms/tasks/main.yml | 2 + .../matrix-bridge-sms/tasks/setup_install.yml | 4 +- .../tasks/setup_uninstall.yml | 4 +- .../tasks/validate_config.yml | 2 +- roles/matrix-client-cinny/defaults/main.yml | 2 + roles/matrix-client-cinny/tasks/init.yml | 1 + roles/matrix-client-cinny/tasks/main.yml | 2 + .../matrix-client-cinny/tasks/self_check.yml | 2 +- .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- roles/matrix-client-element/defaults/main.yml | 2 + roles/matrix-client-element/tasks/init.yml | 2 + roles/matrix-client-element/tasks/main.yml | 2 + .../tasks/migrate_riot_web.yml | 6 +- .../tasks/prepare_themes.yml | 2 +- .../tasks/self_check.yml | 2 +- .../tasks/setup_install.yml | 10 +- .../tasks/setup_uninstall.yml | 6 +- .../matrix-client-hydrogen/defaults/main.yml | 2 + roles/matrix-client-hydrogen/tasks/init.yml | 1 + roles/matrix-client-hydrogen/tasks/main.yml | 2 + .../tasks/self_check.yml | 2 +- .../tasks/setup_install.yml | 16 +- .../tasks/setup_uninstall.yml | 6 +- roles/matrix-common-after/defaults/main.yml | 1 + roles/matrix-common-after/tasks/awx_post.yml | 6 +- .../tasks/dump_runtime_results.yml | 1 + roles/matrix-common-after/tasks/main.yml | 5 +- roles/matrix-common-after/tasks/start.yml | 62 +++---- roles/matrix-corporal/defaults/main.yml | 3 +- roles/matrix-corporal/tasks/init.yml | 1 + roles/matrix-corporal/tasks/main.yml | 2 + .../tasks/self_check_corporal.yml | 2 +- .../matrix-corporal/tasks/setup_corporal.yml | 10 +- roles/matrix-coturn/defaults/main.yml | 2 + roles/matrix-coturn/tasks/init.yml | 1 + roles/matrix-coturn/tasks/main.yml | 2 + roles/matrix-coturn/tasks/setup_install.yml | 6 +- roles/matrix-coturn/tasks/setup_uninstall.yml | 10 +- roles/matrix-dendrite/defaults/main.yml | 3 +- .../matrix-dendrite/tasks/dendrite/setup.yml | 1 + .../tasks/dendrite/setup_install.yml | 4 +- .../tasks/dendrite/setup_uninstall.yml | 6 +- roles/matrix-dendrite/tasks/init.yml | 2 + roles/matrix-dendrite/tasks/main.yml | 2 + roles/matrix-dendrite/tasks/register_user.yml | 2 +- .../tasks/self_check_client_api.yml | 2 +- .../tasks/self_check_federation_api.yml | 2 +- .../matrix-dendrite/tasks/setup_dendrite.yml | 4 +- roles/matrix-dimension/defaults/main.yml | 2 + roles/matrix-dimension/tasks/init.yml | 1 + roles/matrix-dimension/tasks/main.yml | 2 + .../matrix-dimension/tasks/setup_install.yml | 4 +- .../tasks/setup_uninstall.yml | 6 +- .../tasks/validate_config.yml | 1 + roles/matrix-dimension/vars/main.yml | 2 +- roles/matrix-dynamic-dns/defaults/main.yml | 1 + roles/matrix-dynamic-dns/tasks/init.yml | 1 + roles/matrix-dynamic-dns/tasks/install.yml | 10 +- roles/matrix-dynamic-dns/tasks/main.yml | 2 + roles/matrix-dynamic-dns/tasks/uninstall.yml | 6 +- roles/matrix-email2matrix/defaults/main.yml | 2 + roles/matrix-email2matrix/tasks/init.yml | 2 + roles/matrix-email2matrix/tasks/main.yml | 2 + .../tasks/setup_install.yml | 10 +- .../tasks/setup_uninstall.yml | 6 +- roles/matrix-etherpad/defaults/main.yml | 2 + roles/matrix-etherpad/tasks/init.yml | 84 ++++----- roles/matrix-etherpad/tasks/main.yml | 2 + roles/matrix-etherpad/tasks/setup_install.yml | 2 +- .../matrix-etherpad/tasks/setup_uninstall.yml | 6 +- .../matrix-etherpad/tasks/validate_config.yml | 2 + roles/matrix-grafana/defaults/main.yml | 7 +- roles/matrix-grafana/tasks/init.yml | 4 +- roles/matrix-grafana/tasks/main.yml | 2 + roles/matrix-grafana/tasks/setup.yml | 9 +- roles/matrix-jitsi/defaults/main.yml | 4 +- roles/matrix-jitsi/tasks/init.yml | 2 + roles/matrix-jitsi/tasks/main.yml | 2 + roles/matrix-jitsi/tasks/setup_jitsi_base.yml | 2 +- .../matrix-jitsi/tasks/setup_jitsi_jicofo.yml | 12 +- roles/matrix-jitsi/tasks/setup_jitsi_jvb.yml | 12 +- .../tasks/setup_jitsi_prosody.yml | 14 +- roles/matrix-jitsi/tasks/setup_jitsi_web.yml | 17 +- .../tasks/util/setup_jitsi_auth.yml | 6 +- roles/matrix-jitsi/tasks/validate_config.yml | 1 - roles/matrix-ma1sd/defaults/main.yml | 1 + roles/matrix-ma1sd/tasks/init.yml | 1 + roles/matrix-ma1sd/tasks/main.yml | 2 + roles/matrix-ma1sd/tasks/migrate_mxisd.yml | 32 ++-- roles/matrix-ma1sd/tasks/self_check_ma1sd.yml | 2 +- roles/matrix-ma1sd/tasks/setup_install.yml | 90 ++++----- roles/matrix-ma1sd/tasks/setup_uninstall.yml | 6 +- roles/matrix-mailer/defaults/main.yml | 2 + roles/matrix-mailer/tasks/init.yml | 1 + roles/matrix-mailer/tasks/main.yml | 2 + roles/matrix-mailer/tasks/setup_mailer.yml | 14 +- roles/matrix-nginx-proxy/defaults/main.yml | 1 + roles/matrix-nginx-proxy/tasks/init.yml | 1 + roles/matrix-nginx-proxy/tasks/main.yml | 3 +- .../tasks/self_check_well_known_file.yml | 4 +- .../tasks/setup_nginx_proxy.yml | 8 +- .../tasks/setup_well_known.yml | 3 +- ...tup_ssl_lets_encrypt_obtain_for_domain.yml | 19 +- .../tasks/ssl/setup_ssl_manually_managed.yml | 2 +- ...ssl_manually_managed_verify_for_domain.yml | 2 +- .../matrix-postgres-backup/defaults/main.yml | 2 + roles/matrix-postgres-backup/tasks/init.yml | 2 + .../tasks/setup_postgres_backup.yml | 8 +- roles/matrix-postgres/defaults/main.yml | 2 + .../tasks/import_generic_sqlite_db.yml | 2 +- .../matrix-postgres/tasks/import_postgres.yml | 2 +- .../tasks/import_synapse_sqlite_db.yml | 4 +- roles/matrix-postgres/tasks/init.yml | 2 + roles/matrix-postgres/tasks/main.yml | 2 + .../tasks/migrate_postgres_data_directory.yml | 4 +- roles/matrix-postgres/tasks/run_vacuum.yml | 6 +- .../matrix-postgres/tasks/setup_postgres.yml | 8 +- .../tasks/upgrade_postgres.yml | 8 +- .../util/create_additional_databases.yml | 2 +- .../tasks/util/migrate_db_to_postgres.yml | 4 +- .../defaults/main.yml | 1 + .../tasks/init.yml | 4 +- .../tasks/main.yml | 2 + .../tasks/setup.yml | 8 +- .../defaults/main.yml | 7 +- .../tasks/init.yml | 4 +- .../tasks/main.yml | 2 + .../tasks/setup.yml | 8 +- roles/matrix-prometheus/defaults/main.yml | 1 + roles/matrix-prometheus/tasks/init.yml | 4 +- roles/matrix-prometheus/tasks/main.yml | 2 + .../matrix-prometheus/tasks/setup_install.yml | 2 +- .../tasks/setup_uninstall.yml | 6 +- roles/matrix-redis/defaults/main.yml | 2 + roles/matrix-redis/tasks/init.yml | 2 + roles/matrix-redis/tasks/main.yml | 2 + roles/matrix-redis/tasks/setup_redis.yml | 10 +- roles/matrix-registration/defaults/main.yml | 1 + .../tasks/generate_token.yml | 8 +- roles/matrix-registration/tasks/init.yml | 79 ++++---- .../matrix-registration/tasks/list_tokens.yml | 8 +- roles/matrix-registration/tasks/main.yml | 2 + .../tasks/setup_install.yml | 12 +- .../tasks/setup_uninstall.yml | 6 +- roles/matrix-sygnal/defaults/main.yml | 1 + roles/matrix-sygnal/tasks/init.yml | 2 + roles/matrix-sygnal/tasks/main.yml | 2 + roles/matrix-sygnal/tasks/setup_install.yml | 2 +- roles/matrix-sygnal/tasks/setup_uninstall.yml | 6 +- roles/matrix-sygnal/tasks/validate_config.yml | 2 + roles/matrix-synapse-admin/defaults/main.yml | 1 + roles/matrix-synapse-admin/tasks/init.yml | 63 +++---- roles/matrix-synapse-admin/tasks/main.yml | 2 + roles/matrix-synapse-admin/tasks/setup.yml | 10 +- roles/matrix-synapse/defaults/main.yml | 5 +- .../tasks/ext/ldap-auth/setup.yml | 2 + .../ext/mjolnir-antispam/setup_install.yml | 6 +- .../synapse-simple-antispam/setup_install.yml | 6 +- .../tasks/goofys/setup_install.yml | 6 +- .../tasks/goofys/setup_uninstall.yml | 8 +- .../tasks/import_media_store.yml | 16 +- roles/matrix-synapse/tasks/init.yml | 1 + roles/matrix-synapse/tasks/main.yml | 4 +- roles/matrix-synapse/tasks/register_user.yml | 2 +- .../compress_room.yml | 2 + .../rust-synapse-compress-state/main.yml | 11 +- .../tasks/self_check_client_api.yml | 2 +- .../tasks/self_check_federation_api.yml | 4 +- roles/matrix-synapse/tasks/setup_synapse.yml | 6 +- .../tasks/synapse/setup_install.yml | 52 +++--- .../tasks/synapse/setup_uninstall.yml | 8 +- .../tasks/synapse/workers/init.yml | 1 + .../tasks/synapse/workers/setup_uninstall.yml | 2 +- .../inject_systemd_services_for_worker.yml | 1 + .../workers/util/setup_files_for_worker.yml | 2 + .../tasks/update_user_password.yml | 4 +- roles/matrix-synapse/vars/workers.yml | 10 +- 373 files changed, 1565 insertions(+), 1296 deletions(-) create mode 100644 .yamllint diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 6e7102bf7..463b7cd47 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,4 @@ +--- # These are supported funding model platforms # https://liberapay.com/s.pantaleev/ diff --git a/.yamllint b/.yamllint new file mode 100644 index 000000000..75da2b702 --- /dev/null +++ b/.yamllint @@ -0,0 +1,5 @@ +--- +extends: default + +rules: + line-length: disable diff --git a/collections/requirements.yml b/collections/requirements.yml index 9d365441f..483ed156a 100644 --- a/collections/requirements.yml +++ b/collections/requirements.yml @@ -1,4 +1,4 @@ --- collections: - name: community.general - - name: community.docker + - name: community.docker diff --git a/docs/configuring-playbook-bot-go-neb.md b/docs/configuring-playbook-bot-go-neb.md index 33ce4dd31..00072b77a 100644 --- a/docs/configuring-playbook-bot-go-neb.md +++ b/docs/configuring-playbook-bot-go-neb.md @@ -28,7 +28,7 @@ If you use curl, you can get an access token like this: ``` curl -X POST --header 'Content-Type: application/json' -d '{ - "identifier": { "type": "m.id.user", "user": "bot.go-neb" }, + "identifier": { "type": "m.id.user", "user": "bot.go-neb"}, "password": "a strong password", "type": "m.login.password" }' 'https://matrix.YOURDOMAIN/_matrix/client/r0/login' @@ -198,8 +198,8 @@ matrix_bot_go_neb_services: # Each room will get the notification with the alert rendered with the given template rooms: "!someroomid:domain.tld": - text_template: "{% raw %}{{range .Alerts -}} [{{ .Status }}] {{index .Labels \"alertname\" }}: {{index .Annotations \"description\"}} {{ end -}}{% endraw %}" - html_template: "{% raw %}{{range .Alerts -}} {{ $severity := index .Labels \"severity\" }} {{ if eq .Status \"firing\" }} {{ if eq $severity \"critical\"}} [FIRING - CRITICAL] {{ else if eq $severity \"warning\"}} [FIRING - WARNING] {{ else }} [FIRING - {{ $severity }}] {{ end }} {{ else }} [RESOLVED] {{ end }} {{ index .Labels \"alertname\"}} : {{ index .Annotations \"description\"}} source
{{end -}}{% endraw %}" + text_template: "{% raw %}{{range .Alerts -}} [{{ .Status }}] {{index .Labels \"alertname\"}}: {{index .Annotations \"description\"}} {{ end -}}{% endraw %}" + html_template: "{% raw %}{{range .Alerts -}} {{ $severity := index .Labels \"severity\"}} {{ if eq .Status \"firing\"}} {{ if eq $severity \"critical\"}} [FIRING - CRITICAL] {{ else if eq $severity \"warning\"}} [FIRING - WARNING] {{ else }} [FIRING - {{ $severity }}] {{ end }} {{ else }} [RESOLVED] {{ end }} {{ index .Labels \"alertname\"}} : {{ index .Annotations \"description\"}} source
{{end -}}{% endraw %}" msg_type: "m.text" # Must be either `m.text` or `m.notice` ``` diff --git a/docs/configuring-playbook-bot-mjolnir.md b/docs/configuring-playbook-bot-mjolnir.md index 5ddb2ad3c..5c2e14e44 100644 --- a/docs/configuring-playbook-bot-mjolnir.md +++ b/docs/configuring-playbook-bot-mjolnir.md @@ -28,7 +28,7 @@ If you use curl, you can get an access token like this: ``` curl -X POST --header 'Content-Type: application/json' -d '{ - "identifier": { "type": "m.id.user", "user": "bot.mjolnir" }, + "identifier": { "type": "m.id.user", "user": "bot.mjolnir"}, "password": "PASSWORD_FOR_THE_BOT", "type": "m.login.password" }' 'https://matrix.DOMAIN/_matrix/client/r0/login' diff --git a/docs/configuring-playbook-bridge-mautrix-facebook.md b/docs/configuring-playbook-bridge-mautrix-facebook.md index 282865e73..69462cee7 100644 --- a/docs/configuring-playbook-bridge-mautrix-facebook.md +++ b/docs/configuring-playbook-bridge-mautrix-facebook.md @@ -50,7 +50,7 @@ When using this method, **each user** that wishes to enable Double Puppeting nee ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Facebook", "initial_device_display_name": "Mautrix-Facebook"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME"}, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Facebook", "initial_device_display_name": "Mautrix-Facebook"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/configuring-playbook-bridge-mautrix-googlechat.md b/docs/configuring-playbook-bridge-mautrix-googlechat.md index 381d1f290..d2b0fc1ea 100644 --- a/docs/configuring-playbook-bridge-mautrix-googlechat.md +++ b/docs/configuring-playbook-bridge-mautrix-googlechat.md @@ -33,7 +33,7 @@ When using this method, **each user** that wishes to enable Double Puppeting nee ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-googlechat", "initial_device_display_name": "Mautrix-googlechat"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME"}, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-googlechat", "initial_device_display_name": "Mautrix-googlechat"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/configuring-playbook-bridge-mautrix-hangouts.md b/docs/configuring-playbook-bridge-mautrix-hangouts.md index f6129777d..30f015067 100644 --- a/docs/configuring-playbook-bridge-mautrix-hangouts.md +++ b/docs/configuring-playbook-bridge-mautrix-hangouts.md @@ -35,7 +35,7 @@ When using this method, **each user** that wishes to enable Double Puppeting nee ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Hangouts", "initial_device_display_name": "Mautrix-Hangouts"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME"}, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Hangouts", "initial_device_display_name": "Mautrix-Hangouts"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/configuring-playbook-bridge-mautrix-signal.md b/docs/configuring-playbook-bridge-mautrix-signal.md index f47640b9f..0aacb32f4 100644 --- a/docs/configuring-playbook-bridge-mautrix-signal.md +++ b/docs/configuring-playbook-bridge-mautrix-signal.md @@ -77,7 +77,7 @@ When using this method, **each user** that wishes to enable Double Puppeting nee ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Signal", "initial_device_display_name": "Mautrix-Signal"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME"}, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Signal", "initial_device_display_name": "Mautrix-Signal"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/configuring-playbook-bridge-mautrix-telegram.md b/docs/configuring-playbook-bridge-mautrix-telegram.md index 0ac6c1030..c92607449 100644 --- a/docs/configuring-playbook-bridge-mautrix-telegram.md +++ b/docs/configuring-playbook-bridge-mautrix-telegram.md @@ -32,7 +32,7 @@ When using this method, **each user** that wishes to enable Double Puppeting nee ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Telegram", "initial_device_display_name": "Mautrix-Telegram"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME"}, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Telegram", "initial_device_display_name": "Mautrix-Telegram"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/configuring-playbook-bridge-mautrix-whatsapp.md b/docs/configuring-playbook-bridge-mautrix-whatsapp.md index 2af38be1f..a6c975a9e 100644 --- a/docs/configuring-playbook-bridge-mautrix-whatsapp.md +++ b/docs/configuring-playbook-bridge-mautrix-whatsapp.md @@ -48,7 +48,7 @@ When using this method, **each user** that wishes to enable Double Puppeting nee ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Whatsapp", "initial_device_display_name": "Mautrix-Whatsapp"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME"}, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Whatsapp", "initial_device_display_name": "Mautrix-Whatsapp"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/configuring-playbook-dimension.md b/docs/configuring-playbook-dimension.md index b938a6a32..bc9d63e77 100644 --- a/docs/configuring-playbook-dimension.md +++ b/docs/configuring-playbook-dimension.md @@ -53,7 +53,7 @@ To get an access token for the Dimension user, you can follow one of two options ``` curl -X POST --header 'Content-Type: application/json' -d '{ - "identifier": { "type": "m.id.user", "user": "YourDimensionUsername" }, + "identifier": { "type": "m.id.user", "user": "YourDimensionUsername"}, "password": "YourDimensionPassword", "type": "m.login.password" }' 'https://matrix.YOURDOMAIN/_matrix/client/r0/login' diff --git a/docs/configuring-playbook-email2matrix.md b/docs/configuring-playbook-email2matrix.md index 510a9dcc8..734a0273c 100644 --- a/docs/configuring-playbook-email2matrix.md +++ b/docs/configuring-playbook-email2matrix.md @@ -40,7 +40,7 @@ To do this, you can execute a command like this: ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "email2matrix" }, "password": "MATRIX_PASSWORD_FOR_THE_USER", "type": "m.login.password", "device_id": "Email2Matrix", "initial_device_display_name": "Email2Matrix"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "email2matrix"}, "password": "MATRIX_PASSWORD_FOR_THE_USER", "type": "m.login.password", "device_id": "Email2Matrix", "initial_device_display_name": "Email2Matrix"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/updating-users-passwords.md b/docs/updating-users-passwords.md index 7d2f28329..0bf1e1815 100644 --- a/docs/updating-users-passwords.md +++ b/docs/updating-users-passwords.md @@ -41,5 +41,5 @@ If you didn't make your account a server admin when you created it, you can use ### Example: To set @user:domain.com's password to `correct_horse_battery_staple` you could use this curl command: ``` -curl -XPOST -d '{ "new_password": "correct_horse_battery_staple" }' "https://matrix./_matrix/client/r0/admin/reset_password/@user:domain.com?access_token=MDA...this_is_my_access_token +curl -XPOST -d '{ "new_password": "correct_horse_battery_staple"}' "https://matrix./_matrix/client/r0/admin/reset_password/@user:domain.com?access_token=MDA...this_is_my_access_token ``` diff --git a/examples/haproxy/docker-compose.yml b/examples/haproxy/docker-compose.yml index 9177161d2..b5c9aab79 100644 --- a/examples/haproxy/docker-compose.yml +++ b/examples/haproxy/docker-compose.yml @@ -1,7 +1,8 @@ +--- version: '3' services: nginx: - image: local/nginx + image: local/nginx ports: - 40888:80 volumes: diff --git a/examples/vars.yml b/examples/vars.yml index f57769624..3ca8f4601 100644 --- a/examples/vars.yml +++ b/examples/vars.yml @@ -1,3 +1,4 @@ +--- # The bare domain name which represents your Matrix identity. # Matrix user ids for your server will be of the form (`@user:`). # diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index aaec21e33..2def05975 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -265,7 +265,7 @@ matrix_beeper_linkedin_homeserver_token: "{{ '%s' | format(matrix_homeserver_gen matrix_beeper_linkedin_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}" -matrix_beeper_linkedin_bridge_presence: "{{ matrix_synapse_presence_enabled if matrix_synapse_enabled else true }}" +matrix_beeper_linkedin_bridge_presence: "{{ matrix_synapse_presence_enabled if matrix_synapse_enabled else true}}" matrix_beeper_linkedin_database_password: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'maulinkedin.db') | to_uuid }}" @@ -303,7 +303,7 @@ matrix_mautrix_facebook_homeserver_token: "{{ '%s' | format(matrix_homeserver_ge matrix_mautrix_facebook_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}" -matrix_mautrix_facebook_bridge_presence: "{{ matrix_synapse_presence_enabled if matrix_synapse_enabled else true }}" +matrix_mautrix_facebook_bridge_presence: "{{ matrix_synapse_presence_enabled if matrix_synapse_enabled else true}}" # We'd like to force-set people with external Postgres to SQLite, so the bridge role can complain # and point them to a migration path. @@ -427,7 +427,7 @@ matrix_mautrix_instagram_homeserver_token: "{{ '%s' | format(matrix_homeserver_g matrix_mautrix_instagram_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}" -matrix_mautrix_instagram_bridge_presence: "{{ matrix_synapse_presence_enabled if matrix_synapse_enabled else true }}" +matrix_mautrix_instagram_bridge_presence: "{{ matrix_synapse_presence_enabled if matrix_synapse_enabled else true}}" # We'd like to force-set people with external Postgres to SQLite, so the bridge role can complain # and point them to a migration path. @@ -1367,7 +1367,7 @@ matrix_ma1sd_threepid_medium_email_connectors_smtp_host: "matrix-mailer" matrix_ma1sd_threepid_medium_email_connectors_smtp_port: 8025 matrix_ma1sd_threepid_medium_email_connectors_smtp_tls: 0 -matrix_ma1sd_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" +matrix_ma1sd_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" matrix_ma1sd_systemd_required_services_list: | {{ @@ -1479,7 +1479,7 @@ matrix_nginx_proxy_proxy_matrix_user_directory_search_enabled: "{{ matrix_ma1sd_ matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_with_container: "{{ matrix_nginx_proxy_proxy_matrix_identity_api_addr_with_container }}" matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_sans_container: "{{ matrix_nginx_proxy_proxy_matrix_identity_api_addr_sans_container }}" -matrix_nginx_proxy_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" +matrix_nginx_proxy_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" # OCSP stapling does not make sense when self-signed certificates are used. # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1073 @@ -1886,7 +1886,7 @@ matrix_client_element_integrations_rest_url: "{{ matrix_dimension_integrations_r matrix_client_element_integrations_widgets_urls: "{{ matrix_dimension_integrations_widgets_urls if matrix_dimension_enabled else ['https://scalar.vector.im/api'] }}" matrix_client_element_integrations_jitsi_widget_url: "{{ matrix_dimension_integrations_jitsi_widget_url if matrix_dimension_enabled else 'https://scalar.vector.im/api/widgets/jitsi.html' }}" -matrix_client_element_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" +matrix_client_element_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" matrix_client_element_registration_enabled: "{{ matrix_synapse_enable_registration }}" @@ -1924,7 +1924,7 @@ matrix_client_hydrogen_container_http_host_bind_port: "{{ '' if matrix_nginx_pro matrix_client_hydrogen_default_hs_url: "{{ matrix_homeserver_url }}" -matrix_client_hydrogen_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" +matrix_client_hydrogen_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" ###################################################################### # @@ -1951,7 +1951,7 @@ matrix_client_cinny_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_ matrix_client_cinny_default_hs_url: "{{ matrix_homeserver_url }}" -matrix_client_cinny_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" +matrix_client_cinny_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" ###################################################################### # @@ -2042,7 +2042,7 @@ matrix_synapse_turn_uris: | matrix_synapse_turn_shared_secret: "{{ matrix_coturn_turn_static_auth_secret if matrix_coturn_enabled else '' }}" -matrix_synapse_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" +matrix_synapse_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" matrix_synapse_systemd_required_services_list: | {{ @@ -2228,7 +2228,7 @@ matrix_registration_shared_secret: |- matrix_registration_server_location: "{{ matrix_homeserver_container_url }}" -matrix_registration_api_validate_certs: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" +matrix_registration_api_validate_certs: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" matrix_registration_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" @@ -2320,7 +2320,7 @@ matrix_dendrite_turn_shared_secret: "{{ matrix_coturn_turn_static_auth_secret if matrix_dendrite_disable_tls_validation: "{{ true if matrix_ssl_retrieval_method == 'self-signed' else false }}" -matrix_dendrite_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" +matrix_dendrite_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" matrix_dendrite_trusted_id_servers: "{{ [matrix_server_fqn_matrix] if matrix_ma1sd_enabled else ['matrix.org', 'vector.im'] }}" diff --git a/roles/matrix-aux/tasks/main.yml b/roles/matrix-aux/tasks/main.yml index ee93f63ae..2585715be 100644 --- a/roles/matrix-aux/tasks/main.yml +++ b/roles/matrix-aux/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/setup.yml" when: run_stop|bool tags: diff --git a/roles/matrix-awx/defaults/main.yml b/roles/matrix-awx/defaults/main.yml index 1b61797eb..cb8473251 100755 --- a/roles/matrix-awx/defaults/main.yml +++ b/roles/matrix-awx/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_awx_enabled: true # Defaults for 'Customise Website + Access Export' template diff --git a/roles/matrix-awx/tasks/backup_server.yml b/roles/matrix-awx/tasks/backup_server.yml index d33f0f704..553eb1b94 100644 --- a/roles/matrix-awx/tasks/backup_server.yml +++ b/roles/matrix-awx/tasks/backup_server.yml @@ -1,3 +1,4 @@ +--- - name: Record Backup Server variables locally on AWX delegate_to: 127.0.0.1 @@ -38,18 +39,18 @@ credential: "{{ member_id }} - AWX SSH Key" survey_enabled: true survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/backup_server.json') }}" - become_enabled: yes + become_enabled: true state: present verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true tags: use-survey - name: Include vars in matrix_vars.yml include_vars: file: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml' - no_log: True + no_log: true - name: Copy new 'matrix_vars.yml' to target machine copy: @@ -58,8 +59,8 @@ mode: '0660' tags: use-survey -- name: Run initial backup of /matrix/ and snapshot the database simultaneously - command: "{{ item }}" +- name: Run initial backup of /matrix/ and snapshot the database simultaneously + command: "{{ item }}" with_items: - borgmatic -c /root/.config/borgmatic/config_1.yaml - /bin/sh /usr/local/bin/awx-export-service.sh 1 0 diff --git a/roles/matrix-awx/tasks/bridge_discord_appservice.yml b/roles/matrix-awx/tasks/bridge_discord_appservice.yml index 7cb24028e..3c124db3a 100644 --- a/roles/matrix-awx/tasks/bridge_discord_appservice.yml +++ b/roles/matrix-awx/tasks/bridge_discord_appservice.yml @@ -1,3 +1,4 @@ +--- - name: Record Bridge Discord AppService variables locally on AWX delegate_to: 127.0.0.1 @@ -33,7 +34,7 @@ - name: Copy new 'Bridge Discord Appservice' survey.json to target machine copy: src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/bridge_discord_appservice.json' - dest: '/matrix/awx/bridge_discord_appservice.json' + dest: '/matrix/awx/bridge_discord_appservice.json' mode: '0660' - name: Recreate 'Bridge Discord Appservice' job template @@ -54,4 +55,4 @@ verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true diff --git a/roles/matrix-awx/tasks/cache_matrix_variables.yml b/roles/matrix-awx/tasks/cache_matrix_variables.yml index a34b3792c..ca41880a7 100644 --- a/roles/matrix-awx/tasks/cache_matrix_variables.yml +++ b/roles/matrix-awx/tasks/cache_matrix_variables.yml @@ -1,3 +1,4 @@ +--- - name: Collect current datetime set_fact: diff --git a/roles/matrix-awx/tasks/create_session_token.yml b/roles/matrix-awx/tasks/create_session_token.yml index 9f22a37ea..7d984b3d8 100644 --- a/roles/matrix-awx/tasks/create_session_token.yml +++ b/roles/matrix-awx/tasks/create_session_token.yml @@ -1,3 +1,4 @@ +--- - name: Create a AWX session token for executing modules awx.awx.tower_token: @@ -7,4 +8,4 @@ tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_master_token }}" register: awx_session_token - no_log: True + no_log: true diff --git a/roles/matrix-awx/tasks/create_user.yml b/roles/matrix-awx/tasks/create_user.yml index fefec426d..7d203ed0a 100755 --- a/roles/matrix-awx/tasks/create_user.yml +++ b/roles/matrix-awx/tasks/create_user.yml @@ -1,3 +1,4 @@ +--- # # Create user and define if they are admin # diff --git a/roles/matrix-awx/tasks/customise_website_access_export.yml b/roles/matrix-awx/tasks/customise_website_access_export.yml index c9b96026c..80d6d7956 100755 --- a/roles/matrix-awx/tasks/customise_website_access_export.yml +++ b/roles/matrix-awx/tasks/customise_website_access_export.yml @@ -48,7 +48,7 @@ - name: Reload vars in matrix_vars.yml include_vars: file: '{{ awx_cached_matrix_vars }}' - no_log: True + no_log: true - name: Save new 'Customise Website + Access Export' survey.json to the AWX tower, template delegate_to: 127.0.0.1 @@ -60,7 +60,7 @@ - name: Copy new 'Customise Website + Access Export' survey.json to target machine copy: src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_website_access_export.json' - dest: '/matrix/awx/configure_website_access_export.json' + dest: '/matrix/awx/configure_website_access_export.json' mode: '0660' when: awx_customise_base_domain_website is defined @@ -74,7 +74,7 @@ - name: Copy new 'Customise Website + Access Export' survey.json to target machine copy: src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/access_export.json' - dest: '/matrix/awx/access_export.json' + dest: '/matrix/awx/access_export.json' mode: '0660' when: awx_customise_base_domain_website is undefined @@ -92,12 +92,12 @@ credential: "{{ member_id }} - AWX SSH Key" survey_enabled: true survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_website_access_export.json') }}" - become_enabled: yes + become_enabled: true state: present verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true when: awx_customise_base_domain_website is defined - name: Recreate 'Access Export' job template @@ -114,12 +114,12 @@ credential: "{{ member_id }} - AWX SSH Key" survey_enabled: true survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/access_export.json') }}" - become_enabled: yes + become_enabled: true state: present verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true when: awx_customise_base_domain_website is undefined - name: If user doesn't define a awx_sftp_password, create a disabled 'sftp' account @@ -153,7 +153,7 @@ user: name: sftp groups: sftp - append: yes + append: true when: awx_customise_base_domain_website is defined - name: Create the ro /chroot directory with sticky bit if it doesn't exist. (/chroot/website has matrix:matrix permissions and is mounted to nginx container) @@ -208,7 +208,7 @@ group: sftp mode: '0644' when: (awx_sftp_public_key | length > 0) and (awx_sftp_auth_method == "SSH Key") - + - name: Remove any existing Subsystem lines lineinfile: path: /etc/ssh/sshd_config diff --git a/roles/matrix-awx/tasks/export_server.yml b/roles/matrix-awx/tasks/export_server.yml index d779028e7..a2b97e79e 100644 --- a/roles/matrix-awx/tasks/export_server.yml +++ b/roles/matrix-awx/tasks/export_server.yml @@ -1,7 +1,7 @@ --- -- name: Run export of /matrix/ and snapshot the database simultaneously - command: "{{ item }}" +- name: Run export of /matrix/ and snapshot the database simultaneously + command: "{{ item }}" with_items: - /bin/sh /usr/local/bin/awx-export-service.sh 1 0 - /bin/sh /usr/local/bin/awx-export-service.sh 0 1 @@ -23,7 +23,7 @@ command: rm /chroot/export/matrix* count: 1 units: days - unique: yes + unique: true - name: Delete the AWX session token for executing modules awx.awx.tower_token: diff --git a/roles/matrix-awx/tasks/load_hosting_and_org_variables.yml b/roles/matrix-awx/tasks/load_hosting_and_org_variables.yml index 69b2aac80..6e8bb8995 100644 --- a/roles/matrix-awx/tasks/load_hosting_and_org_variables.yml +++ b/roles/matrix-awx/tasks/load_hosting_and_org_variables.yml @@ -3,14 +3,14 @@ - name: Include vars in organisation.yml include_vars: file: '/var/lib/awx/projects/clients/{{ member_id }}/organisation.yml' - no_log: True + no_log: true - name: Include vars in hosting_vars.yml include_vars: file: '/var/lib/awx/projects/hosting/hosting_vars.yml' - no_log: True + no_log: true - name: Include AWX master token from awx_tokens.yml include_vars: file: /var/lib/awx/projects/hosting/awx_tokens.yml - no_log: True + no_log: true diff --git a/roles/matrix-awx/tasks/load_matrix_variables.yml b/roles/matrix-awx/tasks/load_matrix_variables.yml index 34754efb3..7a76f34b8 100755 --- a/roles/matrix-awx/tasks/load_matrix_variables.yml +++ b/roles/matrix-awx/tasks/load_matrix_variables.yml @@ -3,9 +3,9 @@ - name: Include new vars in matrix_vars.yml include_vars: file: '{{ awx_cached_matrix_vars }}' - no_log: True + no_log: true -- name: If include_vars succeeds overwrite the old matrix_vars.yml +- name: If include_vars succeeds overwrite the old matrix_vars.yml delegate_to: 127.0.0.1 shell: "cp {{ awx_cached_matrix_vars }} /var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml && rm {{ awx_cached_matrix_vars }}" diff --git a/roles/matrix-awx/tasks/main.yml b/roles/matrix-awx/tasks/main.yml index 6ac39a495..b5e951c6c 100755 --- a/roles/matrix-awx/tasks/main.yml +++ b/roles/matrix-awx/tasks/main.yml @@ -1,6 +1,6 @@ - +--- # Load initial hosting and organisation variables from AWX volume -- include_tasks: +- include_tasks: file: "load_hosting_and_org_variables.yml" apply: tags: always @@ -9,7 +9,7 @@ - always # Renames or updates the vars.yml if needed -- include_tasks: +- include_tasks: file: "update_variables.yml" apply: tags: always @@ -18,7 +18,7 @@ - always # Create AWX session token -- include_tasks: +- include_tasks: file: "create_session_token.yml" apply: tags: always @@ -27,7 +27,7 @@ - always # Perform a backup of the server -- include_tasks: +- include_tasks: file: "backup_server.yml" apply: tags: backup-server @@ -36,7 +36,7 @@ - backup-server # Perform a export of the server -- include_tasks: +- include_tasks: file: "export_server.yml" apply: tags: export-server @@ -45,7 +45,7 @@ - export-server # Create a user account if called -- include_tasks: +- include_tasks: file: "create_user.yml" apply: tags: create-user @@ -54,7 +54,7 @@ - create-user # Purge local/remote media if called -- include_tasks: +- include_tasks: file: "purge_media_main.yml" apply: tags: purge-media @@ -63,7 +63,7 @@ - purge-media # Purge Synapse database if called -- include_tasks: +- include_tasks: file: "purge_database_main.yml" apply: tags: purge-database @@ -72,7 +72,7 @@ - purge-database # Rotate SSH key if called -- include_tasks: +- include_tasks: file: "rotate_ssh.yml" apply: tags: rotate-ssh @@ -81,16 +81,16 @@ - rotate-ssh # Import configs, media repo from /chroot/backup import -- include_tasks: +- include_tasks: file: "import_awx.yml" apply: tags: import-awx when: run_setup|bool and matrix_awx_enabled|bool tags: - import-awx - + # Perform extra self-check functions -- include_tasks: +- include_tasks: file: "self_check.yml" apply: tags: self-check @@ -99,7 +99,7 @@ - self-check # Create cached matrix_vars.yml file -- include_tasks: +- include_tasks: file: "cache_matrix_variables.yml" apply: tags: always @@ -108,7 +108,7 @@ - always # Configure SFTP so user can upload a static website or access the servers export -- include_tasks: +- include_tasks: file: "customise_website_access_export.yml" apply: tags: setup-nginx-proxy @@ -117,7 +117,7 @@ - setup-nginx-proxy # Additional playbook to set the variable file during Element configuration -- include_tasks: +- include_tasks: file: "set_variables_element.yml" apply: tags: setup-client-element @@ -126,7 +126,7 @@ - setup-client-element # Additional playbook to set the variable file during Mailer configuration -- include_tasks: +- include_tasks: file: "set_variables_mailer.yml" apply: tags: setup-mailer @@ -135,7 +135,7 @@ - setup-mailer # Additional playbook to set the variable file during Element configuration -- include_tasks: +- include_tasks: file: "set_variables_element_subdomain.yml" apply: tags: setup-client-element-subdomain @@ -144,7 +144,7 @@ - setup-client-element-subdomain # Additional playbook to set the variable file during Synapse configuration -- include_tasks: +- include_tasks: file: "set_variables_synapse.yml" apply: tags: setup-synapse @@ -153,7 +153,7 @@ - setup-synapse # Additional playbook to set the variable file during Jitsi configuration -- include_tasks: +- include_tasks: file: "set_variables_jitsi.yml" apply: tags: setup-jitsi @@ -162,7 +162,7 @@ - setup-jitsi # Additional playbook to set the variable file during Ma1sd configuration -- include_tasks: +- include_tasks: file: "set_variables_ma1sd.yml" apply: tags: setup-ma1sd @@ -171,7 +171,7 @@ - setup-ma1sd # Additional playbook to set the variable file during Corporal configuration -- include_tasks: +- include_tasks: file: "set_variables_corporal.yml" apply: tags: setup-corporal @@ -180,7 +180,7 @@ - setup-corporal # Additional playbook to set the variable file during Dimension configuration -- include_tasks: +- include_tasks: file: "set_variables_dimension.yml" apply: tags: setup-dimension @@ -189,7 +189,7 @@ - setup-dimension # Additional playbook to set the variable file during Synapse Admin configuration -- include_tasks: +- include_tasks: file: "set_variables_synapse_admin.yml" apply: tags: setup-synapse-admin @@ -198,7 +198,7 @@ - setup-synapse-admin # Additional playbook to set the variable file during Discord Appservice Bridge configuration -- include_tasks: +- include_tasks: file: "bridge_discord_appservice.yml" apply: tags: bridge-discord-appservice @@ -207,7 +207,7 @@ - bridge-discord-appservice # Delete AWX session token -- include_tasks: +- include_tasks: file: "delete_session_token.yml" apply: tags: always @@ -216,7 +216,7 @@ - always # Load newly formed matrix variables from AWX volume -- include_tasks: +- include_tasks: file: "load_matrix_variables.yml" apply: tags: always diff --git a/roles/matrix-awx/tasks/purge_database_main.yml b/roles/matrix-awx/tasks/purge_database_main.yml index f29061fb3..9882f1951 100644 --- a/roles/matrix-awx/tasks/purge_database_main.yml +++ b/roles/matrix-awx/tasks/purge_database_main.yml @@ -9,20 +9,20 @@ - name: Include vars in matrix_vars.yml include_vars: file: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml' - no_log: True + no_log: true - name: Ensure curl and jq intalled on target machine apt: pkg: - - curl - - jq + - curl + - jq state: present - name: Collect before shrink size of Synapse database shell: du -sh /matrix/postgres/data register: awx_db_size_before_stat when: (awx_purge_mode.find("Perform final shrink") != -1) - no_log: True + no_log: true - name: Collect the internal IP of the matrix-synapse container shell: "/usr/bin/docker inspect --format '{''{range.NetworkSettings.Networks}''}{''{.IPAddress}''}{''{end}''}' matrix-synapse" @@ -34,7 +34,7 @@ curl -X POST -d '{"type":"m.login.password", "user":"admin-janitor", "password":"{{ awx_janitor_user_password }}"}' "{{ awx_synapse_container_ip.stdout }}:{{ matrix_synapse_container_client_api_port }}/_matrix/client/r0/login" | jq '.access_token' when: (awx_purge_mode.find("No local users [recommended]") != -1) or (awx_purge_mode.find("Number of users [slower]") != -1) or (awx_purge_mode.find("Number of events [slower]") != -1) register: awx_janitors_token - no_log: True + no_log: true - name: Copy build_room_list.py script to target machine copy: @@ -55,7 +55,7 @@ fetch: src: /tmp/room_list_complete.json dest: "/tmp/{{ subscription_id }}_room_list_complete.json" - flat: yes + flat: true when: (awx_purge_mode.find("No local users [recommended]") != -1) or (awx_purge_mode.find("Number of users [slower]") != -1) or (awx_purge_mode.find("Number of events [slower]") != -1) - name: Remove complete room list from target machine @@ -80,7 +80,7 @@ - name: Setting host fact awx_room_list_no_local_users set_fact: awx_room_list_no_local_users: "{{ lookup('file', '/tmp/{{ subscription_id }}_room_list_no_local_users.txt') }}" - no_log: True + no_log: true when: (awx_purge_mode.find("No local users [recommended]") != -1) or (awx_purge_mode.find("Number of users [slower]") != -1) or (awx_purge_mode.find("Number of events [slower]") != -1) - name: Purge all rooms with no local users @@ -113,7 +113,7 @@ set_fact: awx_room_list_joined_members: "{{ lookup('file', '/tmp/{{ subscription_id }}_room_list_joined_members.txt') }}" when: awx_purge_mode.find("Number of users [slower]") != -1 - no_log: True + no_log: true - name: Purge all rooms with more then N users include_tasks: purge_database_users.yml @@ -138,7 +138,7 @@ set_fact: awx_room_list_state_events: "{{ lookup('file', '/tmp/{{ subscription_id }}_room_list_state_events.txt') }}" when: awx_purge_mode.find("Number of events [slower]") != -1 - no_log: True + no_log: true - name: Purge all rooms with more then N events include_tasks: purge_database_events.yml @@ -161,17 +161,17 @@ verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true when: (awx_purge_mode.find("No local users [recommended]") != -1) or (awx_purge_mode.find("Number of users [slower]") != -1) or (awx_purge_mode.find("Number of events [slower]") != -1) or (awx_purge_mode.find("Skip purging rooms [faster]") != -1) - name: Execute rust-synapse-compress-state job template delegate_to: 127.0.0.1 awx.awx.tower_job_launch: job_template: "{{ matrix_domain }} - 0 - Deploy/Update a Server" - wait: yes + wait: true tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true when: (awx_purge_mode.find("No local users [recommended]") != -1) or (awx_purge_mode.find("Number of users [slower]") != -1) or (awx_purge_mode.find("Number of events [slower]") != -1) or (awx_purge_mode.find("Skip purging rooms [faster]") != -1) - name: Revert 'Deploy/Update a Server' job template @@ -190,14 +190,14 @@ verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true when: (awx_purge_mode.find("No local users [recommended]") != -1) or (awx_purge_mode.find("Number of users [slower]") != -1) or (awx_purge_mode.find("Number of events [slower]") != -1) or (awx_purge_mode.find("Skip purging rooms [faster]") != -1) - name: Ensure matrix-synapse is stopped service: name: matrix-synapse state: stopped - daemon_reload: yes + daemon_reload: true when: (awx_purge_mode.find("Perform final shrink") != -1) - name: Re-index Synapse database @@ -208,7 +208,7 @@ service: name: matrix-synapse state: started - daemon_reload: yes + daemon_reload: true when: (awx_purge_mode.find("Perform final shrink") != -1) - name: Adjust 'Deploy/Update a Server' job template @@ -227,17 +227,17 @@ verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true when: (awx_purge_mode.find("Perform final shrink") != -1) - name: Execute run-postgres-vacuum job template delegate_to: 127.0.0.1 awx.awx.tower_job_launch: job_template: "{{ matrix_domain }} - 0 - Deploy/Update a Server" - wait: yes + wait: true tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true when: (awx_purge_mode.find("Perform final shrink") != -1) - name: Revert 'Deploy/Update a Server' job template @@ -256,7 +256,7 @@ verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true when: (awx_purge_mode.find("Perform final shrink") != -1) - name: Cleanup room_list files @@ -264,13 +264,13 @@ shell: | rm /tmp/{{ subscription_id }}_room_list* when: (awx_purge_mode.find("No local users [recommended]") != -1) or (awx_purge_mode.find("Number of users [slower]") != -1) or (awx_purge_mode.find("Number of events [slower]") != -1) - ignore_errors: yes + ignore_errors: true - name: Collect after shrink size of Synapse database shell: du -sh /matrix/postgres/data register: awx_db_size_after_stat when: (awx_purge_mode.find("Perform final shrink") != -1) - no_log: True + no_log: true - name: Print total number of rooms processed debug: diff --git a/roles/matrix-awx/tasks/purge_media_main.yml b/roles/matrix-awx/tasks/purge_media_main.yml index c836d16cf..bd7e7d1c4 100644 --- a/roles/matrix-awx/tasks/purge_media_main.yml +++ b/roles/matrix-awx/tasks/purge_media_main.yml @@ -1,3 +1,4 @@ +--- - name: Ensure dateutils is installed in AWX delegate_to: 127.0.0.1 @@ -8,13 +9,13 @@ - name: Include vars in matrix_vars.yml include_vars: file: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml' - no_log: True + no_log: true - name: Ensure curl and jq intalled on target machine apt: pkg: - - curl - - jq + - curl + - jq state: present - name: Collect the internal IP of the matrix-synapse container @@ -25,7 +26,7 @@ shell: | curl -XPOST -d '{"type":"m.login.password", "user":"admin-janitor", "password":"{{ awx_janitor_user_password }}"}' "{{ awx_synapse_container_ip.stdout }}:{{ matrix_synapse_container_client_api_port }}/_matrix/client/r0/login" | jq '.access_token' register: awx_janitors_token - no_log: True + no_log: true - name: Generate list of dates to purge to delegate_to: 127.0.0.1 @@ -37,16 +38,16 @@ register: awx_local_media_size_before when: awx_purge_media_type == "Local Media" async: 600 - ignore_errors: yes - no_log: True + ignore_errors: true + no_log: true - name: Calculate initial size of remote media repository shell: du -sh /matrix/synapse/storage/media-store/remote* register: awx_remote_media_size_before when: awx_purge_media_type == "Remote Media" - async: 600 - ignore_errors: yes - no_log: True + async: 600 + ignore_errors: true + no_log: true - name: Purge local media with loop include_tasks: purge_media_local.yml @@ -62,15 +63,15 @@ shell: du -sh /matrix/synapse/storage/media-store/local* register: awx_local_media_size_after when: awx_purge_media_type == "Local Media" - ignore_errors: yes - no_log: True + ignore_errors: true + no_log: true - name: Calculate final size of remote media repository shell: du -sh /matrix/synapse/storage/media-store/remote* register: awx_remote_media_size_after when: awx_purge_media_type == "Remote Media" - ignore_errors: yes - no_log: True + ignore_errors: true + no_log: true - name: Print size of local media repository before purge debug: diff --git a/roles/matrix-awx/tasks/rotate_ssh.yml b/roles/matrix-awx/tasks/rotate_ssh.yml index 9596f5047..bd59cbc13 100644 --- a/roles/matrix-awx/tasks/rotate_ssh.yml +++ b/roles/matrix-awx/tasks/rotate_ssh.yml @@ -4,7 +4,7 @@ authorized_key: user: root state: present - exclusive: yes + exclusive: true key: "{{ lookup('file', '/var/lib/awx/projects/hosting/client_public.key') }}" - name: Delete the AWX session token for executing modules diff --git a/roles/matrix-awx/tasks/self_check.yml b/roles/matrix-awx/tasks/self_check.yml index a7b0cb3ab..68e833a47 100644 --- a/roles/matrix-awx/tasks/self_check.yml +++ b/roles/matrix-awx/tasks/self_check.yml @@ -25,53 +25,53 @@ shell: | curl -s localhost:9000 | grep "^synapse_admin_mau_current " register: awx_mau_stat - no_log: True + no_log: true - name: Calculate CPU usage statistics shell: iostat -c register: awx_cpu_usage_stat - no_log: True + no_log: true - name: Calculate RAM usage statistics shell: free -mh register: awx_ram_usage_stat - no_log: True + no_log: true - name: Calculate free disk space shell: df -h register: awx_disk_space_stat - no_log: True + no_log: true - name: Calculate size of Synapse database shell: du -sh /matrix/postgres/data register: awx_db_size_stat - no_log: True + no_log: true - name: Calculate size of local media repository shell: du -sh /matrix/synapse/storage/media-store/local* register: awx_local_media_size_stat async: 600 - ignore_errors: yes - no_log: True + ignore_errors: true + no_log: true - name: Calculate size of remote media repository shell: du -sh /matrix/synapse/storage/media-store/remote* register: awx_remote_media_size_stat async: 600 - ignore_errors: yes - no_log: True + ignore_errors: true + no_log: true - name: Calculate docker container statistics shell: docker stats --all --no-stream register: awx_docker_stats - ignore_errors: yes - no_log: True + ignore_errors: true + no_log: true - name: Print size of remote media repository debug: msg: "{{ awx_remote_media_size_stat.stdout.split('\n') }}" when: awx_remote_media_size_stat is defined - + - name: Print size of local media repository debug: msg: "{{ awx_local_media_size_stat.stdout.split('\n') }}" diff --git a/roles/matrix-awx/tasks/set_variables_corporal.yml b/roles/matrix-awx/tasks/set_variables_corporal.yml index e911144dd..007ae59ff 100755 --- a/roles/matrix-awx/tasks/set_variables_corporal.yml +++ b/roles/matrix-awx/tasks/set_variables_corporal.yml @@ -235,9 +235,9 @@ credential: "{{ member_id }} - AWX SSH Key" survey_enabled: true survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_corporal.json') }}" - become_enabled: yes + become_enabled: true state: present verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true diff --git a/roles/matrix-awx/tasks/set_variables_dimension.yml b/roles/matrix-awx/tasks/set_variables_dimension.yml index eee4e6f22..7d4011143 100644 --- a/roles/matrix-awx/tasks/set_variables_dimension.yml +++ b/roles/matrix-awx/tasks/set_variables_dimension.yml @@ -3,18 +3,18 @@ - name: Include vars in matrix_vars.yml include_vars: file: '{{ awx_cached_matrix_vars }}' - no_log: True + no_log: true - name: Install jq and curl on remote machine apt: - name: + name: - jq - curl state: present - name: Collect access token of @admin-dimension user shell: | - curl -X POST --header 'Content-Type: application/json' -d '{ "identifier": { "type": "m.id.user","user": "admin-dimension" }, "password": "{{ awx_dimension_user_password }}", "type": "m.login.password"}' 'https://matrix.{{ matrix_domain }}/_matrix/client/r0/login' | jq -c '. | {access_token}' | sed 's/.*\":\"//' | sed 's/\"}//' + curl -X POST --header 'Content-Type: application/json' -d '{ "identifier": { "type": "m.id.user","user": "admin-dimension"}, "password": "{{ awx_dimension_user_password }}", "type": "m.login.password"}' 'https://matrix.{{ matrix_domain }}/_matrix/client/r0/login' | jq -c '. | {access_token}' | sed 's/.*\":\"//' | sed 's/\"}//' register: awx_dimension_user_access_token - name: Record Synapse variables locally on AWX @@ -27,7 +27,7 @@ with_dict: 'matrix_dimension_enabled': '{{ matrix_dimension_enabled }}' 'matrix_dimension_access_token': '"{{ awx_dimension_user_access_token.stdout }}"' - + - name: Set final users list if users are defined set_fact: awx_dimension_users_final: "{{ awx_dimension_users }}" @@ -80,7 +80,7 @@ - name: Copy new 'Configure Dimension' survey.json to target machine copy: src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_dimension.json' - dest: '/matrix/awx/configure_dimension.json' + dest: '/matrix/awx/configure_dimension.json' mode: '0660' - name: Recreate 'Configure Dimension' job template @@ -97,9 +97,9 @@ credential: "{{ member_id }} - AWX SSH Key" survey_enabled: true survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_dimension.json') }}" - become_enabled: yes + become_enabled: true state: present verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true diff --git a/roles/matrix-awx/tasks/set_variables_element.yml b/roles/matrix-awx/tasks/set_variables_element.yml index 491c91b3b..4b2ce8590 100755 --- a/roles/matrix-awx/tasks/set_variables_element.yml +++ b/roles/matrix-awx/tasks/set_variables_element.yml @@ -172,9 +172,9 @@ credential: "{{ member_id }} - AWX SSH Key" survey_enabled: true survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_element.json') }}" - become_enabled: yes + become_enabled: true state: present verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true diff --git a/roles/matrix-awx/tasks/set_variables_element_subdomain.yml b/roles/matrix-awx/tasks/set_variables_element_subdomain.yml index 9e47be163..1c78b9e0e 100644 --- a/roles/matrix-awx/tasks/set_variables_element_subdomain.yml +++ b/roles/matrix-awx/tasks/set_variables_element_subdomain.yml @@ -9,7 +9,7 @@ insertafter: '# Element Settings Start' with_dict: 'matrix_server_fqn_element': "{{ awx_element_subdomain | trim }}.{{ matrix_domain }}" - + - name: Save new 'Configure Element Subdomain' survey.json to the AWX tower, template delegate_to: 127.0.0.1 template: @@ -40,4 +40,4 @@ verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true diff --git a/roles/matrix-awx/tasks/set_variables_jitsi.yml b/roles/matrix-awx/tasks/set_variables_jitsi.yml index 2e8f1f8ed..b12391bf3 100755 --- a/roles/matrix-awx/tasks/set_variables_jitsi.yml +++ b/roles/matrix-awx/tasks/set_variables_jitsi.yml @@ -20,7 +20,7 @@ - name: Copy new 'Configure Jitsi' survey.json to target machine copy: src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_jitsi.json' - dest: '/matrix/awx/configure_jitsi.json' + dest: '/matrix/awx/configure_jitsi.json' mode: '0660' - name: Recreate 'Configure Jitsi' job template @@ -37,9 +37,9 @@ credential: "{{ member_id }} - AWX SSH Key" survey_enabled: true survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_jitsi.json') }}" - become_enabled: yes + become_enabled: true state: present verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true diff --git a/roles/matrix-awx/tasks/set_variables_ma1sd.yml b/roles/matrix-awx/tasks/set_variables_ma1sd.yml index db5037d1d..fba7225a3 100755 --- a/roles/matrix-awx/tasks/set_variables_ma1sd.yml +++ b/roles/matrix-awx/tasks/set_variables_ma1sd.yml @@ -66,7 +66,7 @@ with_dict: 'awx_matrix_ma1sd_auth_store': '{{ awx_matrix_ma1sd_auth_store }}' 'awx_matrix_ma1sd_configuration_extension_yaml': '{{ awx_matrix_ma1sd_configuration_extension_yaml.splitlines() | to_json }}' - no_log: True + no_log: true - name: Save new 'Configure ma1sd' survey.json to the AWX tower, template delegate_to: 127.0.0.1 @@ -77,7 +77,7 @@ - name: Copy new 'Configure ma1sd' survey.json to target machine copy: src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_ma1sd.json' - dest: '/matrix/awx/configure_ma1sd.json' + dest: '/matrix/awx/configure_ma1sd.json' mode: '0660' - name: Recreate 'Configure ma1sd (Advanced)' job template @@ -94,10 +94,9 @@ credential: "{{ member_id }} - AWX SSH Key" survey_enabled: true survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_ma1sd.json') }}" - become_enabled: yes + become_enabled: true state: present verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes - + validate_certs: true diff --git a/roles/matrix-awx/tasks/set_variables_mailer.yml b/roles/matrix-awx/tasks/set_variables_mailer.yml index 2ae2d513b..6581223d2 100644 --- a/roles/matrix-awx/tasks/set_variables_mailer.yml +++ b/roles/matrix-awx/tasks/set_variables_mailer.yml @@ -36,9 +36,9 @@ credential: "{{ member_id }} - AWX SSH Key" survey_enabled: true survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_email_relay.json') }}" - become_enabled: yes + become_enabled: true state: present verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true diff --git a/roles/matrix-awx/tasks/set_variables_synapse.yml b/roles/matrix-awx/tasks/set_variables_synapse.yml index f0fe23693..f749f03f6 100755 --- a/roles/matrix-awx/tasks/set_variables_synapse.yml +++ b/roles/matrix-awx/tasks/set_variables_synapse.yml @@ -1,3 +1,4 @@ +--- - name: Limit max upload size to 200MB part 1 set_fact: @@ -197,7 +198,7 @@ - name: Copy new 'Configure Synapse' survey.json to target machine copy: src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_synapse.json' - dest: '/matrix/awx/configure_synapse.json' + dest: '/matrix/awx/configure_synapse.json' mode: '0660' - name: Recreate 'Configure Synapse' job template @@ -214,9 +215,9 @@ credential: "{{ member_id }} - AWX SSH Key" survey_enabled: true survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_synapse.json') }}" - become_enabled: yes + become_enabled: true state: present verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true diff --git a/roles/matrix-awx/tasks/set_variables_synapse_admin.yml b/roles/matrix-awx/tasks/set_variables_synapse_admin.yml index 635befb5a..1e63fb71a 100644 --- a/roles/matrix-awx/tasks/set_variables_synapse_admin.yml +++ b/roles/matrix-awx/tasks/set_variables_synapse_admin.yml @@ -19,7 +19,7 @@ - name: Copy new 'Configure Synapse Admin' survey.json to target machine copy: src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_synapse_admin.json' - dest: '/matrix/awx/configure_synapse_admin.json' + dest: '/matrix/awx/configure_synapse_admin.json' mode: '0660' - name: Recreate 'Configure Synapse Admin' job template @@ -36,9 +36,9 @@ credential: "{{ member_id }} - AWX SSH Key" survey_enabled: true survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_synapse_admin.json') }}" - become_enabled: yes + become_enabled: true state: present verbosity: 1 tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" - validate_certs: yes + validate_certs: true diff --git a/roles/matrix-awx/tasks/update_variables.yml b/roles/matrix-awx/tasks/update_variables.yml index 9818a9c21..e072667f7 100644 --- a/roles/matrix-awx/tasks/update_variables.yml +++ b/roles/matrix-awx/tasks/update_variables.yml @@ -12,7 +12,7 @@ command: | openssl rand -hex 16 register: generic_secret - no_log: True + no_log: true when: ( matrix_homeserver_generic_secret_key is undefined ) or ( matrix_homeserver_generic_secret_key | length == 0 ) - name: Add new matrix_homeserver_generic_secret_key variable @@ -22,5 +22,5 @@ line: "matrix_homeserver_generic_secret_key: {{ generic_secret.stdout }}" insertbefore: '# Basic Settings End' mode: '0600' - state: present + state: present when: ( matrix_homeserver_generic_secret_key is undefined ) or ( matrix_homeserver_generic_secret_key | length == 0 ) diff --git a/roles/matrix-base/defaults/main.yml b/roles/matrix-base/defaults/main.yml index be403de76..83238aa19 100644 --- a/roles/matrix-base/defaults/main.yml +++ b/roles/matrix-base/defaults/main.yml @@ -1,3 +1,4 @@ +--- # The bare domain name which represents your Matrix identity. # Matrix user ids for your server will be of the form (`@user:`). # diff --git a/roles/matrix-base/tasks/clean_up_old_files.yml b/roles/matrix-base/tasks/clean_up_old_files.yml index 01d4a83df..03eb8bcce 100644 --- a/roles/matrix-base/tasks/clean_up_old_files.yml +++ b/roles/matrix-base/tasks/clean_up_old_files.yml @@ -6,4 +6,4 @@ state: absent with_items: - "{{ matrix_base_data_path }}/environment-variables" - - "{{ matrix_base_data_path }}/scratchpad" \ No newline at end of file + - "{{ matrix_base_data_path }}/scratchpad" diff --git a/roles/matrix-base/tasks/main.yml b/roles/matrix-base/tasks/main.yml index f9db37b3e..1cdc0432e 100644 --- a/roles/matrix-base/tasks/main.yml +++ b/roles/matrix-base/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/sanity_check.yml" tags: - always diff --git a/roles/matrix-base/tasks/server_base/setup.yml b/roles/matrix-base/tasks/server_base/setup.yml index 0869e5017..909dd8399 100644 --- a/roles/matrix-base/tasks/server_base/setup.yml +++ b/roles/matrix-base/tasks/server_base/setup.yml @@ -13,7 +13,7 @@ name: - lsb-release state: present - update_cache: yes + update_cache: true register: lsb_release_installation_result - name: Reread ansible_lsb facts if lsb-release got installed @@ -34,10 +34,10 @@ service: name: docker state: started - enabled: yes + enabled: true - name: "Ensure {{ matrix_ntpd_service }} is started and autoruns" service: name: "{{ matrix_ntpd_service }}" state: started - enabled: yes + enabled: true diff --git a/roles/matrix-base/tasks/server_base/setup_archlinux.yml b/roles/matrix-base/tasks/server_base/setup_archlinux.yml index 6c5cdff82..a4912a5db 100644 --- a/roles/matrix-base/tasks/server_base/setup_archlinux.yml +++ b/roles/matrix-base/tasks/server_base/setup_archlinux.yml @@ -6,7 +6,7 @@ - python-docker - python-dnspython state: latest - update_cache: yes + update_cache: true - name: Ensure Docker is installed pacman: diff --git a/roles/matrix-base/tasks/server_base/setup_centos.yml b/roles/matrix-base/tasks/server_base/setup_centos.yml index cbf7fbc6c..34113bd93 100644 --- a/roles/matrix-base/tasks/server_base/setup_centos.yml +++ b/roles/matrix-base/tasks/server_base/setup_centos.yml @@ -22,7 +22,7 @@ name: - "{{ matrix_ntpd_package }}" state: latest - update_cache: yes + update_cache: true - name: Ensure Docker is installed yum: diff --git a/roles/matrix-base/tasks/server_base/setup_centos8.yml b/roles/matrix-base/tasks/server_base/setup_centos8.yml index e6127f470..4b5b069da 100644 --- a/roles/matrix-base/tasks/server_base/setup_centos8.yml +++ b/roles/matrix-base/tasks/server_base/setup_centos8.yml @@ -22,14 +22,14 @@ name: - epel-release state: latest - update_cache: yes + update_cache: true - name: Ensure yum packages are installed yum: name: - "{{ matrix_ntpd_package }}" state: latest - update_cache: yes + update_cache: true - name: Ensure Docker is installed yum: diff --git a/roles/matrix-base/tasks/server_base/setup_debian.yml b/roles/matrix-base/tasks/server_base/setup_debian.yml index 1cd7ac41d..5b169df77 100644 --- a/roles/matrix-base/tasks/server_base/setup_debian.yml +++ b/roles/matrix-base/tasks/server_base/setup_debian.yml @@ -7,7 +7,7 @@ - ca-certificates - gnupg state: present - update_cache: yes + update_cache: true - name: Ensure Docker's APT key is trusted apt_key: @@ -22,7 +22,7 @@ apt_repository: repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable" state: present - update_cache: yes + update_cache: true when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' - name: Ensure APT packages are installed @@ -30,7 +30,7 @@ name: - "{{ matrix_ntpd_package }}" state: latest - update_cache: yes + update_cache: true - name: Ensure Docker is installed apt: diff --git a/roles/matrix-base/tasks/server_base/setup_raspbian.yml b/roles/matrix-base/tasks/server_base/setup_raspbian.yml index 4aed3c767..6a09f2fe1 100644 --- a/roles/matrix-base/tasks/server_base/setup_raspbian.yml +++ b/roles/matrix-base/tasks/server_base/setup_raspbian.yml @@ -7,7 +7,7 @@ - ca-certificates - gnupg state: present - update_cache: yes + update_cache: true - name: Ensure Docker's APT key is trusted apt_key: @@ -22,7 +22,7 @@ apt_repository: repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/raspbian {{ ansible_distribution_release }} stable" state: present - update_cache: yes + update_cache: true when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' - name: Ensure APT packages are installed @@ -30,7 +30,7 @@ name: - "{{ matrix_ntpd_package }}" state: latest - update_cache: yes + update_cache: true - name: Ensure Docker is installed apt: diff --git a/roles/matrix-base/tasks/setup_matrix_user.yml b/roles/matrix-base/tasks/setup_matrix_user.yml index ab5e81119..41604f874 100644 --- a/roles/matrix-base/tasks/setup_matrix_user.yml +++ b/roles/matrix-base/tasks/setup_matrix_user.yml @@ -18,8 +18,8 @@ state: present group: "{{ matrix_user_groupname }}" home: "{{ matrix_base_data_path }}" - create_home: no - system: yes + create_home: false + system: true register: matrix_user - name: Set Matrix Group UID Variable diff --git a/roles/matrix-base/tasks/setup_well_known.yml b/roles/matrix-base/tasks/setup_well_known.yml index 11ee48b92..3f475950b 100644 --- a/roles/matrix-base/tasks/setup_well_known.yml +++ b/roles/matrix-base/tasks/setup_well_known.yml @@ -1,3 +1,4 @@ +--- # We need others to be able to read these directories too, # so that matrix-nginx-proxy's nginx user can access the files. # diff --git a/roles/matrix-base/tasks/util/ensure_fuse_installed.yml b/roles/matrix-base/tasks/util/ensure_fuse_installed.yml index 948c60825..7708cf2df 100644 --- a/roles/matrix-base/tasks/util/ensure_fuse_installed.yml +++ b/roles/matrix-base/tasks/util/ensure_fuse_installed.yml @@ -1,4 +1,4 @@ - +--- # This is for both CentOS 7 and 8 - name: Ensure fuse installed (CentOS) yum: diff --git a/roles/matrix-base/tasks/util/ensure_openssl_installed.yml b/roles/matrix-base/tasks/util/ensure_openssl_installed.yml index 39442bca9..047f1b529 100644 --- a/roles/matrix-base/tasks/util/ensure_openssl_installed.yml +++ b/roles/matrix-base/tasks/util/ensure_openssl_installed.yml @@ -1,4 +1,4 @@ - +--- # This is for both CentOS 7 and 8 - name: Ensure openssl installed (CentOS) yum: diff --git a/roles/matrix-base/vars/main.yml b/roles/matrix-base/vars/main.yml index 8b99708b7..28ac226a7 100644 --- a/roles/matrix-base/vars/main.yml +++ b/roles/matrix-base/vars/main.yml @@ -1,3 +1,4 @@ +--- # This will contain a list of enabled services that the playbook is managing. # Each component is expected to append its service name to this list. matrix_systemd_services_list: [] diff --git a/roles/matrix-bot-go-neb/defaults/main.yml b/roles/matrix-bot-go-neb/defaults/main.yml index c5a1f6365..fa57b1095 100644 --- a/roles/matrix-bot-go-neb/defaults/main.yml +++ b/roles/matrix-bot-go-neb/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Go-NEB is a Matrix bot written in Go. It is the successor to Matrix-NEB, the original Matrix bot written in Python. # See: https://github.com/matrix-org/go-neb @@ -203,8 +204,8 @@ matrix_bot_go_neb_services: [] # # Each room will get the notification with the alert rendered with the given template # rooms: # "!someroomid:domain.tld": -# text_template: "{% raw %}{{range .Alerts -}} [{{ .Status }}] {{index .Labels \"alertname\" }}: {{index .Annotations \"description\"}} {{ end -}}{% endraw %}" -# html_template: "{% raw %}{{range .Alerts -}} {{ $severity := index .Labels \"severity\" }} {{ if eq .Status \"firing\" }} {{ if eq $severity \"critical\"}} [FIRING - CRITICAL] {{ else if eq $severity \"warning\"}} [FIRING - WARNING] {{ else }} [FIRING - {{ $severity }}] {{ end }} {{ else }} [RESOLVED] {{ end }} {{ index .Labels \"alertname\"}} : {{ index .Annotations \"description\"}} source
{{end -}}{% endraw %}" +# text_template: "{% raw %}{{range .Alerts -}} [{{ .Status }}] {{index .Labels \"alertname\"}}: {{index .Annotations \"description\"}} {{ end -}}{% endraw %}" +# html_template: "{% raw %}{{range .Alerts -}} {{ $severity := index .Labels \"severity\"}} {{ if eq .Status \"firing\"}} {{ if eq $severity \"critical\"}} [FIRING - CRITICAL] {{ else if eq $severity \"warning\"}} [FIRING - WARNING] {{ else }} [FIRING - {{ $severity }}] {{ end }} {{ else }} [RESOLVED] {{ end }} {{ index .Labels \"alertname\"}} : {{ index .Annotations \"description\"}} source
{{end -}}{% endraw %}" # msg_type: "m.text" # Must be either `m.text` or `m.notice` # Default configuration template which covers the generic use case. @@ -228,4 +229,3 @@ matrix_bot_go_neb_configuration_extension: "{{ matrix_bot_go_neb_configuration_e # Holds the final configuration (a combination of the default and its extension). # You most likely don't need to touch this variable. Instead, see `matrix_bot_go_neb_configuration_yaml`. matrix_bot_go_neb_configuration: "{{ matrix_bot_go_neb_configuration_yaml|from_yaml|combine(matrix_bot_go_neb_configuration_extension, recursive=True) }}" - diff --git a/roles/matrix-bot-go-neb/tasks/init.yml b/roles/matrix-bot-go-neb/tasks/init.yml index 169f5978a..b046d4944 100644 --- a/roles/matrix-bot-go-neb/tasks/init.yml +++ b/roles/matrix-bot-go-neb/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-go-neb.service'] }}" when: matrix_bot_go_neb_enabled|bool diff --git a/roles/matrix-bot-go-neb/tasks/main.yml b/roles/matrix-bot-go-neb/tasks/main.yml index 1a4fe70a5..3c2ed9c58 100644 --- a/roles/matrix-bot-go-neb/tasks/main.yml +++ b/roles/matrix-bot-go-neb/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bot-go-neb/tasks/setup_install.yml b/roles/matrix-bot-go-neb/tasks/setup_install.yml index e26be0802..a390eb5e5 100644 --- a/roles/matrix-bot-go-neb/tasks/setup_install.yml +++ b/roles/matrix-bot-go-neb/tasks/setup_install.yml @@ -11,9 +11,9 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_bot_go_neb_config_path }}", when: true } - - { path: "{{ matrix_bot_go_neb_data_path }}", when: true } - - { path: "{{ matrix_bot_go_neb_data_store_path }}", when: true } + - {path: "{{ matrix_bot_go_neb_config_path }}", when: true} + - {path: "{{ matrix_bot_go_neb_data_path }}", when: true} + - {path: "{{ matrix_bot_go_neb_data_store_path }}", when: true} when: "item.when|bool" - name: Ensure go-neb image is pulled @@ -40,7 +40,7 @@ - name: Ensure systemd reloaded after matrix-bot-go-neb.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_bot_go_neb_systemd_service_result.changed|bool" - name: Ensure matrix-bot-go-neb.service restarted, if necessary diff --git a/roles/matrix-bot-go-neb/tasks/setup_uninstall.yml b/roles/matrix-bot-go-neb/tasks/setup_uninstall.yml index 3610eb44b..a009badfd 100644 --- a/roles/matrix-bot-go-neb/tasks/setup_uninstall.yml +++ b/roles/matrix-bot-go-neb/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-bot-go-neb state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_bot_go_neb_service_stat.stat.exists|bool" @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-bot-go-neb.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_bot_go_neb_service_stat.stat.exists|bool" - name: Ensure Matrix go-neb paths don't exist diff --git a/roles/matrix-bot-honoroit/defaults/main.yml b/roles/matrix-bot-honoroit/defaults/main.yml index 2c4a3169b..2c50a1f73 100644 --- a/roles/matrix-bot-honoroit/defaults/main.yml +++ b/roles/matrix-bot-honoroit/defaults/main.yml @@ -1,3 +1,4 @@ +--- # honoroit is a helpdesk bot # See: https://gitlab.com/etke.cc/honoroit diff --git a/roles/matrix-bot-honoroit/tasks/init.yml b/roles/matrix-bot-honoroit/tasks/init.yml index 1b652e56d..5ace015b1 100644 --- a/roles/matrix-bot-honoroit/tasks/init.yml +++ b/roles/matrix-bot-honoroit/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-honoroit.service'] }}" when: matrix_bot_honoroit_enabled|bool diff --git a/roles/matrix-bot-honoroit/tasks/main.yml b/roles/matrix-bot-honoroit/tasks/main.yml index bc5c14904..7d66177c6 100644 --- a/roles/matrix-bot-honoroit/tasks/main.yml +++ b/roles/matrix-bot-honoroit/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bot-honoroit/tasks/setup_install.yml b/roles/matrix-bot-honoroit/tasks/setup_install.yml index 0d2d325bf..81f2eabce 100644 --- a/roles/matrix-bot-honoroit/tasks/setup_install.yml +++ b/roles/matrix-bot-honoroit/tasks/setup_install.yml @@ -33,10 +33,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_bot_honoroit_config_path }}", when: true } - - { path: "{{ matrix_bot_honoroit_data_path }}", when: true } - - { path: "{{ matrix_bot_honoroit_data_store_path }}", when: true } - - { path: "{{ matrix_bot_honoroit_docker_src_files_path }}", when: true} + - {path: "{{ matrix_bot_honoroit_config_path }}", when: true} + - {path: "{{ matrix_bot_honoroit_data_path }}", when: true} + - {path: "{{ matrix_bot_honoroit_data_store_path }}", when: true} + - {path: "{{ matrix_bot_honoroit_docker_src_files_path }}", when: true} when: "item.when|bool" - name: Ensure honoroit environment variables file created @@ -70,7 +70,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_bot_honoroit_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_bot_honoroit_container_image_self_build|bool" - name: Ensure matrix-bot-honoroit.service installed @@ -82,7 +82,7 @@ - name: Ensure systemd reloaded after matrix-bot-honoroit.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_bot_honoroit_systemd_service_result.changed|bool" - name: Ensure matrix-bot-honoroit.service restarted, if necessary diff --git a/roles/matrix-bot-honoroit/tasks/setup_uninstall.yml b/roles/matrix-bot-honoroit/tasks/setup_uninstall.yml index afad2cc1c..45bccabd8 100644 --- a/roles/matrix-bot-honoroit/tasks/setup_uninstall.yml +++ b/roles/matrix-bot-honoroit/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-bot-honoroit state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_bot_honoroit_service_stat.stat.exists|bool" @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-bot-honoroit.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_bot_honoroit_service_stat.stat.exists|bool" - name: Ensure Matrix honoroit paths don't exist diff --git a/roles/matrix-bot-matrix-reminder-bot/defaults/main.yml b/roles/matrix-bot-matrix-reminder-bot/defaults/main.yml index 419e3cca2..76b153e75 100644 --- a/roles/matrix-bot-matrix-reminder-bot/defaults/main.yml +++ b/roles/matrix-bot-matrix-reminder-bot/defaults/main.yml @@ -1,3 +1,4 @@ +--- # matrix-reminder-bot is a bot for one-off and recurring reminders # See: https://github.com/anoadragon453/matrix-reminder-bot diff --git a/roles/matrix-bot-matrix-reminder-bot/tasks/init.yml b/roles/matrix-bot-matrix-reminder-bot/tasks/init.yml index 7fd125245..414969557 100644 --- a/roles/matrix-bot-matrix-reminder-bot/tasks/init.yml +++ b/roles/matrix-bot-matrix-reminder-bot/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-matrix-reminder-bot.service'] }}" when: matrix_bot_matrix_reminder_bot_enabled|bool diff --git a/roles/matrix-bot-matrix-reminder-bot/tasks/main.yml b/roles/matrix-bot-matrix-reminder-bot/tasks/main.yml index fc2afddb2..d9a1df7e4 100644 --- a/roles/matrix-bot-matrix-reminder-bot/tasks/main.yml +++ b/roles/matrix-bot-matrix-reminder-bot/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml b/roles/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml index bd33326f7..e237bc211 100644 --- a/roles/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml +++ b/roles/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml @@ -34,10 +34,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_bot_matrix_reminder_bot_config_path }}", when: true } - - { path: "{{ matrix_bot_matrix_reminder_bot_data_path }}", when: true } - - { path: "{{ matrix_bot_matrix_reminder_bot_data_store_path }}", when: true } - - { path: "{{ matrix_bot_matrix_reminder_bot_docker_src_files_path }}", when: true} + - {path: "{{ matrix_bot_matrix_reminder_bot_config_path }}", when: true} + - {path: "{{ matrix_bot_matrix_reminder_bot_data_path }}", when: true} + - {path: "{{ matrix_bot_matrix_reminder_bot_data_store_path }}", when: true} + - {path: "{{ matrix_bot_matrix_reminder_bot_docker_src_files_path }}", when: true} when: "item.when|bool" - name: Ensure matrix-reminder-bot image is pulled @@ -65,7 +65,7 @@ build: dockerfile: docker/Dockerfile path: "{{ matrix_bot_matrix_reminder_bot_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_bot_matrix_reminder_bot_container_image_self_build|bool" - name: Ensure matrix-reminder-bot config installed @@ -85,7 +85,7 @@ - name: Ensure systemd reloaded after matrix-bot-matrix-reminder-bot.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_bot_matrix_reminder_bot_systemd_service_result.changed|bool" - name: Ensure matrix-bot-matrix-reminder-bot.service restarted, if necessary diff --git a/roles/matrix-bot-matrix-reminder-bot/tasks/setup_uninstall.yml b/roles/matrix-bot-matrix-reminder-bot/tasks/setup_uninstall.yml index d7e41201b..eb7543c59 100644 --- a/roles/matrix-bot-matrix-reminder-bot/tasks/setup_uninstall.yml +++ b/roles/matrix-bot-matrix-reminder-bot/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-bot-matrix-reminder-bot state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists|bool" @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-bot-matrix-reminder-bot.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists|bool" - name: Ensure Matrix matrix-reminder-bot paths don't exist diff --git a/roles/matrix-bot-mjolnir/defaults/main.yml b/roles/matrix-bot-mjolnir/defaults/main.yml index 7a39091d5..9f45432c7 100644 --- a/roles/matrix-bot-mjolnir/defaults/main.yml +++ b/roles/matrix-bot-mjolnir/defaults/main.yml @@ -1,3 +1,4 @@ +--- # A moderation tool for Matrix # See: https://github.com/matrix-org/mjolnir @@ -56,4 +57,3 @@ matrix_bot_mjolnir_configuration_extension: "{{ matrix_bot_mjolnir_configuration # Holds the final configuration (a combination of the default and its extension). # You most likely don't need to touch this variable. Instead, see `matrix_bot_mjolnir_configuration_yaml`. matrix_bot_mjolnir_configuration: "{{ matrix_bot_mjolnir_configuration_yaml|from_yaml|combine(matrix_bot_mjolnir_configuration_extension, recursive=True) }}" - diff --git a/roles/matrix-bot-mjolnir/tasks/init.yml b/roles/matrix-bot-mjolnir/tasks/init.yml index b8ab58f18..e09964ecd 100644 --- a/roles/matrix-bot-mjolnir/tasks/init.yml +++ b/roles/matrix-bot-mjolnir/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-bot-mjolnir/tasks/main.yml b/roles/matrix-bot-mjolnir/tasks/main.yml index eada8de57..a2a209147 100644 --- a/roles/matrix-bot-mjolnir/tasks/main.yml +++ b/roles/matrix-bot-mjolnir/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bot-mjolnir/tasks/setup_install.yml b/roles/matrix-bot-mjolnir/tasks/setup_install.yml index e770b6d50..3f4d5d8f1 100644 --- a/roles/matrix-bot-mjolnir/tasks/setup_install.yml +++ b/roles/matrix-bot-mjolnir/tasks/setup_install.yml @@ -11,10 +11,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_bot_mjolnir_base_path }}", when: true } - - { path: "{{ matrix_bot_mjolnir_config_path }}", when: true } - - { path: "{{ matrix_bot_mjolnir_data_path }}", when: true } - - { path: "{{ matrix_bot_mjolnir_docker_src_files_path }}", when: "{{ matrix_bot_mjolnir_container_image_self_build }}" } + - {path: "{{ matrix_bot_mjolnir_base_path }}", when: true} + - {path: "{{ matrix_bot_mjolnir_config_path }}", when: true} + - {path: "{{ matrix_bot_mjolnir_data_path }}", when: true} + - {path: "{{ matrix_bot_mjolnir_docker_src_files_path }}", when: "{{ matrix_bot_mjolnir_container_image_self_build }}"} when: "item.when|bool" - name: Ensure mjolnir Docker image is pulled @@ -42,7 +42,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_bot_mjolnir_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_bot_mjolnir_container_image_self_build|bool" - name: Ensure matrix-bot-mjolnir config installed @@ -62,7 +62,7 @@ - name: Ensure systemd reloaded after matrix-bot-mjolnir.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_bot_mjolnir_systemd_service_result.changed|bool" - name: Ensure matrix-bot-mjolnir.service restarted, if necessary diff --git a/roles/matrix-bot-mjolnir/tasks/setup_uninstall.yml b/roles/matrix-bot-mjolnir/tasks/setup_uninstall.yml index 7fff5e13f..935859778 100644 --- a/roles/matrix-bot-mjolnir/tasks/setup_uninstall.yml +++ b/roles/matrix-bot-mjolnir/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-bot-mjolnir state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_bot_mjolnir_service_stat.stat.exists|bool" @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-bot-mjolnir.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_bot_mjolnir_service_stat.stat.exists|bool" - name: Ensure matrix-bot-mjolnir paths don't exist diff --git a/roles/matrix-bridge-appservice-discord/defaults/main.yml b/roles/matrix-bridge-appservice-discord/defaults/main.yml index 92a51a31c..daa83dea0 100644 --- a/roles/matrix-bridge-appservice-discord/defaults/main.yml +++ b/roles/matrix-bridge-appservice-discord/defaults/main.yml @@ -1,3 +1,4 @@ +--- # matrix-appservice-discord is a Matrix <-> Discord bridge # See: https://github.com/Half-Shot/matrix-appservice-discord diff --git a/roles/matrix-bridge-appservice-discord/tasks/init.yml b/roles/matrix-bridge-appservice-discord/tasks/init.yml index ef64e78ad..e16a69796 100644 --- a/roles/matrix-bridge-appservice-discord/tasks/init.yml +++ b/roles/matrix-bridge-appservice-discord/tasks/init.yml @@ -1,3 +1,4 @@ +--- # If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist. # We don't want to fail in such cases. - name: Fail if matrix-synapse role already executed diff --git a/roles/matrix-bridge-appservice-discord/tasks/main.yml b/roles/matrix-bridge-appservice-discord/tasks/main.yml index bad5e3203..5df7bfe2b 100644 --- a/roles/matrix-bridge-appservice-discord/tasks/main.yml +++ b/roles/matrix-bridge-appservice-discord/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-appservice-discord/tasks/setup_install.yml b/roles/matrix-bridge-appservice-discord/tasks/setup_install.yml index 546e5043a..924531ad8 100644 --- a/roles/matrix-bridge-appservice-discord/tasks/setup_install.yml +++ b/roles/matrix-bridge-appservice-discord/tasks/setup_install.yml @@ -54,8 +54,8 @@ service: name: matrix-appservice-discord state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true failed_when: false when: "matrix_appservice_discord_stat_db.stat.exists" @@ -105,7 +105,7 @@ - name: Ensure systemd reloaded after matrix-appservice-discord.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_appservice_discord_systemd_service_result.changed" - name: Ensure matrix-appservice-discord.service restarted, if necessary diff --git a/roles/matrix-bridge-appservice-discord/tasks/setup_uninstall.yml b/roles/matrix-bridge-appservice-discord/tasks/setup_uninstall.yml index 5dd8075d1..ab56c26b6 100644 --- a/roles/matrix-bridge-appservice-discord/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-appservice-discord/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-appservice-discord state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_appservice_discord_service_stat.stat.exists" - name: Ensure matrix-appservice-discord.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-appservice-discord.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_appservice_discord_service_stat.stat.exists" diff --git a/roles/matrix-bridge-appservice-irc/defaults/main.yml b/roles/matrix-bridge-appservice-irc/defaults/main.yml index 25b0a2418..fa8613089 100644 --- a/roles/matrix-bridge-appservice-irc/defaults/main.yml +++ b/roles/matrix-bridge-appservice-irc/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Matrix Appservice IRC is a Matrix <-> IRC bridge # See: https://github.com/matrix-org/matrix-appservice-irc diff --git a/roles/matrix-bridge-appservice-irc/tasks/init.yml b/roles/matrix-bridge-appservice-irc/tasks/init.yml index b90d93a5e..5e1814121 100644 --- a/roles/matrix-bridge-appservice-irc/tasks/init.yml +++ b/roles/matrix-bridge-appservice-irc/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-bridge-appservice-irc/tasks/main.yml b/roles/matrix-bridge-appservice-irc/tasks/main.yml index da92ecf0c..339615eab 100644 --- a/roles/matrix-bridge-appservice-irc/tasks/main.yml +++ b/roles/matrix-bridge-appservice-irc/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-appservice-irc/tasks/migrate_nedb_to_postgres.yml b/roles/matrix-bridge-appservice-irc/tasks/migrate_nedb_to_postgres.yml index 6b39ac62a..d7fcaa07b 100644 --- a/roles/matrix-bridge-appservice-irc/tasks/migrate_nedb_to_postgres.yml +++ b/roles/matrix-bridge-appservice-irc/tasks/migrate_nedb_to_postgres.yml @@ -1,3 +1,5 @@ +--- + - name: Fail if Postgres not enabled fail: msg: "Postgres via the matrix-postgres role is not enabled (`matrix_postgres_enabled`). Cannot migrate." @@ -16,7 +18,7 @@ service: name: matrix-postgres state: started - daemon_reload: yes + daemon_reload: true register: matrix_postgres_service_start_result - name: Wait a bit, so that Postgres can start diff --git a/roles/matrix-bridge-appservice-irc/tasks/setup_install.yml b/roles/matrix-bridge-appservice-irc/tasks/setup_install.yml index 63ee6621f..23c175c4f 100644 --- a/roles/matrix-bridge-appservice-irc/tasks/setup_install.yml +++ b/roles/matrix-bridge-appservice-irc/tasks/setup_install.yml @@ -10,10 +10,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_appservice_irc_base_path }}", when: true } - - { path: "{{ matrix_appservice_irc_config_path }}", when: true } - - { path: "{{ matrix_appservice_irc_data_path }}", when: true } - - { path: "{{ matrix_appservice_irc_docker_src_files_path }}", when: "{{ matrix_appservice_irc_container_image_self_build }}" } + - {path: "{{ matrix_appservice_irc_base_path }}", when: true} + - {path: "{{ matrix_appservice_irc_config_path }}", when: true} + - {path: "{{ matrix_appservice_irc_data_path }}", when: true} + - {path: "{{ matrix_appservice_irc_docker_src_files_path }}", when: "{{ matrix_appservice_irc_container_image_self_build }}"} when: item.when|bool - name: Check if an old passkey file already exists @@ -26,7 +26,7 @@ service: name: matrix-appservice-irc state: stopped - daemon_reload: yes + daemon_reload: true failed_when: false - name: (Data relocation) Move AppService IRC passkey.pem file to ./data directory @@ -82,7 +82,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_appservice_irc_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_appservice_irc_enabled|bool and matrix_appservice_irc_container_image_self_build|bool and matrix_appservice_irc_git_pull_results.changed" - name: Ensure Matrix Appservice IRC config installed @@ -186,7 +186,7 @@ - name: Ensure systemd reloaded after matrix-appservice-irc.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_appservice_irc_systemd_service_result.changed" - name: Ensure matrix-appservice-irc.service restarted, if necessary diff --git a/roles/matrix-bridge-appservice-irc/tasks/setup_uninstall.yml b/roles/matrix-bridge-appservice-irc/tasks/setup_uninstall.yml index 515078177..a4d95df55 100644 --- a/roles/matrix-bridge-appservice-irc/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-appservice-irc/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-appservice-irc state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_appservice_irc_service_stat.stat.exists" - name: Ensure matrix-appservice-irc.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-appservice-irc.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_appservice_irc_service_stat.stat.exists" diff --git a/roles/matrix-bridge-appservice-slack/defaults/main.yml b/roles/matrix-bridge-appservice-slack/defaults/main.yml index b1c98d2a3..e303f8340 100644 --- a/roles/matrix-bridge-appservice-slack/defaults/main.yml +++ b/roles/matrix-bridge-appservice-slack/defaults/main.yml @@ -1,3 +1,4 @@ +--- # matrix-appservice-slack is a Matrix <-> Slack bridge # See: https://github.com/matrix-org/matrix-appservice-slack diff --git a/roles/matrix-bridge-appservice-slack/tasks/init.yml b/roles/matrix-bridge-appservice-slack/tasks/init.yml index 7f251ec5f..2ff7c9420 100644 --- a/roles/matrix-bridge-appservice-slack/tasks/init.yml +++ b/roles/matrix-bridge-appservice-slack/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 @@ -39,40 +40,40 @@ when: "matrix_synapse_role_executed|default(False)" - block: - - name: Fail if matrix-nginx-proxy role already executed - fail: - msg: >- - Trying to append Slack Appservice's reverse-proxying configuration to matrix-nginx-proxy, - 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-bridge-appservice-slack role. - when: matrix_nginx_proxy_role_executed|default(False)|bool + - name: Fail if matrix-nginx-proxy role already executed + fail: + msg: >- + Trying to append Slack Appservice's reverse-proxying configuration to matrix-nginx-proxy, + 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-bridge-appservice-slack role. + when: matrix_nginx_proxy_role_executed|default(False)|bool - - name: Generate Matrix Appservice Slack proxying configuration for matrix-nginx-proxy - set_fact: - matrix_appservice_slack_matrix_nginx_proxy_configuration: | - location {{ matrix_appservice_slack_public_endpoint }} { - {% 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_appservice_slack_appservice_url }}:{{ matrix_appservice_slack_slack_port }}"; - proxy_pass $backend; - {% else %} - {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:{{ matrix_appservice_slack_slack_port }}; - {% endif %} - } + - name: Generate Matrix Appservice Slack proxying configuration for matrix-nginx-proxy + set_fact: + matrix_appservice_slack_matrix_nginx_proxy_configuration: | + location {{ matrix_appservice_slack_public_endpoint }} { + {% 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_appservice_slack_appservice_url }}:{{ matrix_appservice_slack_slack_port }}"; + proxy_pass $backend; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://127.0.0.1:{{ matrix_appservice_slack_slack_port }}; + {% endif %} + } - - name: Register Slack Appservice proxying configuration with matrix-nginx-proxy - set_fact: - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | - {{ - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) - + - [matrix_appservice_slack_matrix_nginx_proxy_configuration] - }} + - name: Register Slack Appservice proxying configuration with matrix-nginx-proxy + set_fact: + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | + {{ + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) + + + [matrix_appservice_slack_matrix_nginx_proxy_configuration] + }} tags: - - always + - always when: matrix_appservice_slack_enabled|bool - name: Warn about reverse-proxying if matrix-nginx-proxy not used diff --git a/roles/matrix-bridge-appservice-slack/tasks/main.yml b/roles/matrix-bridge-appservice-slack/tasks/main.yml index acd03fffe..06c3abb61 100644 --- a/roles/matrix-bridge-appservice-slack/tasks/main.yml +++ b/roles/matrix-bridge-appservice-slack/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-appservice-slack/tasks/migrate_nedb_to_postgres.yml b/roles/matrix-bridge-appservice-slack/tasks/migrate_nedb_to_postgres.yml index fedad9775..0bea65bc4 100644 --- a/roles/matrix-bridge-appservice-slack/tasks/migrate_nedb_to_postgres.yml +++ b/roles/matrix-bridge-appservice-slack/tasks/migrate_nedb_to_postgres.yml @@ -1,3 +1,5 @@ +--- + - name: Fail if Postgres not enabled fail: msg: "Postgres via the matrix-postgres role is not enabled (`matrix_postgres_enabled`). Cannot migrate." @@ -16,7 +18,7 @@ service: name: matrix-postgres state: started - daemon_reload: yes + daemon_reload: true register: matrix_postgres_service_start_result - name: Wait a bit, so that Postgres can start diff --git a/roles/matrix-bridge-appservice-slack/tasks/setup_install.yml b/roles/matrix-bridge-appservice-slack/tasks/setup_install.yml index 8c5a1eeda..af2003fc9 100644 --- a/roles/matrix-bridge-appservice-slack/tasks/setup_install.yml +++ b/roles/matrix-bridge-appservice-slack/tasks/setup_install.yml @@ -8,10 +8,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_appservice_slack_base_path }}", when: true } - - { path: "{{ matrix_appservice_slack_config_path }}", when: true } - - { path: "{{ matrix_appservice_slack_data_path }}", when: true } - - { path: "{{ matrix_appservice_slack_docker_src_files_path }}", when: "{{ matrix_appservice_slack_container_image_self_build }}" } + - {path: "{{ matrix_appservice_slack_base_path }}", when: true} + - {path: "{{ matrix_appservice_slack_config_path }}", when: true} + - {path: "{{ matrix_appservice_slack_data_path }}", when: true} + - {path: "{{ matrix_appservice_slack_docker_src_files_path }}", when: "{{ matrix_appservice_slack_container_image_self_build }}"} when: item.when|bool - set_fact: @@ -56,7 +56,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_appservice_slack_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_appservice_slack_container_image_self_build|bool and matrix_appservice_slack_git_pull_results.changed" - name: Ensure Matrix Appservice Slack config installed @@ -84,7 +84,7 @@ - name: Ensure systemd reloaded after matrix-appservice-slack.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_appservice_slack_systemd_service_result.changed" - name: Ensure matrix-appservice-slack.service restarted, if necessary diff --git a/roles/matrix-bridge-appservice-slack/tasks/setup_uninstall.yml b/roles/matrix-bridge-appservice-slack/tasks/setup_uninstall.yml index 2dfe1c7b3..dffe78b34 100644 --- a/roles/matrix-bridge-appservice-slack/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-appservice-slack/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-appservice-slack state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_appservice_slack_service_stat.stat.exists" - name: Ensure matrix-appservice-slack.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-appservice-slack.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_appservice_slack_service_stat.stat.exists" diff --git a/roles/matrix-bridge-appservice-webhooks/defaults/main.yml b/roles/matrix-bridge-appservice-webhooks/defaults/main.yml index f987c0876..7a6db2d02 100644 --- a/roles/matrix-bridge-appservice-webhooks/defaults/main.yml +++ b/roles/matrix-bridge-appservice-webhooks/defaults/main.yml @@ -1,3 +1,4 @@ +--- # matrix-appservice-webhooks is a Matrix <-> webhook bridge # See: https://github.com/redoonetworks/matrix-appservice-webhooks diff --git a/roles/matrix-bridge-appservice-webhooks/tasks/init.yml b/roles/matrix-bridge-appservice-webhooks/tasks/init.yml index 7f49e8b64..35d62ded2 100644 --- a/roles/matrix-bridge-appservice-webhooks/tasks/init.yml +++ b/roles/matrix-bridge-appservice-webhooks/tasks/init.yml @@ -1,3 +1,4 @@ +--- # If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist. # We don't want to fail in such cases. - name: Fail if matrix-synapse role already executed @@ -32,42 +33,42 @@ when: "matrix_synapse_role_executed|default(False)" - block: - - name: Fail if matrix-nginx-proxy role already executed - fail: - msg: >- - Trying to append webhooks Appservice's reverse-proxying configuration to matrix-nginx-proxy, - 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-bridge-appservice-webhooks role. - when: matrix_nginx_proxy_role_executed|default(False)|bool + - name: Fail if matrix-nginx-proxy role already executed + fail: + msg: >- + Trying to append webhooks Appservice's reverse-proxying configuration to matrix-nginx-proxy, + 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-bridge-appservice-webhooks role. + when: matrix_nginx_proxy_role_executed|default(False)|bool - - name: Generate Matrix Appservice webhooks proxying configuration for matrix-nginx-proxy - set_fact: - matrix_appservice_webhooks_matrix_nginx_proxy_configuration: | - {% if matrix_nginx_proxy_enabled|default(False) %} - {# Use the embedded DNS resolver in Docker containers to discover the service #} - location ~ ^{{ matrix_appservice_webhooks_public_endpoint }}/(.*)$ { - resolver 127.0.0.11 valid=5s; - set $backend "matrix-appservice-webhooks:{{ matrix_appservice_webhooks_matrix_port }}"; - proxy_pass http://$backend/$1; - } - {% else %} - {# Generic configuration for use outside of our container setup #} - location {{ matrix_appservice_webhooks_public_endpoint }}/ { - proxy_pass http://127.0.0.1:{{ matrix_appservice_webhooks_matrix_port }}/; - } - {% endif %} + - name: Generate Matrix Appservice webhooks proxying configuration for matrix-nginx-proxy + set_fact: + matrix_appservice_webhooks_matrix_nginx_proxy_configuration: | + {% if matrix_nginx_proxy_enabled|default(False) %} + {# Use the embedded DNS resolver in Docker containers to discover the service #} + location ~ ^{{ matrix_appservice_webhooks_public_endpoint }}/(.*)$ { + resolver 127.0.0.11 valid=5s; + set $backend "matrix-appservice-webhooks:{{ matrix_appservice_webhooks_matrix_port }}"; + proxy_pass http://$backend/$1; + } + {% else %} + {# Generic configuration for use outside of our container setup #} + location {{ matrix_appservice_webhooks_public_endpoint }}/ { + proxy_pass http://127.0.0.1:{{ matrix_appservice_webhooks_matrix_port }}/; + } + {% endif %} - - name: Register webhooks Appservice proxying configuration with matrix-nginx-proxy - set_fact: - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | - {{ - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) - + - [matrix_appservice_webhooks_matrix_nginx_proxy_configuration] - }} + - name: Register webhooks Appservice proxying configuration with matrix-nginx-proxy + set_fact: + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | + {{ + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) + + + [matrix_appservice_webhooks_matrix_nginx_proxy_configuration] + }} tags: - - always + - always when: matrix_appservice_webhooks_enabled|bool - name: Warn about reverse-proxying if matrix-nginx-proxy not used diff --git a/roles/matrix-bridge-appservice-webhooks/tasks/main.yml b/roles/matrix-bridge-appservice-webhooks/tasks/main.yml index 216905f39..26a7e24c7 100644 --- a/roles/matrix-bridge-appservice-webhooks/tasks/main.yml +++ b/roles/matrix-bridge-appservice-webhooks/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-appservice-webhooks/tasks/setup_install.yml b/roles/matrix-bridge-appservice-webhooks/tasks/setup_install.yml index 1b276efc8..1f40d7314 100644 --- a/roles/matrix-bridge-appservice-webhooks/tasks/setup_install.yml +++ b/roles/matrix-bridge-appservice-webhooks/tasks/setup_install.yml @@ -8,10 +8,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_appservice_webhooks_base_path }}", when: true } - - { path: "{{ matrix_appservice_webhooks_config_path }}", when: true } - - { path: "{{ matrix_appservice_webhooks_data_path }}", when: true } - - { path: "{{ matrix_appservice_webhooks_docker_src_files_path }}", when: "{{ matrix_appservice_webhooks_container_image_self_build }}"} + - {path: "{{ matrix_appservice_webhooks_base_path }}", when: true} + - {path: "{{ matrix_appservice_webhooks_config_path }}", when: true} + - {path: "{{ matrix_appservice_webhooks_data_path }}", when: true} + - {path: "{{ matrix_appservice_webhooks_docker_src_files_path }}", when: "{{ matrix_appservice_webhooks_container_image_self_build }}"} when: "item.when|bool" - name: Ensure Appservice webhooks image is pulled @@ -40,7 +40,7 @@ build: dockerfile: "{{ matrix_appservice_webhooks_container_image_self_build_repo_dockerfile_path }}" path: "{{ matrix_appservice_webhooks_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_appservice_webhooks_container_image_self_build|bool" - name: Ensure Matrix Appservice webhooks config is installed @@ -84,5 +84,5 @@ - name: Ensure systemd reloaded after matrix-appservice-webhooks.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_appservice_webhooks_systemd_service_result.changed" diff --git a/roles/matrix-bridge-appservice-webhooks/tasks/setup_uninstall.yml b/roles/matrix-bridge-appservice-webhooks/tasks/setup_uninstall.yml index 81440b887..38235652b 100644 --- a/roles/matrix-bridge-appservice-webhooks/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-appservice-webhooks/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-appservice-webhooks state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_appservice_webhooks_service_stat.stat.exists" - name: Ensure matrix-appservice-webhooks.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-appservice-webhooks.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_appservice_webhooks_service_stat.stat.exists" diff --git a/roles/matrix-bridge-beeper-linkedin/defaults/main.yml b/roles/matrix-bridge-beeper-linkedin/defaults/main.yml index 34c9c3cb0..e622522de 100644 --- a/roles/matrix-bridge-beeper-linkedin/defaults/main.yml +++ b/roles/matrix-bridge-beeper-linkedin/defaults/main.yml @@ -1,3 +1,4 @@ +--- # beeper-linkedin is a Matrix <-> LinkedIn bridge # See: https://gitlab.com/beeper/linkedin diff --git a/roles/matrix-bridge-beeper-linkedin/tasks/init.yml b/roles/matrix-bridge-beeper-linkedin/tasks/init.yml index 755ac2f53..977db9252 100644 --- a/roles/matrix-bridge-beeper-linkedin/tasks/init.yml +++ b/roles/matrix-bridge-beeper-linkedin/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-beeper-linkedin.service'] }}" when: matrix_beeper_linkedin_enabled|bool diff --git a/roles/matrix-bridge-beeper-linkedin/tasks/main.yml b/roles/matrix-bridge-beeper-linkedin/tasks/main.yml index 79c54f1ac..920265fb5 100644 --- a/roles/matrix-bridge-beeper-linkedin/tasks/main.yml +++ b/roles/matrix-bridge-beeper-linkedin/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-beeper-linkedin/tasks/setup_install.yml b/roles/matrix-bridge-beeper-linkedin/tasks/setup_install.yml index c873d0c2c..3cec1c1fe 100644 --- a/roles/matrix-bridge-beeper-linkedin/tasks/setup_install.yml +++ b/roles/matrix-bridge-beeper-linkedin/tasks/setup_install.yml @@ -15,10 +15,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_beeper_linkedin_base_path }}", when: true } - - { path: "{{ matrix_beeper_linkedin_config_path }}", when: true } - - { path: "{{ matrix_beeper_linkedin_data_path }}", when: true } - - { path: "{{ matrix_beeper_linkedin_docker_src_files_path }}", when: "{{ matrix_beeper_linkedin_container_image_self_build }}" } + - {path: "{{ matrix_beeper_linkedin_base_path }}", when: true} + - {path: "{{ matrix_beeper_linkedin_config_path }}", when: true} + - {path: "{{ matrix_beeper_linkedin_data_path }}", when: true} + - {path: "{{ matrix_beeper_linkedin_docker_src_files_path }}", when: "{{ matrix_beeper_linkedin_container_image_self_build }}"} when: "item.when|bool" @@ -31,38 +31,38 @@ when: "not matrix_beeper_linkedin_container_image_self_build|bool" - block: - - name: Ensure Beeper LinkedIn repository is present on self-build - git: - repo: "{{ matrix_beeper_linkedin_container_image_self_build_repo }}" - dest: "{{ matrix_beeper_linkedin_docker_src_files_path }}" - version: "{{ matrix_beeper_linkedin_container_image_self_build_branch }}" - force: "yes" - register: matrix_beeper_linkedin_git_pull_results + - name: Ensure Beeper LinkedIn repository is present on self-build + git: + repo: "{{ matrix_beeper_linkedin_container_image_self_build_repo }}" + dest: "{{ matrix_beeper_linkedin_docker_src_files_path }}" + version: "{{ matrix_beeper_linkedin_container_image_self_build_branch }}" + force: "yes" + register: matrix_beeper_linkedin_git_pull_results - # Building the container image (using the default Dockerfile) requires that a docker-requirements.txt file be generated. - # See: https://gitlab.com/beeper/linkedin/-/blob/94442db17ccb9769b377cdb8e4bf1cb3955781d7/.gitlab-ci.yml#L30-40 - - name: Ensure docker-requirements.txt is generated before building Beeper LinkedIn Docker Image - command: | - {{ matrix_host_command_docker }} run \ - --rm \ - --entrypoint=/bin/sh \ - --mount type=bind,src={{ matrix_beeper_linkedin_docker_src_files_path }},dst=/work \ - -w /work \ - docker.io/python:3.9.6-buster \ - -c "pip install poetry && poetry export --without-hashes -E e2be -E images -E metrics | sed 's/==.*//g' > docker-requirements.txt" + # Building the container image (using the default Dockerfile) requires that a docker-requirements.txt file be generated. + # See: https://gitlab.com/beeper/linkedin/-/blob/94442db17ccb9769b377cdb8e4bf1cb3955781d7/.gitlab-ci.yml#L30-40 + - name: Ensure docker-requirements.txt is generated before building Beeper LinkedIn Docker Image + command: | + {{ matrix_host_command_docker }} run \ + --rm \ + --entrypoint=/bin/sh \ + --mount type=bind,src={{ matrix_beeper_linkedin_docker_src_files_path }},dst=/work \ + -w /work \ + docker.io/python:3.9.6-buster \ + -c "pip install poetry && poetry export --without-hashes -E e2be -E images -E metrics | sed 's/==.*//g' > docker-requirements.txt" - - name: Ensure Beeper LinkedIn Docker image is built - docker_image: - name: "{{ matrix_beeper_linkedin_docker_image }}" - source: build - force_source: "{{ matrix_beeper_linkedin_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" - force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_beeper_linkedin_git_pull_results.changed }}" - build: - dockerfile: Dockerfile - path: "{{ matrix_beeper_linkedin_docker_src_files_path }}" - pull: yes - args: - TARGETARCH: "{{ matrix_architecture }}" + - name: Ensure Beeper LinkedIn Docker image is built + docker_image: + name: "{{ matrix_beeper_linkedin_docker_image }}" + source: build + force_source: "{{ matrix_beeper_linkedin_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" + force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_beeper_linkedin_git_pull_results.changed }}" + build: + dockerfile: Dockerfile + path: "{{ matrix_beeper_linkedin_docker_src_files_path }}" + pull: true + args: + TARGETARCH: "{{ matrix_architecture }}" when: "matrix_beeper_linkedin_container_image_self_build|bool" - name: Ensure beeper-linkedin config.yaml installed @@ -90,5 +90,5 @@ - name: Ensure systemd reloaded after matrix-beeper-linkedin.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_beeper_linkedin_systemd_service_result.changed" diff --git a/roles/matrix-bridge-beeper-linkedin/tasks/setup_uninstall.yml b/roles/matrix-bridge-beeper-linkedin/tasks/setup_uninstall.yml index 175613f0d..befa2f610 100644 --- a/roles/matrix-bridge-beeper-linkedin/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-beeper-linkedin/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-beeper-linkedin state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_beeper_linkedin_service_stat.stat.exists" - name: Ensure matrix-beeper-linkedin.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-beeper-linkedin.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_beeper_linkedin_service_stat.stat.exists" diff --git a/roles/matrix-bridge-beeper-linkedin/tasks/validate_config.yml b/roles/matrix-bridge-beeper-linkedin/tasks/validate_config.yml index fe33defaf..d808de081 100644 --- a/roles/matrix-bridge-beeper-linkedin/tasks/validate_config.yml +++ b/roles/matrix-bridge-beeper-linkedin/tasks/validate_config.yml @@ -8,4 +8,3 @@ with_items: - "matrix_beeper_linkedin_appservice_token" - "matrix_beeper_linkedin_homeserver_token" - diff --git a/roles/matrix-bridge-heisenbridge/defaults/main.yml b/roles/matrix-bridge-heisenbridge/defaults/main.yml index 6772c364e..dddbb9608 100644 --- a/roles/matrix-bridge-heisenbridge/defaults/main.yml +++ b/roles/matrix-bridge-heisenbridge/defaults/main.yml @@ -1,3 +1,4 @@ +--- # heisenbridge is a bouncer-style Matrix IRC bridge # See: https://github.com/hifi/heisenbridge @@ -34,13 +35,13 @@ matrix_heisenbridge_registration_yaml: id: heisenbridge url: http://matrix-heisenbridge:9898 as_token: "{{ matrix_heisenbridge_appservice_token }}" - hs_token: "{{ matrix_heisenbridge_homeserver_token }}" + hs_token: "{{ matrix_heisenbridge_homeserver_token }}" rate_limited: false sender_localpart: heisenbridge namespaces: users: - - regex: '@hbirc_.*' - exclusive: true + - regex: '@hbirc_.*' + exclusive: true aliases: [] rooms: [] diff --git a/roles/matrix-bridge-heisenbridge/tasks/init.yml b/roles/matrix-bridge-heisenbridge/tasks/init.yml index 18e89b681..a66d7199d 100644 --- a/roles/matrix-bridge-heisenbridge/tasks/init.yml +++ b/roles/matrix-bridge-heisenbridge/tasks/init.yml @@ -1,3 +1,4 @@ +--- # If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist. # We don't want to fail in such cases. - name: Fail if matrix-synapse role already executed diff --git a/roles/matrix-bridge-heisenbridge/tasks/main.yml b/roles/matrix-bridge-heisenbridge/tasks/main.yml index 1358709d8..a266643d1 100644 --- a/roles/matrix-bridge-heisenbridge/tasks/main.yml +++ b/roles/matrix-bridge-heisenbridge/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-heisenbridge/tasks/setup_install.yml b/roles/matrix-bridge-heisenbridge/tasks/setup_install.yml index 03cf9ec3e..29b5842b6 100644 --- a/roles/matrix-bridge-heisenbridge/tasks/setup_install.yml +++ b/roles/matrix-bridge-heisenbridge/tasks/setup_install.yml @@ -4,8 +4,8 @@ docker_image: name: "{{ matrix_heisenbridge_docker_image }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" - force_source: "{{ matrix_heisenbridge_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" - force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_heisenbridge_docker_image_force_pull }}" + force_source: "{{ matrix_heisenbridge_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" + force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_heisenbridge_docker_image_force_pull }}" - name: Ensure heisenbridge paths exist file: @@ -34,5 +34,5 @@ - name: Ensure systemd reloaded after matrix-heisenbridge.service installation service: - daemon_reload: yes + daemon_reload: true when: matrix_heisenbridge_systemd_service_result.changed diff --git a/roles/matrix-bridge-heisenbridge/tasks/setup_uninstall.yml b/roles/matrix-bridge-heisenbridge/tasks/setup_uninstall.yml index cf100a895..54d5bd67b 100644 --- a/roles/matrix-bridge-heisenbridge/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-heisenbridge/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-heisenbridge state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_heisenbridge_service_stat.stat.exists" - name: Ensure matrix-heisenbridge.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-heisenbridge.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_heisenbridge_service_stat.stat.exists" diff --git a/roles/matrix-bridge-hookshot/defaults/main.yml b/roles/matrix-bridge-hookshot/defaults/main.yml index e32dba3bf..2db8ba774 100644 --- a/roles/matrix-bridge-hookshot/defaults/main.yml +++ b/roles/matrix-bridge-hookshot/defaults/main.yml @@ -1,3 +1,5 @@ +--- + # A bridge between Matrix and multiple project management services, such as GitHub, GitLab and JIRA. # https://github.com/Half-Shot/matrix-hookshot @@ -43,11 +45,11 @@ matrix_hookshot_github_appid: '' # Alternatively, leave it empty and do it manually or use matrix-aux instead, see docs/matrix-bridge-hookshot.md for info. matrix_hookshot_github_private_key: '' matrix_hookshot_github_private_key_file: 'private-key.pem' -matrix_hookshot_github_secret: '' # "Webhook secret" on the GitHub App page +matrix_hookshot_github_secret: '' # "Webhook secret" on the GitHub App page matrix_hookshot_github_oauth_enabled: false # You need to configure oauth settings only when you have enabled oauth (optional) -matrix_hookshot_github_oauth_id: '' # "Client ID" on the GitHub App page -matrix_hookshot_github_oauth_secret: '' # "Client Secret" on the GitHub App page +matrix_hookshot_github_oauth_id: '' # "Client ID" on the GitHub App page +matrix_hookshot_github_oauth_secret: '' # "Client Secret" on the GitHub App page # Default value of matrix_hookshot_github_oauth_endpoint: "/hookshot/webhooks/oauth" matrix_hookshot_github_oauth_endpoint: "{{ matrix_hookshot_webhook_endpoint }}/oauth" matrix_hookshot_github_oauth_uri: "https://{{ matrix_server_fqn_matrix }}{{ matrix_hookshot_github_oauth_endpoint }}" diff --git a/roles/matrix-bridge-hookshot/tasks/init.yml b/roles/matrix-bridge-hookshot/tasks/init.yml index 67b793d44..a2229c368 100644 --- a/roles/matrix-bridge-hookshot/tasks/init.yml +++ b/roles/matrix-bridge-hookshot/tasks/init.yml @@ -1,3 +1,4 @@ +--- # If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist. # We don't want to fail in such cases. - name: Fail if matrix-synapse role already executed @@ -24,98 +25,98 @@ when: matrix_hookshot_enabled|bool - block: - - name: Fail if matrix-nginx-proxy role already executed - fail: - msg: >- - Trying to append hookshot's reverse-proxying configuration to matrix-nginx-proxy, - 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-bridge-hookshot role. - when: matrix_nginx_proxy_role_executed|default(False)|bool + - name: Fail if matrix-nginx-proxy role already executed + fail: + msg: >- + Trying to append hookshot's reverse-proxying configuration to matrix-nginx-proxy, + 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-bridge-hookshot role. + when: matrix_nginx_proxy_role_executed|default(False)|bool - - name: Generate Matrix hookshot proxying configuration for matrix-nginx-proxy - set_fact: - matrix_hookshot_matrix_nginx_proxy_configuration: | - location ~ ^{{ matrix_hookshot_appservice_endpoint }}/(.*)$ { - {% 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_hookshot_container_url }}:{{ matrix_hookshot_appservice_port }}"; - proxy_pass http://$backend/$1; - {% else %} - {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:{{ matrix_hookshot_appservice_port }}/$1; + - name: Generate Matrix hookshot proxying configuration for matrix-nginx-proxy + set_fact: + matrix_hookshot_matrix_nginx_proxy_configuration: | + location ~ ^{{ matrix_hookshot_appservice_endpoint }}/(.*)$ { + {% 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_hookshot_container_url }}:{{ matrix_hookshot_appservice_port }}"; + proxy_pass http://$backend/$1; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://127.0.0.1:{{ matrix_hookshot_appservice_port }}/$1; + {% endif %} + proxy_set_header Host $host; + } + {% if matrix_hookshot_provisioning_enabled %} + location ~ ^{{ matrix_hookshot_provisioning_endpoint }}/(.*)$ { + {% 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_hookshot_container_url }}:{{ matrix_hookshot_provisioning_port }}"; + proxy_pass http://$backend/$1; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://127.0.0.1:{{ matrix_hookshot_provisioning_port }}/$1; + {% endif %} + proxy_set_header Host $host; + } {% endif %} - proxy_set_header Host $host; - } - {% if matrix_hookshot_provisioning_enabled %} - location ~ ^{{ matrix_hookshot_provisioning_endpoint }}/(.*)$ { - {% 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_hookshot_container_url }}:{{ matrix_hookshot_provisioning_port }}"; - proxy_pass http://$backend/$1; - {% else %} - {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:{{ matrix_hookshot_provisioning_port }}/$1; - {% endif %} - proxy_set_header Host $host; - } - {% endif %} - location ~ ^{{ matrix_hookshot_webhook_endpoint }}/(.*)$ { - {% 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_hookshot_container_url }}:{{ matrix_hookshot_webhook_port }}"; - proxy_pass http://$backend/$1; - {% else %} - {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:{{ matrix_hookshot_webhook_port }}/$1; - {% endif %} - proxy_set_header Host $host; - } + location ~ ^{{ matrix_hookshot_webhook_endpoint }}/(.*)$ { + {% 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_hookshot_container_url }}:{{ matrix_hookshot_webhook_port }}"; + proxy_pass http://$backend/$1; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://127.0.0.1:{{ matrix_hookshot_webhook_port }}/$1; + {% endif %} + proxy_set_header Host $host; + } - - name: Register hookshot proxying configuration with matrix-nginx-proxy - set_fact: - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | - {{ - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) - + - [matrix_hookshot_matrix_nginx_proxy_configuration] - }} + - name: Register hookshot proxying configuration with matrix-nginx-proxy + set_fact: + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | + {{ + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) + + + [matrix_hookshot_matrix_nginx_proxy_configuration] + }} - - name: Generate Matrix hookshot proxying configuration for matrix-nginx-proxy - set_fact: - matrix_hookshot_matrix_nginx_proxy_metrics_configuration: | - {% if matrix_hookshot_metrics_enabled and matrix_hookshot_proxy_metrics %} - location {{ matrix_hookshot_metrics_endpoint }} { - {% 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_hookshot_container_url }}:{{ matrix_hookshot_metrics_port }}"; - proxy_pass http://$backend/metrics; - {% else %} - {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:{{ matrix_hookshot_metrics_port }}/metrics; + - name: Generate Matrix hookshot proxying configuration for matrix-nginx-proxy + set_fact: + matrix_hookshot_matrix_nginx_proxy_metrics_configuration: | + {% if matrix_hookshot_metrics_enabled and matrix_hookshot_proxy_metrics %} + location {{ matrix_hookshot_metrics_endpoint }} { + {% 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_hookshot_container_url }}:{{ matrix_hookshot_metrics_port }}"; + proxy_pass http://$backend/metrics; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://127.0.0.1:{{ matrix_hookshot_metrics_port }}/metrics; + {% endif %} + proxy_set_header Host $host; + {% if matrix_hookshot_proxy_metrics_basic_auth_enabled %} + auth_basic "protected"; + auth_basic_user_file /nginx-data/matrix-synapse-metrics-htpasswd; + {% endif %} + } {% endif %} - proxy_set_header Host $host; - {% if matrix_hookshot_proxy_metrics_basic_auth_enabled %} - auth_basic "protected"; - auth_basic_user_file /nginx-data/matrix-synapse-metrics-htpasswd; - {% endif %} - } - {% endif %} - - name: Register hookshot metrics proxying configuration with matrix-nginx-proxy - set_fact: - matrix_nginx_proxy_proxy_grafana_additional_server_configuration_blocks: | - {{ - matrix_nginx_proxy_proxy_grafana_additional_server_configuration_blocks|default([]) - + - [matrix_hookshot_matrix_nginx_proxy_metrics_configuration] - }} + - name: Register hookshot metrics proxying configuration with matrix-nginx-proxy + set_fact: + matrix_nginx_proxy_proxy_grafana_additional_server_configuration_blocks: | + {{ + matrix_nginx_proxy_proxy_grafana_additional_server_configuration_blocks|default([]) + + + [matrix_hookshot_matrix_nginx_proxy_metrics_configuration] + }} tags: - - always + - always when: matrix_hookshot_enabled|bool - name: Warn about reverse-proxying if matrix-nginx-proxy not used diff --git a/roles/matrix-bridge-hookshot/tasks/main.yml b/roles/matrix-bridge-hookshot/tasks/main.yml index 85ab25890..409b6175a 100644 --- a/roles/matrix-bridge-hookshot/tasks/main.yml +++ b/roles/matrix-bridge-hookshot/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-hookshot/tasks/setup_install.yml b/roles/matrix-bridge-hookshot/tasks/setup_install.yml index 059dd7b5b..416db621b 100644 --- a/roles/matrix-bridge-hookshot/tasks/setup_install.yml +++ b/roles/matrix-bridge-hookshot/tasks/setup_install.yml @@ -80,5 +80,5 @@ - name: Ensure systemd reloaded after matrix-hookshot.service installation service: - daemon_reload: yes + daemon_reload: true when: matrix_hookshot_systemd_service_result.changed diff --git a/roles/matrix-bridge-hookshot/tasks/setup_uninstall.yml b/roles/matrix-bridge-hookshot/tasks/setup_uninstall.yml index 89ab01b46..d8efbb029 100644 --- a/roles/matrix-bridge-hookshot/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-hookshot/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-hookshot state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_hookshot_service_stat.stat.exists" - name: Ensure matrix-hookshot.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-hookshot.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_hookshot_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mautrix-facebook/defaults/main.yml b/roles/matrix-bridge-mautrix-facebook/defaults/main.yml index e8b161e6c..f781ba915 100644 --- a/roles/matrix-bridge-mautrix-facebook/defaults/main.yml +++ b/roles/matrix-bridge-mautrix-facebook/defaults/main.yml @@ -1,3 +1,4 @@ +--- # mautrix-facebook is a Matrix <-> Facebook bridge # See: https://github.com/mautrix/facebook diff --git a/roles/matrix-bridge-mautrix-facebook/tasks/init.yml b/roles/matrix-bridge-mautrix-facebook/tasks/init.yml index cf67f2276..d97a3230e 100644 --- a/roles/matrix-bridge-mautrix-facebook/tasks/init.yml +++ b/roles/matrix-bridge-mautrix-facebook/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-bridge-mautrix-facebook/tasks/main.yml b/roles/matrix-bridge-mautrix-facebook/tasks/main.yml index 54fb6f9df..b6e65fe28 100644 --- a/roles/matrix-bridge-mautrix-facebook/tasks/main.yml +++ b/roles/matrix-bridge-mautrix-facebook/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mautrix-facebook/tasks/setup_install.yml b/roles/matrix-bridge-mautrix-facebook/tasks/setup_install.yml index d5230bca9..3fa429702 100644 --- a/roles/matrix-bridge-mautrix-facebook/tasks/setup_install.yml +++ b/roles/matrix-bridge-mautrix-facebook/tasks/setup_install.yml @@ -50,10 +50,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mautrix_facebook_base_path }}", when: true } - - { path: "{{ matrix_mautrix_facebook_config_path }}", when: true } - - { path: "{{ matrix_mautrix_facebook_data_path }}", when: true } - - { path: "{{ matrix_mautrix_facebook_docker_src_files_path }}", when: "{{ matrix_mautrix_facebook_container_image_self_build }}" } + - {path: "{{ matrix_mautrix_facebook_base_path }}", when: true} + - {path: "{{ matrix_mautrix_facebook_config_path }}", when: true} + - {path: "{{ matrix_mautrix_facebook_data_path }}", when: true} + - {path: "{{ matrix_mautrix_facebook_docker_src_files_path }}", when: "{{ matrix_mautrix_facebook_container_image_self_build }}"} when: item.when|bool - name: Ensure Mautrix Facebook repository is present on self-build @@ -74,7 +74,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mautrix_facebook_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mautrix_facebook_container_image_self_build|bool" - name: Check if an old database file already exists @@ -86,8 +86,8 @@ service: name: matrix-mautrix-facebook state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true failed_when: false when: "matrix_mautrix_facebook_stat_database.stat.exists" @@ -120,7 +120,7 @@ - name: Ensure systemd reloaded after matrix-mautrix-facebook.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_facebook_systemd_service_result.changed" - name: Ensure matrix-mautrix-facebook.service restarted, if necessary diff --git a/roles/matrix-bridge-mautrix-facebook/tasks/setup_uninstall.yml b/roles/matrix-bridge-mautrix-facebook/tasks/setup_uninstall.yml index abbce3501..1c8fbd3b6 100644 --- a/roles/matrix-bridge-mautrix-facebook/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mautrix-facebook/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-mautrix-facebook state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mautrix_facebook_service_stat.stat.exists" - name: Ensure matrix-mautrix-facebook.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-mautrix-facebook.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_facebook_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mautrix-googlechat/defaults/main.yml b/roles/matrix-bridge-mautrix-googlechat/defaults/main.yml index 02bef16aa..1b89bea6d 100644 --- a/roles/matrix-bridge-mautrix-googlechat/defaults/main.yml +++ b/roles/matrix-bridge-mautrix-googlechat/defaults/main.yml @@ -1,3 +1,4 @@ +--- # mautrix-googlechat is a Matrix <-> googlechat bridge # See: https://github.com/mautrix/googlechat diff --git a/roles/matrix-bridge-mautrix-googlechat/tasks/init.yml b/roles/matrix-bridge-mautrix-googlechat/tasks/init.yml index 5c8d82bfe..e64cb44ca 100644 --- a/roles/matrix-bridge-mautrix-googlechat/tasks/init.yml +++ b/roles/matrix-bridge-mautrix-googlechat/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 @@ -23,39 +24,39 @@ when: matrix_mautrix_googlechat_enabled|bool - block: - - name: Fail if matrix-nginx-proxy role already executed - fail: - msg: >- - Trying to append Mautrix googlechat's reverse-proxying configuration to matrix-nginx-proxy, - 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-bridge-mautrix-googlechat role. - when: matrix_nginx_proxy_role_executed|default(False)|bool + - name: Fail if matrix-nginx-proxy role already executed + fail: + msg: >- + Trying to append Mautrix googlechat's reverse-proxying configuration to matrix-nginx-proxy, + 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-bridge-mautrix-googlechat role. + when: matrix_nginx_proxy_role_executed|default(False)|bool - - name: Generate Mautrix googlechat proxying configuration for matrix-nginx-proxy - set_fact: - matrix_mautrix_googlechat_matrix_nginx_proxy_configuration: | - location {{ matrix_mautrix_googlechat_public_endpoint }} { - {% 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-mautrix-googlechat:8080"; - proxy_pass http://$backend; - {% else %} - {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:9007; - {% endif %} - } - - name: Register Mautrix googlechat proxying configuration with matrix-nginx-proxy - set_fact: - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | - {{ - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) - + - [matrix_mautrix_googlechat_matrix_nginx_proxy_configuration] - }} + - name: Generate Mautrix googlechat proxying configuration for matrix-nginx-proxy + set_fact: + matrix_mautrix_googlechat_matrix_nginx_proxy_configuration: | + location {{ matrix_mautrix_googlechat_public_endpoint }} { + {% 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-mautrix-googlechat:8080"; + proxy_pass http://$backend; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://127.0.0.1:9007; + {% endif %} + } + - name: Register Mautrix googlechat proxying configuration with matrix-nginx-proxy + set_fact: + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | + {{ + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) + + + [matrix_mautrix_googlechat_matrix_nginx_proxy_configuration] + }} tags: - - always + - always when: matrix_mautrix_googlechat_enabled|bool - name: Warn about reverse-proxying if matrix-nginx-proxy not used diff --git a/roles/matrix-bridge-mautrix-googlechat/tasks/main.yml b/roles/matrix-bridge-mautrix-googlechat/tasks/main.yml index defcd58ac..16054e7b5 100644 --- a/roles/matrix-bridge-mautrix-googlechat/tasks/main.yml +++ b/roles/matrix-bridge-mautrix-googlechat/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml b/roles/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml index 293e8817f..9faf344fe 100644 --- a/roles/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml +++ b/roles/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml @@ -50,10 +50,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mautrix_googlechat_base_path }}", when: true } - - { path: "{{ matrix_mautrix_googlechat_config_path }}", when: true } - - { path: "{{ matrix_mautrix_googlechat_data_path }}", when: true } - - { path: "{{ matrix_mautrix_googlechat_docker_src_files_path }}", when: "{{ matrix_mautrix_googlechat_container_image_self_build }}" } + - {path: "{{ matrix_mautrix_googlechat_base_path }}", when: true} + - {path: "{{ matrix_mautrix_googlechat_config_path }}", when: true} + - {path: "{{ matrix_mautrix_googlechat_data_path }}", when: true} + - {path: "{{ matrix_mautrix_googlechat_docker_src_files_path }}", when: "{{ matrix_mautrix_googlechat_container_image_self_build }}"} when: "item.when|bool" - name: Ensure Mautrix Hangots repository is present on self build @@ -73,7 +73,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mautrix_googlechat_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mautrix_googlechat_container_image_self_build|bool" - name: Check if an old database file already exists @@ -85,8 +85,8 @@ service: name: matrix-mautrix-googlechat state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true failed_when: false when: "matrix_mautrix_googlechat_stat_database.stat.exists" @@ -119,7 +119,7 @@ - name: Ensure systemd reloaded after matrix-mautrix-googlechat.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_googlechat_systemd_service_result.changed" - name: Ensure matrix-mautrix-googlechat.service restarted, if necessary diff --git a/roles/matrix-bridge-mautrix-googlechat/tasks/setup_uninstall.yml b/roles/matrix-bridge-mautrix-googlechat/tasks/setup_uninstall.yml index bdcaa6e71..a315c0c84 100644 --- a/roles/matrix-bridge-mautrix-googlechat/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mautrix-googlechat/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-mautrix-googlechat state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mautrix_googlechat_service_stat.stat.exists" - name: Ensure matrix-mautrix-googlechat.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-mautrix-googlechat.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_googlechat_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mautrix-googlechat/tasks/validate_config.yml b/roles/matrix-bridge-mautrix-googlechat/tasks/validate_config.yml index 7aa428708..083e8d342 100644 --- a/roles/matrix-bridge-mautrix-googlechat/tasks/validate_config.yml +++ b/roles/matrix-bridge-mautrix-googlechat/tasks/validate_config.yml @@ -11,4 +11,4 @@ - "matrix_mautrix_googlechat_homeserver_token" - debug: msg: - - '`matrix_mautrix_googlechat_homeserver_domain` == {{ matrix_mautrix_googlechat_homeserver_domain }}' + - '`matrix_mautrix_googlechat_homeserver_domain` == {{ matrix_mautrix_googlechat_homeserver_domain }}' diff --git a/roles/matrix-bridge-mautrix-hangouts/defaults/main.yml b/roles/matrix-bridge-mautrix-hangouts/defaults/main.yml index 013e1d14a..911c81c6d 100644 --- a/roles/matrix-bridge-mautrix-hangouts/defaults/main.yml +++ b/roles/matrix-bridge-mautrix-hangouts/defaults/main.yml @@ -1,3 +1,4 @@ +--- # mautrix-hangouts is a Matrix <-> Hangouts bridge # See: https://github.com/mautrix/hangouts diff --git a/roles/matrix-bridge-mautrix-hangouts/tasks/init.yml b/roles/matrix-bridge-mautrix-hangouts/tasks/init.yml index 59756ec90..65d4776e2 100644 --- a/roles/matrix-bridge-mautrix-hangouts/tasks/init.yml +++ b/roles/matrix-bridge-mautrix-hangouts/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 @@ -23,39 +24,39 @@ when: matrix_mautrix_hangouts_enabled|bool - block: - - name: Fail if matrix-nginx-proxy role already executed - fail: - msg: >- - Trying to append Mautrix Hangouts's reverse-proxying configuration to matrix-nginx-proxy, - 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-bridge-mautrix-hangouts role. - when: matrix_nginx_proxy_role_executed|default(False)|bool + - name: Fail if matrix-nginx-proxy role already executed + fail: + msg: >- + Trying to append Mautrix Hangouts's reverse-proxying configuration to matrix-nginx-proxy, + 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-bridge-mautrix-hangouts role. + when: matrix_nginx_proxy_role_executed|default(False)|bool - - name: Generate Mautrix Hangouts proxying configuration for matrix-nginx-proxy - set_fact: - matrix_mautrix_hangouts_matrix_nginx_proxy_configuration: | - location {{ matrix_mautrix_hangouts_public_endpoint }} { - {% 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-mautrix-hangouts:8080"; - proxy_pass http://$backend; - {% else %} - {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:9007; - {% endif %} - } - - name: Register Mautrix Hangouts proxying configuration with matrix-nginx-proxy - set_fact: - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | - {{ - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) - + - [matrix_mautrix_hangouts_matrix_nginx_proxy_configuration] - }} + - name: Generate Mautrix Hangouts proxying configuration for matrix-nginx-proxy + set_fact: + matrix_mautrix_hangouts_matrix_nginx_proxy_configuration: | + location {{ matrix_mautrix_hangouts_public_endpoint }} { + {% 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-mautrix-hangouts:8080"; + proxy_pass http://$backend; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://127.0.0.1:9007; + {% endif %} + } + - name: Register Mautrix Hangouts proxying configuration with matrix-nginx-proxy + set_fact: + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | + {{ + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) + + + [matrix_mautrix_hangouts_matrix_nginx_proxy_configuration] + }} tags: - - always + - always when: matrix_mautrix_hangouts_enabled|bool - name: Warn about reverse-proxying if matrix-nginx-proxy not used diff --git a/roles/matrix-bridge-mautrix-hangouts/tasks/main.yml b/roles/matrix-bridge-mautrix-hangouts/tasks/main.yml index 0df0d0e37..b43ff478b 100644 --- a/roles/matrix-bridge-mautrix-hangouts/tasks/main.yml +++ b/roles/matrix-bridge-mautrix-hangouts/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml b/roles/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml index fb5236fd5..368ee5f87 100644 --- a/roles/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml +++ b/roles/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml @@ -50,10 +50,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mautrix_hangouts_base_path }}", when: true } - - { path: "{{ matrix_mautrix_hangouts_config_path }}", when: true } - - { path: "{{ matrix_mautrix_hangouts_data_path }}", when: true } - - { path: "{{ matrix_mautrix_hangouts_docker_src_files_path }}", when: "{{ matrix_mautrix_hangouts_container_image_self_build }}" } + - {path: "{{ matrix_mautrix_hangouts_base_path }}", when: true} + - {path: "{{ matrix_mautrix_hangouts_config_path }}", when: true} + - {path: "{{ matrix_mautrix_hangouts_data_path }}", when: true} + - {path: "{{ matrix_mautrix_hangouts_docker_src_files_path }}", when: "{{ matrix_mautrix_hangouts_container_image_self_build }}"} when: "item.when|bool" - name: Ensure Mautrix Hangots repository is present on self build @@ -73,7 +73,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mautrix_hangouts_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mautrix_hangouts_container_image_self_build|bool" - name: Check if an old database file already exists @@ -85,8 +85,8 @@ service: name: matrix-mautrix-hangouts state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true failed_when: false when: "matrix_mautrix_hangouts_stat_database.stat.exists" @@ -119,7 +119,7 @@ - name: Ensure systemd reloaded after matrix-mautrix-hangouts.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_hangouts_systemd_service_result.changed" - name: Ensure matrix-mautrix-hangouts.service restarted, if necessary diff --git a/roles/matrix-bridge-mautrix-hangouts/tasks/setup_uninstall.yml b/roles/matrix-bridge-mautrix-hangouts/tasks/setup_uninstall.yml index 34348cfd4..8ce859c8e 100644 --- a/roles/matrix-bridge-mautrix-hangouts/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mautrix-hangouts/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-mautrix-hangouts state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mautrix_hangouts_service_stat.stat.exists" - name: Ensure matrix-mautrix-hangouts.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-mautrix-hangouts.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_hangouts_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mautrix-hangouts/tasks/validate_config.yml b/roles/matrix-bridge-mautrix-hangouts/tasks/validate_config.yml index 8922bef46..0242ef16c 100644 --- a/roles/matrix-bridge-mautrix-hangouts/tasks/validate_config.yml +++ b/roles/matrix-bridge-mautrix-hangouts/tasks/validate_config.yml @@ -11,4 +11,4 @@ - "matrix_mautrix_hangouts_homeserver_token" - debug: msg: - - '`matrix_mautrix_hangouts_homeserver_domain` == {{ matrix_mautrix_hangouts_homeserver_domain }}' + - '`matrix_mautrix_hangouts_homeserver_domain` == {{ matrix_mautrix_hangouts_homeserver_domain }}' diff --git a/roles/matrix-bridge-mautrix-instagram/defaults/main.yml b/roles/matrix-bridge-mautrix-instagram/defaults/main.yml index a3783328e..9fc42cea8 100644 --- a/roles/matrix-bridge-mautrix-instagram/defaults/main.yml +++ b/roles/matrix-bridge-mautrix-instagram/defaults/main.yml @@ -1,3 +1,4 @@ +--- # mautrix-instagram is a Matrix <-> Instagram bridge # See: https://github.com/mautrix/instagram diff --git a/roles/matrix-bridge-mautrix-instagram/tasks/init.yml b/roles/matrix-bridge-mautrix-instagram/tasks/init.yml index c44855d81..d33acd09d 100644 --- a/roles/matrix-bridge-mautrix-instagram/tasks/init.yml +++ b/roles/matrix-bridge-mautrix-instagram/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-bridge-mautrix-instagram/tasks/main.yml b/roles/matrix-bridge-mautrix-instagram/tasks/main.yml index 7326e22d7..b6ffcd06a 100644 --- a/roles/matrix-bridge-mautrix-instagram/tasks/main.yml +++ b/roles/matrix-bridge-mautrix-instagram/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mautrix-instagram/tasks/setup_install.yml b/roles/matrix-bridge-mautrix-instagram/tasks/setup_install.yml index 38a7f62ef..dc95af3a3 100644 --- a/roles/matrix-bridge-mautrix-instagram/tasks/setup_install.yml +++ b/roles/matrix-bridge-mautrix-instagram/tasks/setup_install.yml @@ -23,13 +23,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mautrix_instagram_base_path }}", when: true } - - { path: "{{ matrix_mautrix_instagram_config_path }}", when: true } - - { path: "{{ matrix_mautrix_instagram_data_path }}", when: true } - - { - path: "{{ matrix_mautrix_instagram_docker_src_files_path }}", - when: "{{ matrix_mautrix_instagram_container_image_self_build }}", - } + - {path: "{{ matrix_mautrix_instagram_base_path }}", when: true} + - {path: "{{ matrix_mautrix_instagram_config_path }}", when: true} + - {path: "{{ matrix_mautrix_instagram_data_path }}", when: true} + - {path: "{{ matrix_mautrix_instagram_docker_src_files_path }}", when: "{{ matrix_mautrix_instagram_container_image_self_build }}"} when: item.when|bool - name: Ensure Mautrix instagram repository is present on self-build @@ -49,7 +46,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mautrix_instagram_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mautrix_instagram_container_image_self_build|bool" - name: Ensure mautrix-instagram config.yaml installed @@ -77,5 +74,5 @@ - name: Ensure systemd reloaded after matrix-mautrix-instagram.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_instagram_systemd_service_result.changed" diff --git a/roles/matrix-bridge-mautrix-instagram/tasks/setup_uninstall.yml b/roles/matrix-bridge-mautrix-instagram/tasks/setup_uninstall.yml index 02e20b619..2cc0e0e93 100644 --- a/roles/matrix-bridge-mautrix-instagram/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mautrix-instagram/tasks/setup_uninstall.yml @@ -8,8 +8,8 @@ service: name: matrix-mautrix-instagram state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mautrix_instagram_service_stat.stat.exists" - name: Ensure matrix-mautrix-instagram.service doesn't exist @@ -20,5 +20,5 @@ - name: Ensure systemd reloaded after matrix-mautrix-instagram.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_instagram_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mautrix-signal/defaults/main.yml b/roles/matrix-bridge-mautrix-signal/defaults/main.yml index ceaa9b87e..ca06c268a 100644 --- a/roles/matrix-bridge-mautrix-signal/defaults/main.yml +++ b/roles/matrix-bridge-mautrix-signal/defaults/main.yml @@ -1,3 +1,4 @@ +--- # mautrix-signal is a Matrix <-> Signal bridge # See: https://github.com/mautrix/signal diff --git a/roles/matrix-bridge-mautrix-signal/tasks/init.yml b/roles/matrix-bridge-mautrix-signal/tasks/init.yml index 6133e8654..21d52066f 100644 --- a/roles/matrix-bridge-mautrix-signal/tasks/init.yml +++ b/roles/matrix-bridge-mautrix-signal/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-signal.service', 'matrix-mautrix-signal-daemon.service'] }}" when: matrix_mautrix_signal_enabled|bool diff --git a/roles/matrix-bridge-mautrix-signal/tasks/main.yml b/roles/matrix-bridge-mautrix-signal/tasks/main.yml index edca20e61..643b94c9c 100644 --- a/roles/matrix-bridge-mautrix-signal/tasks/main.yml +++ b/roles/matrix-bridge-mautrix-signal/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mautrix-signal/tasks/setup_install.yml b/roles/matrix-bridge-mautrix-signal/tasks/setup_install.yml index 1a9b29154..6fd0f8136 100644 --- a/roles/matrix-bridge-mautrix-signal/tasks/setup_install.yml +++ b/roles/matrix-bridge-mautrix-signal/tasks/setup_install.yml @@ -34,7 +34,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mautrix_signal_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mautrix_signal_container_image_self_build|bool" @@ -64,7 +64,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mautrix_signal_daemon_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mautrix_signal_daemon_container_image_self_build|bool" - name: Ensure Mautrix Signal paths exist @@ -114,5 +114,5 @@ - name: Ensure systemd reloaded after matrix-mautrix-signal.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_signal_systemd_service_result.changed or matrix_mautrix_signal_daemon_systemd_service_result.changed" diff --git a/roles/matrix-bridge-mautrix-signal/tasks/setup_uninstall.yml b/roles/matrix-bridge-mautrix-signal/tasks/setup_uninstall.yml index b36ef81d9..8ca2be3fe 100644 --- a/roles/matrix-bridge-mautrix-signal/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mautrix-signal/tasks/setup_uninstall.yml @@ -10,8 +10,8 @@ service: name: matrix-mautrix-signal-daemon state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mautrix_signal_daemon_service_stat.stat.exists" - name: Ensure matrix-mautrix-signal-daemon.service doesn't exist @@ -30,8 +30,8 @@ service: name: matrix-mautrix-signal state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mautrix_signal_service_stat.stat.exists" - name: Ensure matrix-mautrix-signal.service doesn't exist @@ -43,5 +43,5 @@ # All services - name: Ensure systemd reloaded after matrix-mautrix-signal_X.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_signal_service_stat.stat.exists or matrix_mautrix_signal_daemon_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mautrix-telegram/defaults/main.yml b/roles/matrix-bridge-mautrix-telegram/defaults/main.yml index bcdcfdd8f..f9e7f890e 100644 --- a/roles/matrix-bridge-mautrix-telegram/defaults/main.yml +++ b/roles/matrix-bridge-mautrix-telegram/defaults/main.yml @@ -1,3 +1,4 @@ +--- # mautrix-telegram is a Matrix <-> Telegram bridge # See: https://github.com/mautrix/telegram @@ -7,7 +8,7 @@ matrix_telegram_lottieconverter_container_image_self_build: false matrix_telegram_lottieconverter_container_image_self_build_mask_arch: false matrix_telegram_lottieconverter_docker_repo: "https://mau.dev/tulir/lottieconverter.git" matrix_telegram_lottieconverter_docker_src_files_path: "{{ matrix_base_data_path }}/lotticonverter/docker-src" -matrix_telegram_lottieconverter_docker_image: "dock.mau.dev/tulir/lottieconverter:alpine-3.15" # needs to be ajusted according to FROM clause of Dockerfile of mautrix-telegram +matrix_telegram_lottieconverter_docker_image: "dock.mau.dev/tulir/lottieconverter:alpine-3.15" # needs to be ajusted according to FROM clause of Dockerfile of mautrix-telegram matrix_mautrix_telegram_container_image_self_build: false matrix_mautrix_telegram_docker_repo: "https://mau.dev/mautrix/telegram.git" diff --git a/roles/matrix-bridge-mautrix-telegram/tasks/init.yml b/roles/matrix-bridge-mautrix-telegram/tasks/init.yml index 662ea1c39..267658ef9 100644 --- a/roles/matrix-bridge-mautrix-telegram/tasks/init.yml +++ b/roles/matrix-bridge-mautrix-telegram/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 @@ -23,40 +24,40 @@ when: matrix_mautrix_telegram_enabled|bool - block: - - name: Fail if matrix-nginx-proxy role already executed - fail: - msg: >- - Trying to append Mautrix Telegram's reverse-proxying configuration to matrix-nginx-proxy, - 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-bridge-mautrix-telegram role. - when: matrix_nginx_proxy_role_executed|default(False)|bool + - name: Fail if matrix-nginx-proxy role already executed + fail: + msg: >- + Trying to append Mautrix Telegram's reverse-proxying configuration to matrix-nginx-proxy, + 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-bridge-mautrix-telegram role. + when: matrix_nginx_proxy_role_executed|default(False)|bool - - name: Generate Mautrix Telegram proxying configuration for matrix-nginx-proxy - set_fact: - matrix_mautrix_telegram_matrix_nginx_proxy_configuration: | - location {{ matrix_mautrix_telegram_public_endpoint }} { - {% 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-mautrix-telegram:8080"; - proxy_pass http://$backend; - {% else %} - {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:9006; - {% endif %} - } + - name: Generate Mautrix Telegram proxying configuration for matrix-nginx-proxy + set_fact: + matrix_mautrix_telegram_matrix_nginx_proxy_configuration: | + location {{ matrix_mautrix_telegram_public_endpoint }} { + {% 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-mautrix-telegram:8080"; + proxy_pass http://$backend; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://127.0.0.1:9006; + {% endif %} + } - - name: Register Mautrix Telegram proxying configuration with matrix-nginx-proxy - set_fact: - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | - {{ - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) - + - [matrix_mautrix_telegram_matrix_nginx_proxy_configuration] - }} + - name: Register Mautrix Telegram proxying configuration with matrix-nginx-proxy + set_fact: + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | + {{ + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) + + + [matrix_mautrix_telegram_matrix_nginx_proxy_configuration] + }} tags: - - always + - always when: matrix_mautrix_telegram_enabled|bool - name: Warn about reverse-proxying if matrix-nginx-proxy not used diff --git a/roles/matrix-bridge-mautrix-telegram/tasks/main.yml b/roles/matrix-bridge-mautrix-telegram/tasks/main.yml index 8a218ed8d..018b30da4 100644 --- a/roles/matrix-bridge-mautrix-telegram/tasks/main.yml +++ b/roles/matrix-bridge-mautrix-telegram/tasks/main.yml @@ -1,3 +1,4 @@ +--- - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mautrix-telegram/tasks/setup_install.yml b/roles/matrix-bridge-mautrix-telegram/tasks/setup_install.yml index 1e34e2cd6..ceda10a58 100644 --- a/roles/matrix-bridge-mautrix-telegram/tasks/setup_install.yml +++ b/roles/matrix-bridge-mautrix-telegram/tasks/setup_install.yml @@ -42,10 +42,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mautrix_telegram_base_path }}", when: true } - - { path: "{{ matrix_mautrix_telegram_config_path }}", when: true } - - { path: "{{ matrix_mautrix_telegram_data_path }}", when: true } - - { path: "{{ matrix_mautrix_telegram_docker_src_files_path }}", when: "{{ matrix_mautrix_telegram_container_image_self_build }}" } + - {path: "{{ matrix_mautrix_telegram_base_path }}", when: true} + - {path: "{{ matrix_mautrix_telegram_config_path }}", when: true} + - {path: "{{ matrix_mautrix_telegram_data_path }}", when: true} + - {path: "{{ matrix_mautrix_telegram_docker_src_files_path }}", when: "{{ matrix_mautrix_telegram_container_image_self_build }}"} when: item.when|bool - name: Ensure Mautrix Telegram image is pulled @@ -73,7 +73,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_telegram_lottieconverter_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_telegram_lottieconverter_container_image_self_build|bool and matrix_telegram_lottieconverter_git_pull_results.changed and matrix_mautrix_telegram_container_image_self_build|bool" - name: Ensure matrix-mautrix-telegram repository is present when self-building @@ -107,8 +107,8 @@ service: name: matrix-mautrix-telegram state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true failed_when: false when: "matrix_mautrix_telegram_stat_database.stat.exists" @@ -141,7 +141,7 @@ - name: Ensure systemd reloaded after matrix-mautrix-telegram.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_telegram_systemd_service_result.changed" - name: Ensure matrix-mautrix-telegram.service restarted, if necessary diff --git a/roles/matrix-bridge-mautrix-telegram/tasks/setup_uninstall.yml b/roles/matrix-bridge-mautrix-telegram/tasks/setup_uninstall.yml index bc84edbba..a713898b9 100644 --- a/roles/matrix-bridge-mautrix-telegram/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mautrix-telegram/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-mautrix-telegram state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mautrix_telegram_service_stat.stat.exists" - name: Ensure matrix-mautrix-telegram.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-mautrix-telegram.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_telegram_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mautrix-twitter/defaults/main.yml b/roles/matrix-bridge-mautrix-twitter/defaults/main.yml index 6a72706b5..f8fd29c80 100644 --- a/roles/matrix-bridge-mautrix-twitter/defaults/main.yml +++ b/roles/matrix-bridge-mautrix-twitter/defaults/main.yml @@ -1,3 +1,4 @@ +--- # mautrix-twitter is a Matrix <-> Twitter bridge # See: https://github.com/mautrix/twitter diff --git a/roles/matrix-bridge-mautrix-twitter/tasks/init.yml b/roles/matrix-bridge-mautrix-twitter/tasks/init.yml index 4f8df9e0c..5b526bbde 100644 --- a/roles/matrix-bridge-mautrix-twitter/tasks/init.yml +++ b/roles/matrix-bridge-mautrix-twitter/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-twitter.service'] }}" when: matrix_mautrix_twitter_enabled|bool diff --git a/roles/matrix-bridge-mautrix-twitter/tasks/main.yml b/roles/matrix-bridge-mautrix-twitter/tasks/main.yml index 60eea0995..6c0abe4f5 100644 --- a/roles/matrix-bridge-mautrix-twitter/tasks/main.yml +++ b/roles/matrix-bridge-mautrix-twitter/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mautrix-twitter/tasks/setup_install.yml b/roles/matrix-bridge-mautrix-twitter/tasks/setup_install.yml index c27eeccd3..86134d2b7 100644 --- a/roles/matrix-bridge-mautrix-twitter/tasks/setup_install.yml +++ b/roles/matrix-bridge-mautrix-twitter/tasks/setup_install.yml @@ -27,17 +27,17 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mautrix_twitter_base_path }}", when: true } - - { path: "{{ matrix_mautrix_twitter_config_path }}", when: true } - - { path: "{{ matrix_mautrix_twitter_data_path }}", when: true } - - { path: "{{ matrix_mautrix_twitter_docker_src_files_path }}", when: "{{ matrix_mautrix_twitter_container_image_self_build }}" } + - {path: "{{ matrix_mautrix_twitter_base_path }}", when: true} + - {path: "{{ matrix_mautrix_twitter_config_path }}", when: true} + - {path: "{{ matrix_mautrix_twitter_data_path }}", when: true} + - {path: "{{ matrix_mautrix_twitter_docker_src_files_path }}", when: "{{ matrix_mautrix_twitter_container_image_self_build }}"} when: item.when|bool - name: Ensure Mautrix Twitter repository is present on self-build git: repo: "{{ matrix_mautrix_twitter_container_image_self_build_repo }}" dest: "{{ matrix_mautrix_twitter_docker_src_files_path }}" -# version: "{{ matrix_coturn_docker_image.split(':')[1] }}" + # version: "{{ matrix_coturn_docker_image.split(':')[1] }}" force: "yes" register: matrix_mautrix_twitter_git_pull_results when: "matrix_mautrix_twitter_enabled|bool and matrix_mautrix_twitter_container_image_self_build" @@ -50,7 +50,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mautrix_twitter_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mautrix_twitter_enabled|bool and matrix_mautrix_twitter_container_image_self_build|bool" - name: Ensure mautrix-twitter config.yaml installed @@ -78,7 +78,7 @@ - name: Ensure systemd reloaded after matrix-mautrix-twitter.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_twitter_systemd_service_result.changed" - name: Ensure matrix-mautrix-twitter.service restarted, if necessary diff --git a/roles/matrix-bridge-mautrix-twitter/tasks/setup_uninstall.yml b/roles/matrix-bridge-mautrix-twitter/tasks/setup_uninstall.yml index 28819726e..024603e71 100644 --- a/roles/matrix-bridge-mautrix-twitter/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mautrix-twitter/tasks/setup_uninstall.yml @@ -9,7 +9,7 @@ service: name: matrix-mautrix-twitter state: stopped - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_twitter_service_stat.stat.exists" - name: Ensure matrix-mautrix-twitter.service doesn't exist @@ -20,5 +20,5 @@ - name: Ensure systemd reloaded after matrix-mautrix-twitter.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_twitter_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mautrix-whatsapp/defaults/main.yml b/roles/matrix-bridge-mautrix-whatsapp/defaults/main.yml index aaa1f04a2..adc30fc80 100644 --- a/roles/matrix-bridge-mautrix-whatsapp/defaults/main.yml +++ b/roles/matrix-bridge-mautrix-whatsapp/defaults/main.yml @@ -1,3 +1,4 @@ +--- # mautrix-whatsapp is a Matrix <-> Whatsapp bridge # See: https://github.com/mautrix/whatsapp @@ -77,7 +78,7 @@ matrix_mautrix_whatsapp_bridge_login_shared_secret_map: # Servers to always allow double puppeting from matrix_mautrix_whatsapp_bridge_double_puppet_server_map: - "{{ matrix_mautrix_whatsapp_homeserver_domain : matrix_mautrix_whatsapp_homeserver_address }}" + "{{ matrix_mautrix_whatsapp_homeserver_domain : matrix_mautrix_whatsapp_homeserver_address }}" # Default mautrix-whatsapp configuration template which covers the generic use case. # You can customize it by controlling the various variables inside it. diff --git a/roles/matrix-bridge-mautrix-whatsapp/tasks/init.yml b/roles/matrix-bridge-mautrix-whatsapp/tasks/init.yml index f320bc743..57166386b 100644 --- a/roles/matrix-bridge-mautrix-whatsapp/tasks/init.yml +++ b/roles/matrix-bridge-mautrix-whatsapp/tasks/init.yml @@ -1,3 +1,4 @@ +--- - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-whatsapp.service'] }}" when: matrix_mautrix_whatsapp_enabled|bool diff --git a/roles/matrix-bridge-mautrix-whatsapp/tasks/main.yml b/roles/matrix-bridge-mautrix-whatsapp/tasks/main.yml index 188eae4a1..0a963eb24 100644 --- a/roles/matrix-bridge-mautrix-whatsapp/tasks/main.yml +++ b/roles/matrix-bridge-mautrix-whatsapp/tasks/main.yml @@ -1,3 +1,4 @@ +--- - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml b/roles/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml index ddd49dd0d..d33524f37 100644 --- a/roles/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml +++ b/roles/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml @@ -44,10 +44,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mautrix_whatsapp_base_path }}", when: true } - - { path: "{{ matrix_mautrix_whatsapp_config_path }}", when: true } - - { path: "{{ matrix_mautrix_whatsapp_data_path }}", when: true } - - { path: "{{ matrix_mautrix_whatsapp_docker_src_files_path }}", when: "{{ matrix_mautrix_whatsapp_container_image_self_build }}" } + - {path: "{{ matrix_mautrix_whatsapp_base_path }}", when: true} + - {path: "{{ matrix_mautrix_whatsapp_config_path }}", when: true} + - {path: "{{ matrix_mautrix_whatsapp_data_path }}", when: true} + - {path: "{{ matrix_mautrix_whatsapp_docker_src_files_path }}", when: "{{ matrix_mautrix_whatsapp_container_image_self_build }}"} when: item.when|bool - name: Ensure Mautrix Whatsapp image is pulled @@ -76,7 +76,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mautrix_whatsapp_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mautrix_whatsapp_container_image_self_build|bool" - name: Check if an old database file exists @@ -93,8 +93,8 @@ service: name: matrix-mautrix-whatsapp state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true failed_when: false when: "matrix_mautrix_whatsapp_stat_database.stat.exists" @@ -131,7 +131,7 @@ - name: Ensure systemd reloaded after matrix-mautrix-whatsapp.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_whatsapp_systemd_service_result.changed" - name: Ensure matrix-mautrix-whatsapp.service restarted, if necessary diff --git a/roles/matrix-bridge-mautrix-whatsapp/tasks/setup_uninstall.yml b/roles/matrix-bridge-mautrix-whatsapp/tasks/setup_uninstall.yml index 7dd4b4028..3884f9e7e 100644 --- a/roles/matrix-bridge-mautrix-whatsapp/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mautrix-whatsapp/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-mautrix-whatsapp state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mautrix_whatsapp_service_stat.stat.exists" - name: Ensure matrix-mautrix-whatsapp.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-mautrix-whatsapp.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mautrix_whatsapp_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mautrix-whatsapp/tasks/validate_config.yml b/roles/matrix-bridge-mautrix-whatsapp/tasks/validate_config.yml index 483141908..c983c4cce 100644 --- a/roles/matrix-bridge-mautrix-whatsapp/tasks/validate_config.yml +++ b/roles/matrix-bridge-mautrix-whatsapp/tasks/validate_config.yml @@ -8,4 +8,3 @@ with_items: - "matrix_mautrix_whatsapp_appservice_token" - "matrix_mautrix_whatsapp_homeserver_token" - diff --git a/roles/matrix-bridge-mx-puppet-discord/defaults/main.yml b/roles/matrix-bridge-mx-puppet-discord/defaults/main.yml index 23d4ebf46..80734c256 100644 --- a/roles/matrix-bridge-mx-puppet-discord/defaults/main.yml +++ b/roles/matrix-bridge-mx-puppet-discord/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Mx Puppet Discord is a Matrix <-> Discord bridge # See: https://github.com/matrix-discord/mx-puppet-discord diff --git a/roles/matrix-bridge-mx-puppet-discord/tasks/init.yml b/roles/matrix-bridge-mx-puppet-discord/tasks/init.yml index 6fa430373..69458093d 100644 --- a/roles/matrix-bridge-mx-puppet-discord/tasks/init.yml +++ b/roles/matrix-bridge-mx-puppet-discord/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-bridge-mx-puppet-discord/tasks/main.yml b/roles/matrix-bridge-mx-puppet-discord/tasks/main.yml index 3ca32335c..e11a2db04 100644 --- a/roles/matrix-bridge-mx-puppet-discord/tasks/main.yml +++ b/roles/matrix-bridge-mx-puppet-discord/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml b/roles/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml index f9985ed83..3ef57cb74 100644 --- a/roles/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml +++ b/roles/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml @@ -16,10 +16,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mx_puppet_discord_base_path }}", when: true } - - { path: "{{ matrix_mx_puppet_discord_config_path }}", when: true } - - { path: "{{ matrix_mx_puppet_discord_data_path }}", when: true } - - { path: "{{ matrix_mx_puppet_discord_docker_src_files_path }}", when: "{{ matrix_mx_puppet_discord_container_image_self_build }}" } + - {path: "{{ matrix_mx_puppet_discord_base_path }}", when: true} + - {path: "{{ matrix_mx_puppet_discord_config_path }}", when: true} + - {path: "{{ matrix_mx_puppet_discord_data_path }}", when: true} + - {path: "{{ matrix_mx_puppet_discord_docker_src_files_path }}", when: "{{ matrix_mx_puppet_discord_container_image_self_build }}"} when: matrix_mx_puppet_discord_enabled|bool and item.when|bool - name: Check if an old database file already exists @@ -32,8 +32,8 @@ service: name: matrix-mx-puppet-discord state: stopped - daemon_reload: yes - failed_when: False + daemon_reload: true + failed_when: false - name: (Data relocation) Move mx-puppet-discord database file to ./data directory command: "mv {{ matrix_mx_puppet_discord_base_path }}/database.db {{ matrix_mx_puppet_discord_data_path }}/database.db" @@ -90,7 +90,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mx_puppet_discord_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mx_puppet_discord_enabled|bool and matrix_mx_puppet_discord_container_image_self_build|bool" - name: Ensure mx-puppet-discord config.yaml installed @@ -118,7 +118,7 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-discord.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_discord_systemd_service_result.changed" - name: Ensure matrix-mx-puppet-discord.service restarted, if necessary diff --git a/roles/matrix-bridge-mx-puppet-discord/tasks/setup_uninstall.yml b/roles/matrix-bridge-mx-puppet-discord/tasks/setup_uninstall.yml index a0298ad9f..b3ab8e39e 100644 --- a/roles/matrix-bridge-mx-puppet-discord/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mx-puppet-discord/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-mx-puppet-discord state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mx_puppet_discord_service_stat.stat.exists" - name: Ensure matrix-mx-puppet-discord.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-discord.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_discord_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mx-puppet-groupme/defaults/main.yml b/roles/matrix-bridge-mx-puppet-groupme/defaults/main.yml index 8b3826059..0daf6dfc7 100644 --- a/roles/matrix-bridge-mx-puppet-groupme/defaults/main.yml +++ b/roles/matrix-bridge-mx-puppet-groupme/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Mx Puppet GroupMe is a Matrix <-> GroupMe bridge # See: https://gitlab.com/robintown/mx-puppet-groupme diff --git a/roles/matrix-bridge-mx-puppet-groupme/tasks/init.yml b/roles/matrix-bridge-mx-puppet-groupme/tasks/init.yml index b4469ea18..db28f324c 100644 --- a/roles/matrix-bridge-mx-puppet-groupme/tasks/init.yml +++ b/roles/matrix-bridge-mx-puppet-groupme/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-bridge-mx-puppet-groupme/tasks/main.yml b/roles/matrix-bridge-mx-puppet-groupme/tasks/main.yml index 994e7e454..070f920b5 100644 --- a/roles/matrix-bridge-mx-puppet-groupme/tasks/main.yml +++ b/roles/matrix-bridge-mx-puppet-groupme/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml b/roles/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml index 3ed4867c5..84802c4fe 100644 --- a/roles/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml +++ b/roles/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml @@ -16,10 +16,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mx_puppet_groupme_base_path }}", when: true } - - { path: "{{ matrix_mx_puppet_groupme_config_path }}", when: true } - - { path: "{{ matrix_mx_puppet_groupme_data_path }}", when: true } - - { path: "{{ matrix_mx_puppet_groupme_docker_src_files_path }}", when: "{{ matrix_mx_puppet_groupme_container_image_self_build }}" } + - {path: "{{ matrix_mx_puppet_groupme_base_path }}", when: true} + - {path: "{{ matrix_mx_puppet_groupme_config_path }}", when: true} + - {path: "{{ matrix_mx_puppet_groupme_data_path }}", when: true} + - {path: "{{ matrix_mx_puppet_groupme_docker_src_files_path }}", when: "{{ matrix_mx_puppet_groupme_container_image_self_build }}"} when: matrix_mx_puppet_groupme_enabled|bool and item.when|bool - name: Check if an old database file already exists @@ -31,8 +31,8 @@ service: name: matrix-mx-puppet-groupme state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true failed_when: false when: "matrix_mx_puppet_groupme_stat_database.stat.exists" @@ -91,7 +91,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mx_puppet_groupme_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mx_puppet_groupme_enabled|bool and matrix_mx_puppet_groupme_container_image_self_build" - name: Ensure mx-puppet-groupme config.yaml installed @@ -119,7 +119,7 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-groupme.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_groupme_systemd_service_result.changed" - name: Ensure matrix-mx-puppet-groupme.service restarted, if necessary diff --git a/roles/matrix-bridge-mx-puppet-groupme/tasks/setup_uninstall.yml b/roles/matrix-bridge-mx-puppet-groupme/tasks/setup_uninstall.yml index f9ecce58b..24daf7be8 100644 --- a/roles/matrix-bridge-mx-puppet-groupme/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mx-puppet-groupme/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-mx-puppet-groupme state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mx_puppet_groupme_service_stat.stat.exists" - name: Ensure matrix-mx-puppet-groupme.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-groupme.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_groupme_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mx-puppet-instagram/defaults/main.yml b/roles/matrix-bridge-mx-puppet-instagram/defaults/main.yml index 272103604..3a73e0fed 100644 --- a/roles/matrix-bridge-mx-puppet-instagram/defaults/main.yml +++ b/roles/matrix-bridge-mx-puppet-instagram/defaults/main.yml @@ -1,3 +1,4 @@ +--- # mx-puppet-instagram bridges instagram DMs # See: https://github.com/Sorunome/mx-puppet-instagram diff --git a/roles/matrix-bridge-mx-puppet-instagram/tasks/init.yml b/roles/matrix-bridge-mx-puppet-instagram/tasks/init.yml index a12885e78..d16e6be0f 100644 --- a/roles/matrix-bridge-mx-puppet-instagram/tasks/init.yml +++ b/roles/matrix-bridge-mx-puppet-instagram/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 @@ -21,4 +22,3 @@ + {{ ["/matrix-mx-puppet-instagram-registration.yaml"] }} when: matrix_mx_puppet_instagram_enabled|bool - diff --git a/roles/matrix-bridge-mx-puppet-instagram/tasks/main.yml b/roles/matrix-bridge-mx-puppet-instagram/tasks/main.yml index d0fe90e4b..6abb281fc 100644 --- a/roles/matrix-bridge-mx-puppet-instagram/tasks/main.yml +++ b/roles/matrix-bridge-mx-puppet-instagram/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mx-puppet-instagram/tasks/setup_install.yml b/roles/matrix-bridge-mx-puppet-instagram/tasks/setup_install.yml index cdbaa18e8..63f1878b7 100644 --- a/roles/matrix-bridge-mx-puppet-instagram/tasks/setup_install.yml +++ b/roles/matrix-bridge-mx-puppet-instagram/tasks/setup_install.yml @@ -51,10 +51,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mx_puppet_instagram_base_path }}", when: true } - - { path: "{{ matrix_mx_puppet_instagram_config_path }}", when: true } - - { path: "{{ matrix_mx_puppet_instagram_data_path }}", when: true } - - { path: "{{ matrix_mx_puppet_instagram_docker_src_files_path }}", when: "{{ matrix_mx_puppet_instagram_container_image_self_build }}" } + - {path: "{{ matrix_mx_puppet_instagram_base_path }}", when: true} + - {path: "{{ matrix_mx_puppet_instagram_config_path }}", when: true} + - {path: "{{ matrix_mx_puppet_instagram_data_path }}", when: true} + - {path: "{{ matrix_mx_puppet_instagram_docker_src_files_path }}", when: "{{ matrix_mx_puppet_instagram_container_image_self_build }}"} when: matrix_mx_puppet_instagram_enabled|bool and item.when|bool - name: Ensure mx-puppet-instagram repository is present on self build @@ -74,7 +74,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mx_puppet_instagram_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mx_puppet_instagram_enabled|bool and matrix_mx_puppet_instagram_container_image_self_build|bool" - name: Ensure mx-puppet-instagram config.yaml installed @@ -102,7 +102,7 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-instagram.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_instagram_systemd_service_result.changed" - name: Ensure matrix-mx-puppet-instagram.service restarted, if necessary diff --git a/roles/matrix-bridge-mx-puppet-instagram/tasks/setup_uninstall.yml b/roles/matrix-bridge-mx-puppet-instagram/tasks/setup_uninstall.yml index 9ad4e13d9..e4435a3e8 100644 --- a/roles/matrix-bridge-mx-puppet-instagram/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mx-puppet-instagram/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-mx-puppet-instagram state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mx_puppet_instagram_service_stat.stat.exists" - name: Ensure matrix-mx-puppet-instagram.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-instagram.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_instagram_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mx-puppet-skype/defaults/main.yml b/roles/matrix-bridge-mx-puppet-skype/defaults/main.yml index 8dcb2faff..905e50863 100644 --- a/roles/matrix-bridge-mx-puppet-skype/defaults/main.yml +++ b/roles/matrix-bridge-mx-puppet-skype/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Mx Puppet Skype is a Matrix <-> Skype bridge # See: https://github.com/Sorunome/mx-puppet-skype diff --git a/roles/matrix-bridge-mx-puppet-skype/tasks/init.yml b/roles/matrix-bridge-mx-puppet-skype/tasks/init.yml index 5618821b5..d28f6ca1a 100644 --- a/roles/matrix-bridge-mx-puppet-skype/tasks/init.yml +++ b/roles/matrix-bridge-mx-puppet-skype/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-bridge-mx-puppet-skype/tasks/main.yml b/roles/matrix-bridge-mx-puppet-skype/tasks/main.yml index 01ddd7d87..0793e994b 100644 --- a/roles/matrix-bridge-mx-puppet-skype/tasks/main.yml +++ b/roles/matrix-bridge-mx-puppet-skype/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mx-puppet-skype/tasks/setup_install.yml b/roles/matrix-bridge-mx-puppet-skype/tasks/setup_install.yml index a39e7acf2..285735336 100644 --- a/roles/matrix-bridge-mx-puppet-skype/tasks/setup_install.yml +++ b/roles/matrix-bridge-mx-puppet-skype/tasks/setup_install.yml @@ -16,10 +16,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mx_puppet_skype_base_path }}", when: true } - - { path: "{{ matrix_mx_puppet_skype_config_path }}", when: true } - - { path: "{{ matrix_mx_puppet_skype_data_path }}", when: true } - - { path: "{{ matrix_mx_puppet_skype_docker_src_files_path }}", when: "{{ matrix_mx_puppet_skype_container_image_self_build }}" } + - {path: "{{ matrix_mx_puppet_skype_base_path }}", when: true} + - {path: "{{ matrix_mx_puppet_skype_config_path }}", when: true} + - {path: "{{ matrix_mx_puppet_skype_data_path }}", when: true} + - {path: "{{ matrix_mx_puppet_skype_docker_src_files_path }}", when: "{{ matrix_mx_puppet_skype_container_image_self_build }}"} when: matrix_mx_puppet_skype_enabled|bool and item.when|bool - name: Check if an old database file already exists @@ -31,8 +31,8 @@ service: name: matrix-mx-puppet-skype state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true failed_when: false when: "matrix_mx_puppet_skype_stat_database.stat.exists" @@ -91,7 +91,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mx_puppet_skype_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mx_puppet_skype_enabled|bool and matrix_mx_puppet_skype_container_image_self_build|bool" - name: Ensure mx-puppet-skype config.yaml installed @@ -119,7 +119,7 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-skype.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_skype_systemd_service_result.changed" - name: Ensure matrix-mx-puppet-skype.service restarted, if necessary diff --git a/roles/matrix-bridge-mx-puppet-skype/tasks/setup_uninstall.yml b/roles/matrix-bridge-mx-puppet-skype/tasks/setup_uninstall.yml index a1af7e337..838c3be5f 100644 --- a/roles/matrix-bridge-mx-puppet-skype/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mx-puppet-skype/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-mx-puppet-skype state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mx_puppet_skype_service_stat.stat.exists" - name: Ensure matrix-mx-puppet-skype.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-skype.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_skype_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mx-puppet-slack/defaults/main.yml b/roles/matrix-bridge-mx-puppet-slack/defaults/main.yml index 4b8af36a6..bf5c6dfae 100644 --- a/roles/matrix-bridge-mx-puppet-slack/defaults/main.yml +++ b/roles/matrix-bridge-mx-puppet-slack/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Mx Puppet Slack is a Matrix <-> Slack bridge # See: https://github.com/Sorunome/mx-puppet-slack diff --git a/roles/matrix-bridge-mx-puppet-slack/tasks/init.yml b/roles/matrix-bridge-mx-puppet-slack/tasks/init.yml index 74ec03502..897f3f8fe 100644 --- a/roles/matrix-bridge-mx-puppet-slack/tasks/init.yml +++ b/roles/matrix-bridge-mx-puppet-slack/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 @@ -23,40 +24,40 @@ when: matrix_mx_puppet_slack_enabled|bool - block: - - name: Fail if matrix-nginx-proxy role already executed - fail: - msg: >- - Trying to append Slack Appservice's reverse-proxying configuration to matrix-nginx-proxy, - 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-mx-puppet-slack role. - when: matrix_nginx_proxy_role_executed|default(False)|bool + - name: Fail if matrix-nginx-proxy role already executed + fail: + msg: >- + Trying to append Slack Appservice's reverse-proxying configuration to matrix-nginx-proxy, + 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-mx-puppet-slack role. + when: matrix_nginx_proxy_role_executed|default(False)|bool - - name: Generate Matrix MX Puppet Slack proxying configuration for matrix-nginx-proxy - set_fact: - matrix_mx_puppet_slack_matrix_nginx_proxy_configuration: | - location {{ matrix_mx_puppet_slack_redirect_path }} { - {% 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_mx_puppet_slack_appservice_address }}"; - proxy_pass $backend; - {% else %} - {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:{{ matrix_mx_puppet_slack_appservice_port }}; - {% endif %} - } + - name: Generate Matrix MX Puppet Slack proxying configuration for matrix-nginx-proxy + set_fact: + matrix_mx_puppet_slack_matrix_nginx_proxy_configuration: | + location {{ matrix_mx_puppet_slack_redirect_path }} { + {% 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_mx_puppet_slack_appservice_address }}"; + proxy_pass $backend; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://127.0.0.1:{{ matrix_mx_puppet_slack_appservice_port }}; + {% endif %} + } - - name: Register Slack Appservice proxying configuration with matrix-nginx-proxy - set_fact: - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | - {{ - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) - + - [matrix_mx_puppet_slack_matrix_nginx_proxy_configuration] - }} + - name: Register Slack Appservice proxying configuration with matrix-nginx-proxy + set_fact: + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | + {{ + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) + + + [matrix_mx_puppet_slack_matrix_nginx_proxy_configuration] + }} tags: - - always + - always when: matrix_mx_puppet_slack_enabled|bool - name: Warn about reverse-proxying if matrix-nginx-proxy not used diff --git a/roles/matrix-bridge-mx-puppet-slack/tasks/main.yml b/roles/matrix-bridge-mx-puppet-slack/tasks/main.yml index 6aa0fd0fd..0e886d452 100644 --- a/roles/matrix-bridge-mx-puppet-slack/tasks/main.yml +++ b/roles/matrix-bridge-mx-puppet-slack/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mx-puppet-slack/tasks/setup_install.yml b/roles/matrix-bridge-mx-puppet-slack/tasks/setup_install.yml index 8ef8ac4e9..eca29e9b2 100644 --- a/roles/matrix-bridge-mx-puppet-slack/tasks/setup_install.yml +++ b/roles/matrix-bridge-mx-puppet-slack/tasks/setup_install.yml @@ -16,10 +16,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mx_puppet_slack_base_path }}", when: true } - - { path: "{{ matrix_mx_puppet_slack_config_path }}", when: true } - - { path: "{{ matrix_mx_puppet_slack_data_path }}", when: true } - - { path: "{{ matrix_mx_puppet_slack_docker_src_files_path }}", when: "{{ matrix_mx_puppet_slack_container_image_self_build }}" } + - {path: "{{ matrix_mx_puppet_slack_base_path }}", when: true} + - {path: "{{ matrix_mx_puppet_slack_config_path }}", when: true} + - {path: "{{ matrix_mx_puppet_slack_data_path }}", when: true} + - {path: "{{ matrix_mx_puppet_slack_docker_src_files_path }}", when: "{{ matrix_mx_puppet_slack_container_image_self_build }}"} when: matrix_mx_puppet_slack_enabled|bool and item.when|bool - name: Check if an old database file already exists @@ -31,8 +31,8 @@ service: name: matrix-mx-puppet-slack state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true failed_when: false when: "matrix_mx_puppet_slack_stat_database.stat.exists" @@ -87,7 +87,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mx_puppet_slack_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mx_puppet_slack_enabled|bool and matrix_mx_puppet_slack_container_image_self_build" - name: (Data relocation) Move mx-puppet-slack database file to ./data directory @@ -119,7 +119,7 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-slack.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_slack_systemd_service_result.changed" - name: Ensure matrix-mx-puppet-slack.service restarted, if necessary diff --git a/roles/matrix-bridge-mx-puppet-slack/tasks/setup_uninstall.yml b/roles/matrix-bridge-mx-puppet-slack/tasks/setup_uninstall.yml index f6e7d33ed..3a119267e 100644 --- a/roles/matrix-bridge-mx-puppet-slack/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mx-puppet-slack/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-mx-puppet-slack state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mx_puppet_slack_service_stat.stat.exists" - name: Ensure matrix-mx-puppet-slack.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-slack.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_slack_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mx-puppet-steam/defaults/main.yml b/roles/matrix-bridge-mx-puppet-steam/defaults/main.yml index 2af4a32af..91675fce6 100644 --- a/roles/matrix-bridge-mx-puppet-steam/defaults/main.yml +++ b/roles/matrix-bridge-mx-puppet-steam/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Mx Puppet Steam is a Matrix <-> Steam bridge # See: https://github.com/matrix-steam/mx-puppet-steam diff --git a/roles/matrix-bridge-mx-puppet-steam/tasks/init.yml b/roles/matrix-bridge-mx-puppet-steam/tasks/init.yml index c3218e894..efca41103 100644 --- a/roles/matrix-bridge-mx-puppet-steam/tasks/init.yml +++ b/roles/matrix-bridge-mx-puppet-steam/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-bridge-mx-puppet-steam/tasks/main.yml b/roles/matrix-bridge-mx-puppet-steam/tasks/main.yml index cd6bb1477..733cfa909 100644 --- a/roles/matrix-bridge-mx-puppet-steam/tasks/main.yml +++ b/roles/matrix-bridge-mx-puppet-steam/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml b/roles/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml index a92d63fb4..a1786ba99 100644 --- a/roles/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml +++ b/roles/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml @@ -16,10 +16,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mx_puppet_steam_base_path }}", when: true } - - { path: "{{ matrix_mx_puppet_steam_config_path }}", when: true } - - { path: "{{ matrix_mx_puppet_steam_data_path }}", when: true } - - { path: "{{ matrix_mx_puppet_steam_docker_src_files_path }}", when: "{{ matrix_mx_puppet_steam_container_image_self_build }}" } + - {path: "{{ matrix_mx_puppet_steam_base_path }}", when: true} + - {path: "{{ matrix_mx_puppet_steam_config_path }}", when: true} + - {path: "{{ matrix_mx_puppet_steam_data_path }}", when: true} + - {path: "{{ matrix_mx_puppet_steam_docker_src_files_path }}", when: "{{ matrix_mx_puppet_steam_container_image_self_build }}"} when: matrix_mx_puppet_steam_enabled|bool and item.when|bool - name: Check if an old database file already exists @@ -31,8 +31,8 @@ service: name: matrix-mx-puppet-steam state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true failed_when: false when: "matrix_mx_puppet_steam_stat_database.stat.exists" @@ -91,7 +91,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mx_puppet_steam_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mx_puppet_steam_enabled|bool and matrix_mx_puppet_steam_container_image_self_build" - name: Ensure mx-puppet-steam config.yaml installed @@ -119,7 +119,7 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-steam.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_steam_systemd_service_result.changed" - name: Ensure matrix-mx-puppet-steam.service restarted, if necessary diff --git a/roles/matrix-bridge-mx-puppet-steam/tasks/setup_uninstall.yml b/roles/matrix-bridge-mx-puppet-steam/tasks/setup_uninstall.yml index 608bde73b..2e152ef67 100644 --- a/roles/matrix-bridge-mx-puppet-steam/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mx-puppet-steam/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-mx-puppet-steam state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mx_puppet_steam_service_stat.stat.exists" - name: Ensure matrix-mx-puppet-steam.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-steam.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_steam_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mx-puppet-twitter/defaults/main.yml b/roles/matrix-bridge-mx-puppet-twitter/defaults/main.yml index 0e37d51f5..37be2be28 100644 --- a/roles/matrix-bridge-mx-puppet-twitter/defaults/main.yml +++ b/roles/matrix-bridge-mx-puppet-twitter/defaults/main.yml @@ -1,3 +1,5 @@ +--- + # Mx Puppet Twitter is a Matrix <-> Twitter bridge # See: https://github.com/Sorunome/mx-puppet-twitter diff --git a/roles/matrix-bridge-mx-puppet-twitter/tasks/init.yml b/roles/matrix-bridge-mx-puppet-twitter/tasks/init.yml index 2054d23c5..9d868bfea 100644 --- a/roles/matrix-bridge-mx-puppet-twitter/tasks/init.yml +++ b/roles/matrix-bridge-mx-puppet-twitter/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 @@ -23,40 +24,40 @@ when: matrix_mx_puppet_twitter_enabled|bool - block: - - name: Fail if matrix-nginx-proxy role already executed - fail: - msg: >- - Trying to append Twitter Appservice's reverse-proxying configuration to matrix-nginx-proxy, - 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-mx-puppet-twitter role. - when: matrix_nginx_proxy_role_executed|default(False)|bool + - name: Fail if matrix-nginx-proxy role already executed + fail: + msg: >- + Trying to append Twitter Appservice's reverse-proxying configuration to matrix-nginx-proxy, + 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-mx-puppet-twitter role. + when: matrix_nginx_proxy_role_executed|default(False)|bool - - name: Generate Matrix MX Puppet Twitter proxying configuration for matrix-nginx-proxy - set_fact: - matrix_mx_puppet_twitter_matrix_nginx_proxy_configuration: | - location {{ matrix_mx_puppet_twitter_webhook_path }} { - {% 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_mx_puppet_twitter_appservice_address }}"; - proxy_pass $backend; - {% else %} - {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:{{ matrix_mx_puppet_twitter_appservice_port }}; - {% endif %} - } + - name: Generate Matrix MX Puppet Twitter proxying configuration for matrix-nginx-proxy + set_fact: + matrix_mx_puppet_twitter_matrix_nginx_proxy_configuration: | + location {{ matrix_mx_puppet_twitter_webhook_path }} { + {% 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_mx_puppet_twitter_appservice_address }}"; + proxy_pass $backend; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://127.0.0.1:{{ matrix_mx_puppet_twitter_appservice_port }}; + {% endif %} + } - - name: Register Twitter Appservice proxying configuration with matrix-nginx-proxy - set_fact: - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | - {{ - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) - + - [matrix_mx_puppet_twitter_matrix_nginx_proxy_configuration] - }} + - name: Register Twitter Appservice proxying configuration with matrix-nginx-proxy + set_fact: + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | + {{ + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) + + + [matrix_mx_puppet_twitter_matrix_nginx_proxy_configuration] + }} tags: - - always + - always when: matrix_mx_puppet_twitter_enabled|bool - name: Warn about reverse-proxying if matrix-nginx-proxy not used diff --git a/roles/matrix-bridge-mx-puppet-twitter/tasks/main.yml b/roles/matrix-bridge-mx-puppet-twitter/tasks/main.yml index af355df36..7d65257c9 100644 --- a/roles/matrix-bridge-mx-puppet-twitter/tasks/main.yml +++ b/roles/matrix-bridge-mx-puppet-twitter/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-mx-puppet-twitter/tasks/setup_install.yml b/roles/matrix-bridge-mx-puppet-twitter/tasks/setup_install.yml index a6250a16f..8ca4f3f1e 100644 --- a/roles/matrix-bridge-mx-puppet-twitter/tasks/setup_install.yml +++ b/roles/matrix-bridge-mx-puppet-twitter/tasks/setup_install.yml @@ -16,10 +16,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mx_puppet_twitter_base_path }}", when: true } - - { path: "{{ matrix_mx_puppet_twitter_config_path }}", when: true } - - { path: "{{ matrix_mx_puppet_twitter_data_path }}", when: true } - - { path: "{{ matrix_mx_puppet_twitter_docker_src_files_path }}", when: "{{ matrix_mx_puppet_twitter_container_image_self_build }}" } + - {path: "{{ matrix_mx_puppet_twitter_base_path }}", when: true} + - {path: "{{ matrix_mx_puppet_twitter_config_path }}", when: true} + - {path: "{{ matrix_mx_puppet_twitter_data_path }}", when: true} + - {path: "{{ matrix_mx_puppet_twitter_docker_src_files_path }}", when: "{{ matrix_mx_puppet_twitter_container_image_self_build }}"} when: matrix_mx_puppet_twitter_enabled|bool and item.when|bool - name: Check if an old database file already exists @@ -31,8 +31,8 @@ service: name: matrix-mx-puppet-twitter state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true failed_when: false when: "matrix_mx_puppet_twitter_stat_database.stat.exists" @@ -91,7 +91,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mx_puppet_twitter_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_mx_puppet_twitter_enabled|bool and matrix_mx_puppet_twitter_container_image_self_build" - name: Ensure mx-puppet-twitter config.yaml installed @@ -119,7 +119,7 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-twitter.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_twitter_systemd_service_result.changed" - name: Ensure matrix-mx-puppet-twitter.service restarted, if necessary diff --git a/roles/matrix-bridge-mx-puppet-twitter/tasks/setup_uninstall.yml b/roles/matrix-bridge-mx-puppet-twitter/tasks/setup_uninstall.yml index 1382ee58c..56dcd9ce0 100644 --- a/roles/matrix-bridge-mx-puppet-twitter/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-mx-puppet-twitter/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-mx-puppet-twitter state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mx_puppet_twitter_service_stat.stat.exists" - name: Ensure matrix-mx-puppet-twitter.service doesn't exist @@ -21,5 +21,5 @@ - name: Ensure systemd reloaded after matrix-mx-puppet-twitter.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_mx_puppet_twitter_service_stat.stat.exists" diff --git a/roles/matrix-bridge-sms/defaults/main.yml b/roles/matrix-bridge-sms/defaults/main.yml index d3a686cef..82ffce6eb 100644 --- a/roles/matrix-bridge-sms/defaults/main.yml +++ b/roles/matrix-bridge-sms/defaults/main.yml @@ -1,3 +1,4 @@ +--- # matrix-sms-bridge is a Matrix <-> SMS bridge # See: https://github.com/benkuly/matrix-sms-bridge diff --git a/roles/matrix-bridge-sms/tasks/init.yml b/roles/matrix-bridge-sms/tasks/init.yml index 5979d1329..b8af8e604 100644 --- a/roles/matrix-bridge-sms/tasks/init.yml +++ b/roles/matrix-bridge-sms/tasks/init.yml @@ -1,3 +1,5 @@ +--- + # If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist. # We don't want to fail in such cases. - name: Fail if matrix-synapse role already executed diff --git a/roles/matrix-bridge-sms/tasks/main.yml b/roles/matrix-bridge-sms/tasks/main.yml index c1c499dee..b06e1a548 100644 --- a/roles/matrix-bridge-sms/tasks/main.yml +++ b/roles/matrix-bridge-sms/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-bridge-sms/tasks/setup_install.yml b/roles/matrix-bridge-sms/tasks/setup_install.yml index 61de923fb..1f2960431 100644 --- a/roles/matrix-bridge-sms/tasks/setup_install.yml +++ b/roles/matrix-bridge-sms/tasks/setup_install.yml @@ -51,5 +51,5 @@ - name: Ensure systemd reloaded after matrix-sms-bridge.service installation service: - daemon_reload: yes - when: matrix_sms_bridge_systemd_service_result.changed \ No newline at end of file + daemon_reload: true + when: matrix_sms_bridge_systemd_service_result.changed diff --git a/roles/matrix-bridge-sms/tasks/setup_uninstall.yml b/roles/matrix-bridge-sms/tasks/setup_uninstall.yml index ad8442bc3..d74476ebe 100644 --- a/roles/matrix-bridge-sms/tasks/setup_uninstall.yml +++ b/roles/matrix-bridge-sms/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-sms-bridge state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_sms_bridge_service_stat.stat.exists" - name: Ensure matrix-sms-bridge.service doesn't exist diff --git a/roles/matrix-bridge-sms/tasks/validate_config.yml b/roles/matrix-bridge-sms/tasks/validate_config.yml index f89b18faa..96e41755b 100644 --- a/roles/matrix-bridge-sms/tasks/validate_config.yml +++ b/roles/matrix-bridge-sms/tasks/validate_config.yml @@ -13,4 +13,4 @@ - "matrix_sms_bridge_default_timezone" - "matrix_sms_bridge_provider_android_baseurl" - "matrix_sms_bridge_provider_android_username" - - "matrix_sms_bridge_provider_android_password" \ No newline at end of file + - "matrix_sms_bridge_provider_android_password" diff --git a/roles/matrix-client-cinny/defaults/main.yml b/roles/matrix-client-cinny/defaults/main.yml index 153139503..1cb9b26f9 100644 --- a/roles/matrix-client-cinny/defaults/main.yml +++ b/roles/matrix-client-cinny/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_client_cinny_enabled: true matrix_client_cinny_container_image_self_build: false diff --git a/roles/matrix-client-cinny/tasks/init.yml b/roles/matrix-client-cinny/tasks/init.yml index e6889e4d6..04fbd8a20 100644 --- a/roles/matrix-client-cinny/tasks/init.yml +++ b/roles/matrix-client-cinny/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-client-cinny/tasks/main.yml b/roles/matrix-client-cinny/tasks/main.yml index 8a39c0217..5c37d38e5 100644 --- a/roles/matrix-client-cinny/tasks/main.yml +++ b/roles/matrix-client-cinny/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-client-cinny/tasks/self_check.yml b/roles/matrix-client-cinny/tasks/self_check.yml index df1241a8a..d00408da9 100644 --- a/roles/matrix-client-cinny/tasks/self_check.yml +++ b/roles/matrix-client-cinny/tasks/self_check.yml @@ -9,7 +9,7 @@ follow_redirects: none validate_certs: "{{ matrix_client_cinny_self_check_validate_certificates }}" register: matrix_client_cinny_self_check_result - check_mode: no + check_mode: false ignore_errors: true - name: Fail if Cinny not working diff --git a/roles/matrix-client-cinny/tasks/setup_install.yml b/roles/matrix-client-cinny/tasks/setup_install.yml index 5d92f1d39..5571d8d0d 100644 --- a/roles/matrix-client-cinny/tasks/setup_install.yml +++ b/roles/matrix-client-cinny/tasks/setup_install.yml @@ -7,16 +7,16 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_client_cinny_data_path }}", when: true } - - { path: "{{ matrix_client_cinny_docker_src_files_path }}", when: "{{ matrix_client_cinny_container_image_self_build }}" } + - {path: "{{ matrix_client_cinny_data_path }}", when: true} + - {path: "{{ matrix_client_cinny_docker_src_files_path }}", when: "{{ matrix_client_cinny_container_image_self_build }}"} when: "item.when|bool" - name: Ensure Cinny Docker image is pulled docker_image: - name: "{{ matrix_client_cinny_docker_image }}" - source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" - force_source: "{{ matrix_client_cinny_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" - force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_client_cinny_docker_image_force_pull }}" + name: "{{ matrix_client_cinny_docker_image }}" + source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" + force_source: "{{ matrix_client_cinny_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" + force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_client_cinny_docker_image_force_pull }}" when: "not matrix_client_cinny_container_image_self_build|bool" - name: Ensure Cinny repository is present on self-build @@ -55,7 +55,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_client_cinny_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_client_cinny_container_image_self_build|bool" - name: Ensure matrix-client-cinny.service installed @@ -67,5 +67,5 @@ - name: Ensure systemd reloaded after matrix-client-cinny.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_client_cinny_systemd_service_result.changed|bool" diff --git a/roles/matrix-client-cinny/tasks/setup_uninstall.yml b/roles/matrix-client-cinny/tasks/setup_uninstall.yml index 2a3bffb5d..507c5d70e 100644 --- a/roles/matrix-client-cinny/tasks/setup_uninstall.yml +++ b/roles/matrix-client-cinny/tasks/setup_uninstall.yml @@ -8,8 +8,8 @@ service: name: matrix-client-cinny state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_client_cinny_service_stat.stat.exists|bool" @@ -21,7 +21,7 @@ - name: Ensure systemd reloaded after matrix-client-cinny.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_client_cinny_service_stat.stat.exists|bool" - name: Ensure Cinny paths doesn't exist diff --git a/roles/matrix-client-element/defaults/main.yml b/roles/matrix-client-element/defaults/main.yml index 542821a4a..d5ada7ee7 100644 --- a/roles/matrix-client-element/defaults/main.yml +++ b/roles/matrix-client-element/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_client_element_enabled: true matrix_client_element_container_image_self_build: false diff --git a/roles/matrix-client-element/tasks/init.yml b/roles/matrix-client-element/tasks/init.yml index 44fa15440..cb1df0b52 100644 --- a/roles/matrix-client-element/tasks/init.yml +++ b/roles/matrix-client-element/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-client-element.service'] }}" when: matrix_client_element_enabled|bool diff --git a/roles/matrix-client-element/tasks/main.yml b/roles/matrix-client-element/tasks/main.yml index f020382ad..28e23e8a5 100644 --- a/roles/matrix-client-element/tasks/main.yml +++ b/roles/matrix-client-element/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-client-element/tasks/migrate_riot_web.yml b/roles/matrix-client-element/tasks/migrate_riot_web.yml index 304e9fbf9..ee0fd4460 100644 --- a/roles/matrix-client-element/tasks/migrate_riot_web.yml +++ b/roles/matrix-client-element/tasks/migrate_riot_web.yml @@ -10,8 +10,8 @@ service: name: matrix-riot-web state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_client_element_enabled|bool and matrix_client_riot_web_service_stat.stat.exists" @@ -23,7 +23,7 @@ - name: Ensure systemd reloaded after matrix-riot-web.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_client_element_enabled|bool and matrix_client_riot_web_service_stat.stat.exists" - name: Check existence of /matrix/riot-web diff --git a/roles/matrix-client-element/tasks/prepare_themes.yml b/roles/matrix-client-element/tasks/prepare_themes.yml index 1453e37d1..bfb9837bc 100644 --- a/roles/matrix-client-element/tasks/prepare_themes.yml +++ b/roles/matrix-client-element/tasks/prepare_themes.yml @@ -25,7 +25,7 @@ - name: Load Element theme set_fact: - matrix_client_element_settingDefaults_custom_themes: "{{ matrix_client_element_settingDefaults_custom_themes + [item['content'] | b64decode | from_json] }}" + matrix_client_element_settingDefaults_custom_themes: "{{ matrix_client_element_settingDefaults_custom_themes + [item['content'] | b64decode | from_json] }}" with_items: "{{ matrix_client_element_theme_file_contents.results }}" run_once: true diff --git a/roles/matrix-client-element/tasks/self_check.yml b/roles/matrix-client-element/tasks/self_check.yml index 34b6b88b4..d05644c80 100644 --- a/roles/matrix-client-element/tasks/self_check.yml +++ b/roles/matrix-client-element/tasks/self_check.yml @@ -9,7 +9,7 @@ follow_redirects: none validate_certs: "{{ matrix_client_element_self_check_validate_certificates }}" register: matrix_client_element_self_check_result - check_mode: no + check_mode: false ignore_errors: true - name: Fail if Element not working diff --git a/roles/matrix-client-element/tasks/setup_install.yml b/roles/matrix-client-element/tasks/setup_install.yml index b14a0dd55..3b877e8eb 100644 --- a/roles/matrix-client-element/tasks/setup_install.yml +++ b/roles/matrix-client-element/tasks/setup_install.yml @@ -8,8 +8,8 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_client_element_data_path }}", when: true } - - { path: "{{ matrix_client_element_docker_src_files_path }}", when: "{{ matrix_client_element_container_image_self_build }}" } + - {path: "{{ matrix_client_element_data_path }}", when: true} + - {path: "{{ matrix_client_element_docker_src_files_path }}", when: "{{ matrix_client_element_container_image_self_build }}"} when: "item.when|bool" - name: Ensure Element Docker image is pulled @@ -37,7 +37,7 @@ path: "{{ matrix_client_element_docker_src_files_path }}/webpack.config.js" regexp: '(\s+)splitChunks: \{' line: '\1splitChunks: { maxSize: 100000,' - backrefs: yes + backrefs: true owner: root group: root mode: '0644' @@ -52,7 +52,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_client_element_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_client_element_container_image_self_build|bool" - name: Ensure Element configuration installed @@ -93,5 +93,5 @@ - name: Ensure systemd reloaded after matrix-client-element.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_client_element_systemd_service_result.changed|bool" diff --git a/roles/matrix-client-element/tasks/setup_uninstall.yml b/roles/matrix-client-element/tasks/setup_uninstall.yml index 82805b785..55bc20d6a 100644 --- a/roles/matrix-client-element/tasks/setup_uninstall.yml +++ b/roles/matrix-client-element/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-client-element state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_client_element_service_stat.stat.exists|bool" @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-client-element.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_client_element_service_stat.stat.exists|bool" - name: Ensure Element paths doesn't exist diff --git a/roles/matrix-client-hydrogen/defaults/main.yml b/roles/matrix-client-hydrogen/defaults/main.yml index e73dea37b..64bb0ba96 100644 --- a/roles/matrix-client-hydrogen/defaults/main.yml +++ b/roles/matrix-client-hydrogen/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_client_hydrogen_enabled: true # Self building is used by default because the `config.json` file is only read at build time. diff --git a/roles/matrix-client-hydrogen/tasks/init.yml b/roles/matrix-client-hydrogen/tasks/init.yml index 8116a0034..c6801e517 100644 --- a/roles/matrix-client-hydrogen/tasks/init.yml +++ b/roles/matrix-client-hydrogen/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-client-hydrogen/tasks/main.yml b/roles/matrix-client-hydrogen/tasks/main.yml index 8d5c493f5..13d157ccf 100644 --- a/roles/matrix-client-hydrogen/tasks/main.yml +++ b/roles/matrix-client-hydrogen/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-client-hydrogen/tasks/self_check.yml b/roles/matrix-client-hydrogen/tasks/self_check.yml index c7407dcd5..28af9c789 100644 --- a/roles/matrix-client-hydrogen/tasks/self_check.yml +++ b/roles/matrix-client-hydrogen/tasks/self_check.yml @@ -9,7 +9,7 @@ follow_redirects: none validate_certs: "{{ matrix_client_hydrogen_self_check_validate_certificates }}" register: matrix_client_hydrogen_self_check_result - check_mode: no + check_mode: false ignore_errors: true - name: Fail if Hydrogen not working diff --git a/roles/matrix-client-hydrogen/tasks/setup_install.yml b/roles/matrix-client-hydrogen/tasks/setup_install.yml index 2f949927d..d83727682 100644 --- a/roles/matrix-client-hydrogen/tasks/setup_install.yml +++ b/roles/matrix-client-hydrogen/tasks/setup_install.yml @@ -8,16 +8,16 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_client_hydrogen_data_path }}", when: true } - - { path: "{{ matrix_client_hydrogen_docker_src_files_path }}", when: "{{ matrix_client_hydrogen_container_image_self_build }}" } + - {path: "{{ matrix_client_hydrogen_data_path }}", when: true} + - {path: "{{ matrix_client_hydrogen_docker_src_files_path }}", when: "{{ matrix_client_hydrogen_container_image_self_build }}"} when: "item.when|bool" - name: Ensure Hydrogen Docker image is pulled docker_image: - name: "{{ matrix_client_hydrogen_docker_image }}" - source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" - force_source: "{{ matrix_client_hydrogen_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" - force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_client_hydrogen_docker_image_force_pull }}" + name: "{{ matrix_client_hydrogen_docker_image }}" + source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" + force_source: "{{ matrix_client_hydrogen_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" + force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_client_hydrogen_docker_image_force_pull }}" when: "not matrix_client_hydrogen_container_image_self_build|bool" - name: Ensure Hydrogen repository is present on self-build @@ -59,7 +59,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_client_hydrogen_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_client_hydrogen_container_image_self_build|bool" - name: Ensure matrix-client-hydrogen.service installed @@ -71,5 +71,5 @@ - name: Ensure systemd reloaded after matrix-client-hydrogen.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_client_hydrogen_systemd_service_result.changed|bool" diff --git a/roles/matrix-client-hydrogen/tasks/setup_uninstall.yml b/roles/matrix-client-hydrogen/tasks/setup_uninstall.yml index 64d201660..7aff2916f 100644 --- a/roles/matrix-client-hydrogen/tasks/setup_uninstall.yml +++ b/roles/matrix-client-hydrogen/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-client-hydrogen state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_client_hydrogen_service_stat.stat.exists|bool" @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-client-hydrogen.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_client_hydrogen_service_stat.stat.exists|bool" - name: Ensure Hydrogen paths doesn't exist diff --git a/roles/matrix-common-after/defaults/main.yml b/roles/matrix-common-after/defaults/main.yml index 8112191a2..51c48c7d0 100644 --- a/roles/matrix-common-after/defaults/main.yml +++ b/roles/matrix-common-after/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Specifies how long to wait between starting systemd services and checking if they're started. # # A too low value may lead to a failure, as services may not have enough time to start and potentially fail. diff --git a/roles/matrix-common-after/tasks/awx_post.yml b/roles/matrix-common-after/tasks/awx_post.yml index 9c472ca3a..ad0a0ee8a 100644 --- a/roles/matrix-common-after/tasks/awx_post.yml +++ b/roles/matrix-common-after/tasks/awx_post.yml @@ -6,7 +6,7 @@ register: cmd when: not awx_janitor_user_created|bool no_log: false - + - name: Update AWX janitor user created variable delegate_to: 127.0.0.1 lineinfile: @@ -24,7 +24,7 @@ register: cmd when: not awx_dimension_user_created|bool no_log: false - + - name: Update AWX dimension user created variable delegate_to: 127.0.0.1 lineinfile: @@ -42,7 +42,7 @@ register: cmd when: not awx_mjolnir_user_created|bool no_log: false - + - name: Update AWX dimension user created variable delegate_to: 127.0.0.1 lineinfile: diff --git a/roles/matrix-common-after/tasks/dump_runtime_results.yml b/roles/matrix-common-after/tasks/dump_runtime_results.yml index 9788bf840..44ae1a308 100644 --- a/roles/matrix-common-after/tasks/dump_runtime_results.yml +++ b/roles/matrix-common-after/tasks/dump_runtime_results.yml @@ -1,3 +1,4 @@ +--- # Ansible outputs the message in the `item=` field. # It's unnecessary to output it again in the actual message, so we don't. - debug: diff --git a/roles/matrix-common-after/tasks/main.yml b/roles/matrix-common-after/tasks/main.yml index b4503ae1d..75dee15d5 100644 --- a/roles/matrix-common-after/tasks/main.yml +++ b/roles/matrix-common-after/tasks/main.yml @@ -1,3 +1,4 @@ +--- - import_tasks: "{{ role_path }}/tasks/start.yml" when: run_start|bool @@ -12,7 +13,7 @@ - import_tasks: "{{ role_path }}/tasks/dump_runtime_results.yml" tags: - always - + - import_tasks: "{{ role_path }}/tasks/awx_post.yml" when: run_setup|bool and matrix_awx_enabled|bool tags: @@ -21,5 +22,3 @@ - import_tasks: "{{ role_path }}/tasks/run_docker_prune.yml" tags: - run-docker-prune - - diff --git a/roles/matrix-common-after/tasks/start.yml b/roles/matrix-common-after/tasks/start.yml index 64ab4d990..02fa672e3 100644 --- a/roles/matrix-common-after/tasks/start.yml +++ b/roles/matrix-common-after/tasks/start.yml @@ -6,7 +6,7 @@ - name: Ensure systemd is reloaded service: - daemon_reload: yes + daemon_reload: true - name: Ensure Matrix services are stopped service: @@ -35,39 +35,39 @@ become: false - block: - - name: Populate service facts - service_facts: + - name: Populate service facts + service_facts: - - name: Fail if service isn't detected to be running - fail: - msg: >- - {{ item }} was not detected to be running. - It's possible that there's a configuration problem or another service on your server interferes with it (uses the same ports, etc.). - Try running `systemctl status {{ item }}` and `journalctl -fu {{ item }}` on the server to investigate. - If you're on a slow or overloaded server, it may be that services take a longer time to start and that this error is a false-positive. - You can consider raising the value of the `matrix_common_after_systemd_service_start_wait_for_timeout_seconds` variable. - See `roles/matrix-common-after/defaults/main.yml` for more details about that. - with_items: "{{ matrix_systemd_services_list }}" - when: - - "item.endswith('.service') and (ansible_facts.services[item]|default(none) is none or ansible_facts.services[item].state != 'running')" + - name: Fail if service isn't detected to be running + fail: + msg: >- + {{ item }} was not detected to be running. + It's possible that there's a configuration problem or another service on your server interferes with it (uses the same ports, etc.). + Try running `systemctl status {{ item }}` and `journalctl -fu {{ item }}` on the server to investigate. + If you're on a slow or overloaded server, it may be that services take a longer time to start and that this error is a false-positive. + You can consider raising the value of the `matrix_common_after_systemd_service_start_wait_for_timeout_seconds` variable. + See `roles/matrix-common-after/defaults/main.yml` for more details about that. + with_items: "{{ matrix_systemd_services_list }}" + when: + - "item.endswith('.service') and (ansible_facts.services[item]|default(none) is none or ansible_facts.services[item].state != 'running')" when: " ansible_distribution != 'Archlinux'" - block: - # Currently there is a bug in ansible that renders is incompatible with systemd. - # service_facts is not collecting the data successfully. - # Therefore iterating here manually - - name: Fetch systemd information - systemd: - name: "{{ item }}" - register: systemdstatus - with_items: "{{ matrix_systemd_services_list }}" + # Currently there is a bug in ansible that renders is incompatible with systemd. + # service_facts is not collecting the data successfully. + # Therefore iterating here manually + - name: Fetch systemd information + systemd: + name: "{{ item }}" + register: systemdstatus + with_items: "{{ matrix_systemd_services_list }}" - - name: Fail if service isn't detected to be running - fail: - msg: >- - {{ item.item }} was not detected to be running. - It's possible that there's a configuration problem or another service on your server interferes with it (uses the same ports, etc.). - Try running `systemctl status {{ item.item }}` and `journalctl -fu {{ item.item }}` on the server to investigate. - with_items: "{{ systemdstatus.results }}" - when: "item.status['ActiveState'] != 'active'" + - name: Fail if service isn't detected to be running + fail: + msg: >- + {{ item.item }} was not detected to be running. + It's possible that there's a configuration problem or another service on your server interferes with it (uses the same ports, etc.). + Try running `systemctl status {{ item.item }}` and `journalctl -fu {{ item.item }}` on the server to investigate. + with_items: "{{ systemdstatus.results }}" + when: "item.status['ActiveState'] != 'active'" when: "ansible_distribution == 'Archlinux'" diff --git a/roles/matrix-corporal/defaults/main.yml b/roles/matrix-corporal/defaults/main.yml index 47f0b5aff..66896e0e5 100644 --- a/roles/matrix-corporal/defaults/main.yml +++ b/roles/matrix-corporal/defaults/main.yml @@ -1,3 +1,4 @@ +--- # matrix-corporal is a reconciliator and gateway for a managed Matrix server. # See: https://github.com/devture/matrix-corporal @@ -25,7 +26,7 @@ matrix_corporal_systemd_required_services_list: ['docker.service'] matrix_corporal_version: 2.2.3 matrix_corporal_docker_image: "{{ matrix_corporal_docker_image_name_prefix }}devture/matrix-corporal:{{ matrix_corporal_docker_image_tag }}" matrix_corporal_docker_image_name_prefix: "{{ 'localhost/' if matrix_corporal_container_image_self_build else matrix_container_global_registry_prefix }}" -matrix_corporal_docker_image_tag: "{{ matrix_corporal_version }}" # for backward-compatibility +matrix_corporal_docker_image_tag: "{{ matrix_corporal_version }}" # for backward-compatibility matrix_corporal_docker_image_force_pull: "{{ matrix_corporal_docker_image.endswith(':latest') }}" matrix_corporal_base_path: "{{ matrix_base_data_path }}/corporal" diff --git a/roles/matrix-corporal/tasks/init.yml b/roles/matrix-corporal/tasks/init.yml index e5062c275..b2f50e939 100644 --- a/roles/matrix-corporal/tasks/init.yml +++ b/roles/matrix-corporal/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-corporal/tasks/main.yml b/roles/matrix-corporal/tasks/main.yml index 90c8105c3..7ff359d0c 100644 --- a/roles/matrix-corporal/tasks/main.yml +++ b/roles/matrix-corporal/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-corporal/tasks/self_check_corporal.yml b/roles/matrix-corporal/tasks/self_check_corporal.yml index f7c15109e..b702c00f1 100644 --- a/roles/matrix-corporal/tasks/self_check_corporal.yml +++ b/roles/matrix-corporal/tasks/self_check_corporal.yml @@ -8,7 +8,7 @@ url: "{{ corporal_client_api_url_endpoint_public }}" follow_redirects: none return_content: true - check_mode: no + check_mode: false register: result_corporal_client_api ignore_errors: true diff --git a/roles/matrix-corporal/tasks/setup_corporal.yml b/roles/matrix-corporal/tasks/setup_corporal.yml index 8e007c4f8..b8edc596f 100644 --- a/roles/matrix-corporal/tasks/setup_corporal.yml +++ b/roles/matrix-corporal/tasks/setup_corporal.yml @@ -35,7 +35,7 @@ build: dockerfile: etc/docker/Dockerfile path: "{{ matrix_corporal_container_src_files_path }}" - pull: yes + pull: true when: "matrix_corporal_enabled|bool and matrix_corporal_container_image_self_build|bool" - name: Ensure Matrix Corporal Docker image is pulled @@ -65,7 +65,7 @@ - name: Ensure systemd reloaded after matrix-corporal.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_corporal_enabled|bool and matrix_corporal_systemd_service_result.changed" @@ -83,8 +83,8 @@ service: name: matrix-corporal state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "not matrix_corporal_enabled|bool and matrix_corporal_service_stat.stat.exists" @@ -96,7 +96,7 @@ - name: Ensure systemd reloaded after matrix-corporal.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_corporal_enabled|bool and matrix_corporal_service_stat.stat.exists" - name: Ensure matrix-corporal files don't exist diff --git a/roles/matrix-coturn/defaults/main.yml b/roles/matrix-coturn/defaults/main.yml index 4d7ccf6be..f12746574 100644 --- a/roles/matrix-coturn/defaults/main.yml +++ b/roles/matrix-coturn/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_coturn_enabled: true matrix_coturn_container_image_self_build: false diff --git a/roles/matrix-coturn/tasks/init.yml b/roles/matrix-coturn/tasks/init.yml index a7d8a3434..93e4fa3a2 100644 --- a/roles/matrix-coturn/tasks/init.yml +++ b/roles/matrix-coturn/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-coturn/tasks/main.yml b/roles/matrix-coturn/tasks/main.yml index 9794bcb39..76352df12 100644 --- a/roles/matrix-coturn/tasks/main.yml +++ b/roles/matrix-coturn/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-coturn/tasks/setup_install.yml b/roles/matrix-coturn/tasks/setup_install.yml index c31406b1b..f5726e32e 100644 --- a/roles/matrix-coturn/tasks/setup_install.yml +++ b/roles/matrix-coturn/tasks/setup_install.yml @@ -14,7 +14,7 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_coturn_docker_src_files_path }}", when: "{{ matrix_coturn_container_image_self_build }}"} + - {path: "{{ matrix_coturn_docker_src_files_path }}", when: "{{ matrix_coturn_container_image_self_build }}"} when: "item.when|bool" - name: Ensure Coturn image is pulled @@ -43,7 +43,7 @@ build: dockerfile: "{{ matrix_coturn_container_image_self_build_repo_dockerfile_path }}" path: "{{ matrix_coturn_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_coturn_container_image_self_build|bool" - name: Ensure Coturn configuration path exists @@ -101,5 +101,5 @@ - name: Ensure systemd reloaded if systemd units changed service: - daemon_reload: yes + daemon_reload: true when: "matrix_coturn_systemd_service_change_results.changed" diff --git a/roles/matrix-coturn/tasks/setup_uninstall.yml b/roles/matrix-coturn/tasks/setup_uninstall.yml index b642c6d09..097ba8733 100644 --- a/roles/matrix-coturn/tasks/setup_uninstall.yml +++ b/roles/matrix-coturn/tasks/setup_uninstall.yml @@ -10,16 +10,16 @@ service: name: matrix-coturn state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_coturn_service_stat.stat.exists|bool" - name: Ensure matrix-coturn-reload.timer is stopped service: name: matrix-coturn state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true failed_when: false when: "matrix_coturn_service_stat.stat.exists|bool" @@ -35,7 +35,7 @@ - name: Ensure systemd reloaded after unit removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_coturn_systemd_unit_uninstallation_result.changed|bool" - name: Ensure Matrix coturn paths don't exist diff --git a/roles/matrix-dendrite/defaults/main.yml b/roles/matrix-dendrite/defaults/main.yml index 237895403..ec3937c76 100644 --- a/roles/matrix-dendrite/defaults/main.yml +++ b/roles/matrix-dendrite/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Dendrite is a second-generation Matrix homeserver currently in Beta # See: https://github.com/matrix-org/dendrite @@ -127,7 +128,7 @@ matrix_dendrite_mscs_database: "dendrite_mscs" matrix_dendrite_turn_uris: [] matrix_dendrite_turn_shared_secret: "" -matrix_dendrite_turn_allow_guests: False +matrix_dendrite_turn_allow_guests: false # Controls whether the self-check feature should validate TLS certificates. matrix_dendrite_disable_tls_validation: false diff --git a/roles/matrix-dendrite/tasks/dendrite/setup.yml b/roles/matrix-dendrite/tasks/dendrite/setup.yml index 8b6691937..f988d918f 100644 --- a/roles/matrix-dendrite/tasks/dendrite/setup.yml +++ b/roles/matrix-dendrite/tasks/dendrite/setup.yml @@ -1,4 +1,5 @@ --- + - import_tasks: "{{ role_path }}/tasks/dendrite/setup_install.yml" when: matrix_dendrite_enabled|bool diff --git a/roles/matrix-dendrite/tasks/dendrite/setup_install.yml b/roles/matrix-dendrite/tasks/dendrite/setup_install.yml index 3e3b21998..7b3c12d56 100644 --- a/roles/matrix-dendrite/tasks/dendrite/setup_install.yml +++ b/roles/matrix-dendrite/tasks/dendrite/setup_install.yml @@ -4,7 +4,7 @@ stat: path: "{{ matrix_dendrite_media_store_path }}" register: local_path_media_store_stat - ignore_errors: yes + ignore_errors: true # This is separate and conditional, to ensure we don't execute it # if the path already exists or we failed to check, because it's mounted using fuse. @@ -67,7 +67,7 @@ - name: Ensure systemd reloaded after matrix-dendrite.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_dendrite_systemd_service_result.changed|bool" - name: Ensure matrix-dendrite-create-account script created diff --git a/roles/matrix-dendrite/tasks/dendrite/setup_uninstall.yml b/roles/matrix-dendrite/tasks/dendrite/setup_uninstall.yml index 7e953365f..89d5481c4 100644 --- a/roles/matrix-dendrite/tasks/dendrite/setup_uninstall.yml +++ b/roles/matrix-dendrite/tasks/dendrite/setup_uninstall.yml @@ -1,3 +1,5 @@ +--- + - name: Check existence of matrix-dendrite service stat: path: "{{ matrix_systemd_path }}/matrix-dendrite.service" @@ -7,7 +9,7 @@ service: name: matrix-dendrite state: stopped - daemon_reload: yes + daemon_reload: true register: stopping_result when: "matrix_dendrite_service_stat.stat.exists" @@ -19,7 +21,7 @@ - name: Ensure systemd reloaded after matrix-dendrite.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_dendrite_service_stat.stat.exists" - name: Ensure Dendrite Docker image doesn't exist diff --git a/roles/matrix-dendrite/tasks/init.yml b/roles/matrix-dendrite/tasks/init.yml index 2e2e551a8..524ef6eec 100644 --- a/roles/matrix-dendrite/tasks/init.yml +++ b/roles/matrix-dendrite/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-dendrite.service'] }}" when: matrix_dendrite_enabled|bool diff --git a/roles/matrix-dendrite/tasks/main.yml b/roles/matrix-dendrite/tasks/main.yml index 815135d74..5483adec1 100644 --- a/roles/matrix-dendrite/tasks/main.yml +++ b/roles/matrix-dendrite/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-dendrite/tasks/register_user.yml b/roles/matrix-dendrite/tasks/register_user.yml index 099d57e98..b8e3ae5eb 100644 --- a/roles/matrix-dendrite/tasks/register_user.yml +++ b/roles/matrix-dendrite/tasks/register_user.yml @@ -13,7 +13,7 @@ service: name: matrix-dendrite state: started - daemon_reload: yes + daemon_reload: true register: start_result - name: Wait a while, so that Dendrite can manage to start diff --git a/roles/matrix-dendrite/tasks/self_check_client_api.yml b/roles/matrix-dendrite/tasks/self_check_client_api.yml index 7c2f6b5ec..2470d8186 100644 --- a/roles/matrix-dendrite/tasks/self_check_client_api.yml +++ b/roles/matrix-dendrite/tasks/self_check_client_api.yml @@ -6,7 +6,7 @@ validate_certs: "{{ matrix_dendrite_self_check_validate_certificates }}" register: result_matrix_dendrite_client_api ignore_errors: true - check_mode: no + check_mode: false - name: Fail if Matrix Client API not working fail: diff --git a/roles/matrix-dendrite/tasks/self_check_federation_api.yml b/roles/matrix-dendrite/tasks/self_check_federation_api.yml index a7c60a677..0afca2cb9 100644 --- a/roles/matrix-dendrite/tasks/self_check_federation_api.yml +++ b/roles/matrix-dendrite/tasks/self_check_federation_api.yml @@ -6,7 +6,7 @@ validate_certs: "{{ matrix_dendrite_self_check_validate_certificates }}" register: result_matrix_dendrite_federation_api ignore_errors: true - check_mode: no + check_mode: false - name: Fail if Matrix Federation API not working fail: diff --git a/roles/matrix-dendrite/tasks/setup_dendrite.yml b/roles/matrix-dendrite/tasks/setup_dendrite.yml index 04c3a7fef..cbe0cf843 100644 --- a/roles/matrix-dendrite/tasks/setup_dendrite.yml +++ b/roles/matrix-dendrite/tasks/setup_dendrite.yml @@ -7,8 +7,8 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_dendrite_config_dir_path }}", when: true } - - { path: "{{ matrix_dendrite_ext_path }}", when: true } + - {path: "{{ matrix_dendrite_config_dir_path }}", when: true} + - {path: "{{ matrix_dendrite_ext_path }}", when: true} when: "matrix_dendrite_enabled|bool and item.when" - import_tasks: "{{ role_path }}/tasks/dendrite/setup.yml" diff --git a/roles/matrix-dimension/defaults/main.yml b/roles/matrix-dimension/defaults/main.yml index 1ca5f5b8f..c4da906de 100644 --- a/roles/matrix-dimension/defaults/main.yml +++ b/roles/matrix-dimension/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_dimension_enabled: false # You are required to specify an access token for Dimension to work. diff --git a/roles/matrix-dimension/tasks/init.yml b/roles/matrix-dimension/tasks/init.yml index 85ca04eac..6336cb4d3 100644 --- a/roles/matrix-dimension/tasks/init.yml +++ b/roles/matrix-dimension/tasks/init.yml @@ -1,3 +1,4 @@ +--- - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-dimension.service'] }}" when: matrix_dimension_enabled|bool diff --git a/roles/matrix-dimension/tasks/main.yml b/roles/matrix-dimension/tasks/main.yml index aad552866..c2f013993 100644 --- a/roles/matrix-dimension/tasks/main.yml +++ b/roles/matrix-dimension/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-dimension/tasks/setup_install.yml b/roles/matrix-dimension/tasks/setup_install.yml index c75fc0b96..92c21c9e6 100644 --- a/roles/matrix-dimension/tasks/setup_install.yml +++ b/roles/matrix-dimension/tasks/setup_install.yml @@ -111,7 +111,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_dimension_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_dimension_container_image_self_build|bool" - name: Ensure matrix-dimension.service installed @@ -123,7 +123,7 @@ - name: Ensure systemd reloaded after matrix-dimension.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_dimension_systemd_service_result.changed|bool" - name: Ensure matrix-dimension.service restarted, if necessary diff --git a/roles/matrix-dimension/tasks/setup_uninstall.yml b/roles/matrix-dimension/tasks/setup_uninstall.yml index 21f34df05..cdfbe07af 100644 --- a/roles/matrix-dimension/tasks/setup_uninstall.yml +++ b/roles/matrix-dimension/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-dimension state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_dimension_service_stat.stat.exists|bool" @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-dimension.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_dimension_service_stat.stat.exists|bool" - name: Ensure Dimension base directory doesn't exist diff --git a/roles/matrix-dimension/tasks/validate_config.yml b/roles/matrix-dimension/tasks/validate_config.yml index ead8352b5..8413c42f5 100644 --- a/roles/matrix-dimension/tasks/validate_config.yml +++ b/roles/matrix-dimension/tasks/validate_config.yml @@ -1,3 +1,4 @@ +--- - name: Fail if required Dimension settings not defined fail: msg: >- diff --git a/roles/matrix-dimension/vars/main.yml b/roles/matrix-dimension/vars/main.yml index 107bb4fa8..131024cc2 100644 --- a/roles/matrix-dimension/vars/main.yml +++ b/roles/matrix-dimension/vars/main.yml @@ -2,4 +2,4 @@ # Doing `|from_yaml` when the extension contains nothing yields an empty string (""). # We need to ensure it's a dictionary or `|combine` (when building `matrix_dimension_configuration`) will fail later. -matrix_dimension_configuration_extension: "{{ matrix_dimension_configuration_extension_yaml|from_yaml if matrix_dimension_configuration_extension_yaml|from_yaml else {} }}" \ No newline at end of file +matrix_dimension_configuration_extension: "{{ matrix_dimension_configuration_extension_yaml|from_yaml if matrix_dimension_configuration_extension_yaml|from_yaml else {} }}" diff --git a/roles/matrix-dynamic-dns/defaults/main.yml b/roles/matrix-dynamic-dns/defaults/main.yml index 2be1a5ba5..28f4fe0af 100644 --- a/roles/matrix-dynamic-dns/defaults/main.yml +++ b/roles/matrix-dynamic-dns/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Whether dynamic dns is enabled matrix_dynamic_dns_enabled: true diff --git a/roles/matrix-dynamic-dns/tasks/init.yml b/roles/matrix-dynamic-dns/tasks/init.yml index e7d33ff28..6ea6a60bb 100644 --- a/roles/matrix-dynamic-dns/tasks/init.yml +++ b/roles/matrix-dynamic-dns/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-dynamic-dns/tasks/install.yml b/roles/matrix-dynamic-dns/tasks/install.yml index ac69ec896..e2e4f0438 100644 --- a/roles/matrix-dynamic-dns/tasks/install.yml +++ b/roles/matrix-dynamic-dns/tasks/install.yml @@ -16,9 +16,9 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_dynamic_dns_base_path }}", when: true } - - { path: "{{ matrix_dynamic_dns_config_path }}", when: true } - - { path: "{{ matrix_dynamic_dns_docker_src_files_path }}", when: "{{ matrix_dynamic_dns_container_image_self_build }}" } + - {path: "{{ matrix_dynamic_dns_base_path }}", when: true} + - {path: "{{ matrix_dynamic_dns_config_path }}", when: true} + - {path: "{{ matrix_dynamic_dns_docker_src_files_path }}", when: "{{ matrix_dynamic_dns_container_image_self_build }}"} when: matrix_dynamic_dns_enabled|bool and item.when|bool - name: Ensure Dynamic DNS repository is present on self build @@ -38,7 +38,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_dynamic_dns_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_dynamic_dns_enabled|bool and matrix_dynamic_dns_container_image_self_build|bool" - name: Ensure Dynamic DNS ddclient.conf installed @@ -58,5 +58,5 @@ - name: Ensure systemd reloaded after matrix-dynamic-dns.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_dynamic_dns_systemd_service_result.changed" diff --git a/roles/matrix-dynamic-dns/tasks/main.yml b/roles/matrix-dynamic-dns/tasks/main.yml index f9aaab8f5..8b8b306c3 100644 --- a/roles/matrix-dynamic-dns/tasks/main.yml +++ b/roles/matrix-dynamic-dns/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-dynamic-dns/tasks/uninstall.yml b/roles/matrix-dynamic-dns/tasks/uninstall.yml index 9d511051a..80842c9c4 100644 --- a/roles/matrix-dynamic-dns/tasks/uninstall.yml +++ b/roles/matrix-dynamic-dns/tasks/uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-dynamic-dns state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_dynamic_dns_service_stat.stat.exists" - name: Ensure matrix-dynamic-dns.service doesn't exist @@ -21,7 +21,7 @@ - name: Ensure systemd reloaded after matrix-dynamic-dns.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_dynamic_dns_service_stat.stat.exists" # Intentionally not removing the Docker image when uninstalling. diff --git a/roles/matrix-email2matrix/defaults/main.yml b/roles/matrix-email2matrix/defaults/main.yml index 3dfabc1af..767f0d1a7 100644 --- a/roles/matrix-email2matrix/defaults/main.yml +++ b/roles/matrix-email2matrix/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_email2matrix_enabled: true matrix_email2matrix_base_path: "{{ matrix_base_data_path }}/email2matrix" diff --git a/roles/matrix-email2matrix/tasks/init.yml b/roles/matrix-email2matrix/tasks/init.yml index 0c8ffc0cd..5f582212a 100644 --- a/roles/matrix-email2matrix/tasks/init.yml +++ b/roles/matrix-email2matrix/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-email2matrix.service'] }}" when: matrix_email2matrix_enabled|bool diff --git a/roles/matrix-email2matrix/tasks/main.yml b/roles/matrix-email2matrix/tasks/main.yml index 77be72790..35bda4fa8 100644 --- a/roles/matrix-email2matrix/tasks/main.yml +++ b/roles/matrix-email2matrix/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-email2matrix/tasks/setup_install.yml b/roles/matrix-email2matrix/tasks/setup_install.yml index 7805c2c1f..44f2ef7d3 100644 --- a/roles/matrix-email2matrix/tasks/setup_install.yml +++ b/roles/matrix-email2matrix/tasks/setup_install.yml @@ -8,9 +8,9 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_email2matrix_base_path }}", when: true } - - { path: "{{ matrix_email2matrix_config_dir_path }}", when: true } - - { path: "{{ matrix_email2matrix_docker_src_files_path }}", when: "{{ matrix_email2matrix_container_image_self_build }}"} + - {path: "{{ matrix_email2matrix_base_path }}", when: true} + - {path: "{{ matrix_email2matrix_config_dir_path }}", when: true} + - {path: "{{ matrix_email2matrix_docker_src_files_path }}", when: "{{ matrix_email2matrix_container_image_self_build }}"} when: "item.when|bool" - name: Ensure Email2Matrix configuration file created @@ -47,7 +47,7 @@ build: dockerfile: etc/docker/Dockerfile path: "{{ matrix_email2matrix_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_email2matrix_container_image_self_build|bool" - name: Ensure matrix-email2matrix.service installed @@ -59,5 +59,5 @@ - name: Ensure systemd reloaded after matrix-email2matrix.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_email2matrix_systemd_service_result.changed|bool" diff --git a/roles/matrix-email2matrix/tasks/setup_uninstall.yml b/roles/matrix-email2matrix/tasks/setup_uninstall.yml index 270b92505..27d35f2d6 100644 --- a/roles/matrix-email2matrix/tasks/setup_uninstall.yml +++ b/roles/matrix-email2matrix/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-email2matrix state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_email2matrix_service_stat.stat.exists|bool" @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-email2matrix.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_email2matrix_service_stat.stat.exists|bool" - name: Ensure Email2Matrix data path doesn't exist diff --git a/roles/matrix-etherpad/defaults/main.yml b/roles/matrix-etherpad/defaults/main.yml index bcabc3ddc..0daf24a35 100644 --- a/roles/matrix-etherpad/defaults/main.yml +++ b/roles/matrix-etherpad/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_etherpad_enabled: false matrix_etherpad_base_path: "{{ matrix_base_data_path }}/etherpad" diff --git a/roles/matrix-etherpad/tasks/init.yml b/roles/matrix-etherpad/tasks/init.yml index c94e08174..b155064cf 100644 --- a/roles/matrix-etherpad/tasks/init.yml +++ b/roles/matrix-etherpad/tasks/init.yml @@ -1,52 +1,54 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-etherpad.service'] }}" when: matrix_etherpad_enabled|bool - block: - - name: Fail if matrix-nginx-proxy role already executed - fail: - msg: >- - Trying to append Etherpad's reverse-proxying configuration to matrix-nginx-proxy, - 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-etherpad role. - when: matrix_nginx_proxy_role_executed|default(False)|bool + - name: Fail if matrix-nginx-proxy role already executed + fail: + msg: >- + Trying to append Etherpad's reverse-proxying configuration to matrix-nginx-proxy, + 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-etherpad role. + when: matrix_nginx_proxy_role_executed|default(False)|bool - - name: Generate Etherpad proxying configuration for matrix-nginx-proxy - set_fact: - matrix_etherpad_matrix_nginx_proxy_configuration: | - rewrite ^{{ matrix_etherpad_public_endpoint }}$ {{ matrix_nginx_proxy_x_forwarded_proto_value }}://$server_name{{ matrix_etherpad_public_endpoint }}/ permanent; + - name: Generate Etherpad proxying configuration for matrix-nginx-proxy + set_fact: + matrix_etherpad_matrix_nginx_proxy_configuration: | + rewrite ^{{ matrix_etherpad_public_endpoint }}$ {{ matrix_nginx_proxy_x_forwarded_proto_value }}://$server_name{{ matrix_etherpad_public_endpoint }}/ permanent; - location {{ matrix_etherpad_public_endpoint }}/ { - {% 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; - proxy_pass http://matrix-etherpad:9001/; - {# These are proxy directives needed specifically by Etherpad #} - proxy_buffering off; - proxy_http_version 1.1; # recommended with keepalive connections - proxy_pass_header Server; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }}; # for EP to set secure cookie flag when https is used - # WebSocket proxying - from http://nginx.org/en/docs/http/websocket.html - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - {% else %} - {# Generic configuration for use outside of our container setup #} - # A good guide for setting up your Etherpad behind nginx: - # https://docs.gandi.net/en/cloud/tutorials/etherpad_lite.html - proxy_pass http://127.0.0.1:9001/; - {% endif %} - } + location {{ matrix_etherpad_public_endpoint }}/ { + {% 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; + proxy_pass http://matrix-etherpad:9001/; + {# These are proxy directives needed specifically by Etherpad #} + proxy_buffering off; + proxy_http_version 1.1; # recommended with keepalive connections + proxy_pass_header Server; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }}; # for EP to set secure cookie flag when https is used + # WebSocket proxying - from http://nginx.org/en/docs/http/websocket.html + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + {% else %} + {# Generic configuration for use outside of our container setup #} + # A good guide for setting up your Etherpad behind nginx: + # https://docs.gandi.net/en/cloud/tutorials/etherpad_lite.html + proxy_pass http://127.0.0.1:9001/; + {% endif %} + } - - name: Register Etherpad proxying configuration with matrix-nginx-proxy - set_fact: - matrix_nginx_proxy_proxy_dimension_additional_server_configuration_blocks: | - {{ - matrix_nginx_proxy_proxy_dimension_additional_server_configuration_blocks|default([]) - + - [matrix_etherpad_matrix_nginx_proxy_configuration] - }} + - name: Register Etherpad proxying configuration with matrix-nginx-proxy + set_fact: + matrix_nginx_proxy_proxy_dimension_additional_server_configuration_blocks: | + {{ + matrix_nginx_proxy_proxy_dimension_additional_server_configuration_blocks|default([]) + + + [matrix_etherpad_matrix_nginx_proxy_configuration] + }} tags: - always when: matrix_etherpad_enabled|bool diff --git a/roles/matrix-etherpad/tasks/main.yml b/roles/matrix-etherpad/tasks/main.yml index 27548aaf9..bf59d838c 100644 --- a/roles/matrix-etherpad/tasks/main.yml +++ b/roles/matrix-etherpad/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-etherpad/tasks/setup_install.yml b/roles/matrix-etherpad/tasks/setup_install.yml index a93c28de5..27832e14a 100644 --- a/roles/matrix-etherpad/tasks/setup_install.yml +++ b/roles/matrix-etherpad/tasks/setup_install.yml @@ -32,5 +32,5 @@ - name: Ensure systemd reloaded after matrix-etherpad.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_etherpad_systemd_service_result.changed|bool" diff --git a/roles/matrix-etherpad/tasks/setup_uninstall.yml b/roles/matrix-etherpad/tasks/setup_uninstall.yml index a63d3fb1e..ae1f2604e 100644 --- a/roles/matrix-etherpad/tasks/setup_uninstall.yml +++ b/roles/matrix-etherpad/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-etherpad state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_etherpad_service_stat.stat.exists|bool" @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-etherpad.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_etherpad_service_stat.stat.exists|bool" - name: Ensure Etherpad base directory doesn't exist diff --git a/roles/matrix-etherpad/tasks/validate_config.yml b/roles/matrix-etherpad/tasks/validate_config.yml index c76dc3b5d..f9438e7bf 100644 --- a/roles/matrix-etherpad/tasks/validate_config.yml +++ b/roles/matrix-etherpad/tasks/validate_config.yml @@ -1,3 +1,5 @@ +--- + - name: Fail if Etherpad is enabled without the Dimension integrations manager fail: msg: >- diff --git a/roles/matrix-grafana/defaults/main.yml b/roles/matrix-grafana/defaults/main.yml index f802d2e56..d84384425 100644 --- a/roles/matrix-grafana/defaults/main.yml +++ b/roles/matrix-grafana/defaults/main.yml @@ -1,3 +1,4 @@ +--- # matrix-grafana is open source visualization and analytics software # See: https://github.com/matrix-org/synapse/blob/master/docs/metrics-howto.md @@ -11,8 +12,8 @@ matrix_grafana_docker_image_force_pull: "{{ matrix_grafana_docker_image.endswith # they might still want to look at the old existing data. # So it would be silly to delete the dashboard in such case. matrix_grafana_dashboard_download_urls: -- "https://raw.githubusercontent.com/matrix-org/synapse/master/contrib/grafana/synapse.json" -- "https://raw.githubusercontent.com/rfrail3/grafana-dashboards/master/prometheus/node-exporter-full.json" + - "https://raw.githubusercontent.com/matrix-org/synapse/master/contrib/grafana/synapse.json" + - "https://raw.githubusercontent.com/rfrail3/grafana-dashboards/master/prometheus/node-exporter-full.json" matrix_grafana_base_path: "{{ matrix_base_data_path }}/grafana" matrix_grafana_config_path: "{{ matrix_grafana_base_path }}/config" @@ -32,7 +33,7 @@ matrix_grafana_default_admin_user: admin matrix_grafana_default_admin_password: admin # Set to true to add the Content-Security-Policy header to your requests. -# CSP allows to control resources that the user agent can load and helps +# CSP allows to control resources that the user agent can load and helps # prevent XSS attacks. # [Content Security Policy](https://grafana.com/docs/grafana/latest/administration/configuration/#content_security_policy) matrix_grafana_content_security_policy: true diff --git a/roles/matrix-grafana/tasks/init.yml b/roles/matrix-grafana/tasks/init.yml index 8a22e3018..4c2cbf068 100644 --- a/roles/matrix-grafana/tasks/init.yml +++ b/roles/matrix-grafana/tasks/init.yml @@ -1,5 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-grafana.service'] }}" when: matrix_grafana_enabled|bool - - diff --git a/roles/matrix-grafana/tasks/main.yml b/roles/matrix-grafana/tasks/main.yml index fb16c394b..c93fd5002 100644 --- a/roles/matrix-grafana/tasks/main.yml +++ b/roles/matrix-grafana/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-grafana/tasks/setup.yml b/roles/matrix-grafana/tasks/setup.yml index c5cee64cc..5f9d21c18 100644 --- a/roles/matrix-grafana/tasks/setup.yml +++ b/roles/matrix-grafana/tasks/setup.yml @@ -77,7 +77,7 @@ - name: Ensure systemd reloaded after matrix-grafana.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_grafana_enabled|bool and matrix_grafana_systemd_service_result.changed" # @@ -93,8 +93,8 @@ service: name: matrix-grafana state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "not matrix_grafana_enabled|bool and matrix_grafana_service_stat.stat.exists" @@ -106,6 +106,5 @@ - name: Ensure systemd reloaded after matrix-grafana.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_grafana_enabled|bool and matrix_grafana_service_stat.stat.exists" - diff --git a/roles/matrix-jitsi/defaults/main.yml b/roles/matrix-jitsi/defaults/main.yml index a36a09fc1..32f4be0d1 100644 --- a/roles/matrix-jitsi/defaults/main.yml +++ b/roles/matrix-jitsi/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_jitsi_enabled: true matrix_jitsi_base_path: "{{ matrix_base_data_path }}/jitsi" @@ -69,7 +71,7 @@ matrix_jitsi_jibri_recorder_password: '' matrix_jitsi_enable_lobby: false matrix_jitsi_version: stable-6726-2 -matrix_jitsi_container_image_tag: "{{ matrix_jitsi_version }}" # for backward-compatibility +matrix_jitsi_container_image_tag: "{{ matrix_jitsi_version }}" # for backward-compatibility matrix_jitsi_web_docker_image: "{{ matrix_container_global_registry_prefix }}jitsi/web:{{ matrix_jitsi_container_image_tag }}" matrix_jitsi_web_docker_image_force_pull: "{{ matrix_jitsi_web_docker_image.endswith(':latest') }}" diff --git a/roles/matrix-jitsi/tasks/init.yml b/roles/matrix-jitsi/tasks/init.yml index 1f7a2d1cf..efab8745b 100644 --- a/roles/matrix-jitsi/tasks/init.yml +++ b/roles/matrix-jitsi/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-jitsi-web.service', 'matrix-jitsi-prosody.service', 'matrix-jitsi-jicofo.service', 'matrix-jitsi-jvb.service'] }}" when: matrix_jitsi_enabled|bool diff --git a/roles/matrix-jitsi/tasks/main.yml b/roles/matrix-jitsi/tasks/main.yml index e4f3508f3..fe9da205b 100644 --- a/roles/matrix-jitsi/tasks/main.yml +++ b/roles/matrix-jitsi/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-jitsi/tasks/setup_jitsi_base.yml b/roles/matrix-jitsi/tasks/setup_jitsi_base.yml index 86e372121..4b390c18c 100644 --- a/roles/matrix-jitsi/tasks/setup_jitsi_base.yml +++ b/roles/matrix-jitsi/tasks/setup_jitsi_base.yml @@ -14,7 +14,7 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_jitsi_base_path }}", when: true } + - {path: "{{ matrix_jitsi_base_path }}", when: true} when: matrix_jitsi_enabled|bool and item.when # diff --git a/roles/matrix-jitsi/tasks/setup_jitsi_jicofo.yml b/roles/matrix-jitsi/tasks/setup_jitsi_jicofo.yml index 4e2be6960..2bb781c18 100644 --- a/roles/matrix-jitsi/tasks/setup_jitsi_jicofo.yml +++ b/roles/matrix-jitsi/tasks/setup_jitsi_jicofo.yml @@ -12,8 +12,8 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_jitsi_jicofo_base_path }}", when: true } - - { path: "{{ matrix_jitsi_jicofo_config_path }}", when: true } + - {path: "{{ matrix_jitsi_jicofo_base_path }}", when: true} + - {path: "{{ matrix_jitsi_jicofo_config_path }}", when: true} when: matrix_jitsi_enabled|bool and item.when - name: Ensure jitsi-jicofo Docker image is pulled @@ -51,7 +51,7 @@ - name: Ensure systemd reloaded after matrix-jitsi-jicofo.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_jitsi_enabled and matrix_jitsi_jicofo_systemd_service_result.changed" # @@ -68,8 +68,8 @@ service: name: matrix-jitsi-jicofo state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "not matrix_jitsi_enabled|bool and matrix_jitsi_jicofo_service_stat.stat.exists" @@ -81,7 +81,7 @@ - name: Ensure systemd reloaded after matrix-jitsi-jicofo.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_jitsi_enabled|bool and matrix_jitsi_jicofo_service_stat.stat.exists" - name: Ensure Matrix jitsi-jicofo paths doesn't exist diff --git a/roles/matrix-jitsi/tasks/setup_jitsi_jvb.yml b/roles/matrix-jitsi/tasks/setup_jitsi_jvb.yml index 558a6cf1f..3b3b8dbfc 100644 --- a/roles/matrix-jitsi/tasks/setup_jitsi_jvb.yml +++ b/roles/matrix-jitsi/tasks/setup_jitsi_jvb.yml @@ -12,8 +12,8 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_jitsi_jvb_base_path }}", when: true } - - { path: "{{ matrix_jitsi_jvb_config_path }}", when: true } + - {path: "{{ matrix_jitsi_jvb_base_path }}", when: true} + - {path: "{{ matrix_jitsi_jvb_config_path }}", when: true} when: matrix_jitsi_enabled|bool and item.when - name: Ensure jitsi-jvb Docker image is pulled @@ -51,7 +51,7 @@ - name: Ensure systemd reloaded after matrix-jitsi-jvb.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_jitsi_enabled and matrix_jitsi_jvb_systemd_service_result.changed" # @@ -68,8 +68,8 @@ service: name: matrix-jitsi-jvb state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "not matrix_jitsi_enabled|bool and matrix_jitsi_jvb_service_stat.stat.exists" @@ -81,7 +81,7 @@ - name: Ensure systemd reloaded after matrix-jitsi-jvb.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_jitsi_enabled|bool and matrix_jitsi_jvb_service_stat.stat.exists" - name: Ensure Matrix jitsi-jvb paths doesn't exist diff --git a/roles/matrix-jitsi/tasks/setup_jitsi_prosody.yml b/roles/matrix-jitsi/tasks/setup_jitsi_prosody.yml index c1c7c7fca..437e1e9ca 100644 --- a/roles/matrix-jitsi/tasks/setup_jitsi_prosody.yml +++ b/roles/matrix-jitsi/tasks/setup_jitsi_prosody.yml @@ -12,9 +12,9 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_jitsi_prosody_base_path }}", when: true } - - { path: "{{ matrix_jitsi_prosody_config_path }}", when: true } - - { path: "{{ matrix_jitsi_prosody_plugins_path }}", when: true } + - {path: "{{ matrix_jitsi_prosody_base_path }}", when: true} + - {path: "{{ matrix_jitsi_prosody_config_path }}", when: true} + - {path: "{{ matrix_jitsi_prosody_plugins_path }}", when: true} when: matrix_jitsi_enabled|bool and item.when - name: Ensure jitsi-prosody Docker image is pulled @@ -42,7 +42,7 @@ - name: Ensure systemd service is reloaded after matrix-jitsi-prosody.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_jitsi_enabled and matrix_jitsi_prosody_systemd_service_result.changed" - name: Ensure authentication is properly configured @@ -67,8 +67,8 @@ service: name: matrix-jitsi-prosody state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "not matrix_jitsi_enabled|bool and matrix_jitsi_prosody_service_stat.stat.exists" @@ -80,7 +80,7 @@ - name: Ensure systemd is reloaded after matrix-jitsi-prosody.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_jitsi_enabled|bool and matrix_jitsi_prosody_service_stat.stat.exists" - name: Ensure Matrix jitsi-prosody paths doesn't exist diff --git a/roles/matrix-jitsi/tasks/setup_jitsi_web.yml b/roles/matrix-jitsi/tasks/setup_jitsi_web.yml index bcb1b49e5..0a4d43b0f 100644 --- a/roles/matrix-jitsi/tasks/setup_jitsi_web.yml +++ b/roles/matrix-jitsi/tasks/setup_jitsi_web.yml @@ -12,10 +12,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_jitsi_web_base_path }}", when: true } - - { path: "{{ matrix_jitsi_web_config_path }}", when: true } - - { path: "{{ matrix_jitsi_web_transcripts_path }}", when: true } - - { path: "{{ matrix_jitsi_web_crontabs_path }}", when: true } + - {path: "{{ matrix_jitsi_web_base_path }}", when: true} + - {path: "{{ matrix_jitsi_web_config_path }}", when: true} + - {path: "{{ matrix_jitsi_web_transcripts_path }}", when: true} + - {path: "{{ matrix_jitsi_web_crontabs_path }}", when: true} when: matrix_jitsi_enabled|bool and item.when - name: Ensure jitsi-web Docker image is pulled @@ -53,7 +53,7 @@ - name: Ensure systemd reloaded after matrix-jitsi-web.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_jitsi_enabled and matrix_jitsi_web_systemd_service_result.changed" # @@ -70,8 +70,8 @@ service: name: matrix-jitsi-web state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "not matrix_jitsi_enabled|bool and matrix_jitsi_web_service_stat.stat.exists" @@ -83,7 +83,7 @@ - name: Ensure systemd reloaded after matrix-jitsi-web.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_jitsi_enabled|bool and matrix_jitsi_web_service_stat.stat.exists" - name: Ensure Matrix jitsi-web paths doesn't exist @@ -94,4 +94,3 @@ # Intentionally not removing the Docker image when uninstalling. # We can't be sure it had been pulled by us in the first place. - diff --git a/roles/matrix-jitsi/tasks/util/setup_jitsi_auth.yml b/roles/matrix-jitsi/tasks/util/setup_jitsi_auth.yml index 66fb7e5d1..50973acb5 100644 --- a/roles/matrix-jitsi/tasks/util/setup_jitsi_auth.yml +++ b/roles/matrix-jitsi/tasks/util/setup_jitsi_auth.yml @@ -21,18 +21,14 @@ - matrix_jitsi_auth_type == "internal" - matrix_jitsi_prosody_auth_internal_accounts|length > 0 - # # Tasks related to configuring other Jitsi authentication mechanisms # - - # # Tasks related to cleaning after Jitsi authentication configuration # - # # Stop Necessary Services # @@ -40,4 +36,4 @@ systemd: state: stopped name: matrix-jitsi-prosody - when: matrix_jitsi_prosody_start_result.changed|bool \ No newline at end of file + when: matrix_jitsi_prosody_start_result.changed|bool diff --git a/roles/matrix-jitsi/tasks/validate_config.yml b/roles/matrix-jitsi/tasks/validate_config.yml index 4defe986c..5131396de 100644 --- a/roles/matrix-jitsi/tasks/validate_config.yml +++ b/roles/matrix-jitsi/tasks/validate_config.yml @@ -24,7 +24,6 @@ fail: msg: >- At least one Jitsi user needs to be defined in `matrix_jitsi_prosody_auth_internal_accounts` when using internal authentication. - If you're setting up Jitsi for the first time, you may have missed a step. Refer to our setup instructions (docs/configuring-playbook-jitsi.md). when: diff --git a/roles/matrix-ma1sd/defaults/main.yml b/roles/matrix-ma1sd/defaults/main.yml index f0e96effc..f1d570494 100644 --- a/roles/matrix-ma1sd/defaults/main.yml +++ b/roles/matrix-ma1sd/defaults/main.yml @@ -1,3 +1,4 @@ +--- # ma1sd is a Federated Matrix Identity Server # See: https://github.com/ma1uta/ma1sd diff --git a/roles/matrix-ma1sd/tasks/init.yml b/roles/matrix-ma1sd/tasks/init.yml index 04cc3a213..a7c914dbb 100644 --- a/roles/matrix-ma1sd/tasks/init.yml +++ b/roles/matrix-ma1sd/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-ma1sd/tasks/main.yml b/roles/matrix-ma1sd/tasks/main.yml index 0b8a114e1..2902c05d9 100644 --- a/roles/matrix-ma1sd/tasks/main.yml +++ b/roles/matrix-ma1sd/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-ma1sd/tasks/migrate_mxisd.yml b/roles/matrix-ma1sd/tasks/migrate_mxisd.yml index c36c3de9d..720afa768 100644 --- a/roles/matrix-ma1sd/tasks/migrate_mxisd.yml +++ b/roles/matrix-ma1sd/tasks/migrate_mxisd.yml @@ -23,8 +23,8 @@ service: name: matrix-mxisd state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "matrix_mxisd_service_stat.stat.exists" - name: Check existence of matrix-ma1sd service @@ -37,26 +37,26 @@ service: name: matrix-ma1sd state: stopped - daemon_reload: yes + daemon_reload: true when: "ma1sd_migrate_mxisd_data_dir_stat.stat.exists and matrix_ma1sd_service_stat.stat.exists" # We use shell commands for the migration, because the Ansible copy module cannot # recursively copy remote directories (like `/matrix/mxisd/data/sign.key`) in older versions of Ansible. - block: - - name: Copy mxisd data files to ma1sd folder - command: "cp -ar {{ matrix_base_data_path }}/mxisd/data {{ matrix_ma1sd_base_path }}" + - name: Copy mxisd data files to ma1sd folder + command: "cp -ar {{ matrix_base_data_path }}/mxisd/data {{ matrix_ma1sd_base_path }}" - - name: Check existence of mxisd.db file - stat: - path: "{{ matrix_ma1sd_data_path }}/mxisd.db" - register: matrix_ma1sd_mxisd_db_stat + - name: Check existence of mxisd.db file + stat: + path: "{{ matrix_ma1sd_data_path }}/mxisd.db" + register: matrix_ma1sd_mxisd_db_stat - - name: Rename database (mxisd.db -> ma1sd.db) - command: "mv {{ matrix_ma1sd_data_path }}/mxisd.db {{ matrix_ma1sd_data_path }}/ma1sd.db" - when: "matrix_ma1sd_mxisd_db_stat.stat.exists" + - name: Rename database (mxisd.db -> ma1sd.db) + command: "mv {{ matrix_ma1sd_data_path }}/mxisd.db {{ matrix_ma1sd_data_path }}/ma1sd.db" + when: "matrix_ma1sd_mxisd_db_stat.stat.exists" - - name: Rename mxisd folder - command: "mv {{ matrix_base_data_path }}/mxisd {{ matrix_base_data_path }}/mxisd.migrated" + - name: Rename mxisd folder + command: "mv {{ matrix_base_data_path }}/mxisd {{ matrix_base_data_path }}/mxisd.migrated" when: "ma1sd_migrate_mxisd_data_dir_stat.stat.exists" - name: Ensure outdated matrix-mxisd.service doesn't exist @@ -67,7 +67,5 @@ - name: Ensure systemd reloaded after removing outdated matrix-mxisd.service service: - daemon_reload: yes + daemon_reload: true when: "matrix_mxisd_service_stat.stat.exists" - - diff --git a/roles/matrix-ma1sd/tasks/self_check_ma1sd.yml b/roles/matrix-ma1sd/tasks/self_check_ma1sd.yml index b8a7faaa3..4a4c71367 100644 --- a/roles/matrix-ma1sd/tasks/self_check_ma1sd.yml +++ b/roles/matrix-ma1sd/tasks/self_check_ma1sd.yml @@ -8,7 +8,7 @@ url: "{{ ma1sd_url_endpoint_public }}" follow_redirects: none validate_certs: "{{ matrix_ma1sd_self_check_validate_certificates }}" - check_mode: no + check_mode: false register: result_ma1sd ignore_errors: true diff --git a/roles/matrix-ma1sd/tasks/setup_install.yml b/roles/matrix-ma1sd/tasks/setup_install.yml index 3f319eeff..c6f9f8e22 100644 --- a/roles/matrix-ma1sd/tasks/setup_install.yml +++ b/roles/matrix-ma1sd/tasks/setup_install.yml @@ -8,9 +8,9 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_ma1sd_config_path }}", when: true } - - { path: "{{ matrix_ma1sd_data_path }}", when: true } - - { path: "{{ matrix_ma1sd_docker_src_files_path }}", when: "{{ matrix_ma1sd_container_image_self_build }}"} + - {path: "{{ matrix_ma1sd_config_path }}", when: true} + - {path: "{{ matrix_ma1sd_data_path }}", when: true} + - {path: "{{ matrix_ma1sd_docker_src_files_path }}", when: "{{ matrix_ma1sd_container_image_self_build }}"} when: "item.when|bool" - import_tasks: "{{ role_path }}/tasks/migrate_mxisd.yml" @@ -54,52 +54,52 @@ when: "not matrix_ma1sd_container_image_self_build|bool" - block: - - name: Ensure gradle is installed for self-building (Debian) - apt: - name: - - gradle - state: present - update_cache: yes - when: (ansible_os_family == 'Debian') + - name: Ensure gradle is installed for self-building (Debian) + apt: + name: + - gradle + state: present + update_cache: true + when: (ansible_os_family == 'Debian') - - name: Ensure gradle is installed for self-building (CentOS) - fail: - msg: "Installing gradle on CentOS is currently not supported, so self-building ma1sd cannot happen at this time" - when: ansible_distribution == 'CentOS' + - name: Ensure gradle is installed for self-building (CentOS) + fail: + msg: "Installing gradle on CentOS is currently not supported, so self-building ma1sd cannot happen at this time" + when: ansible_distribution == 'CentOS' - - name: Ensure gradle is installed for self-building (Archlinux) - pacman: - name: - - gradle - state: latest - update_cache: yes - when: ansible_distribution == 'Archlinux' + - name: Ensure gradle is installed for self-building (Archlinux) + pacman: + name: + - gradle + state: latest + update_cache: true + when: ansible_distribution == 'Archlinux' - - name: Ensure ma1sd repository is present on self-build - git: - repo: "{{ matrix_ma1sd_container_image_self_build_repo }}" - dest: "{{ matrix_ma1sd_docker_src_files_path }}" - version: "{{ matrix_ma1sd_container_image_self_build_branch }}" - force: "yes" - register: matrix_ma1sd_git_pull_results + - name: Ensure ma1sd repository is present on self-build + git: + repo: "{{ matrix_ma1sd_container_image_self_build_repo }}" + dest: "{{ matrix_ma1sd_docker_src_files_path }}" + version: "{{ matrix_ma1sd_container_image_self_build_branch }}" + force: "yes" + register: matrix_ma1sd_git_pull_results - - name: Ensure ma1sd Docker image is built - shell: "DOCKER_BUILDKIT=1 ./gradlew dockerBuild" - args: - chdir: "{{ matrix_ma1sd_docker_src_files_path }}" + - name: Ensure ma1sd Docker image is built + shell: "DOCKER_BUILDKIT=1 ./gradlew dockerBuild" + args: + chdir: "{{ matrix_ma1sd_docker_src_files_path }}" - - name: Ensure ma1sd Docker image is tagged correctly - docker_image: - # The build script always tags the image with 2 tags: - # - based on the branch/version: e.g. `ma1uta/ma1sd:2.4.0` (when on `2.4.0`) - # or `ma1uta/ma1sd:2.4.0-19-ga71d32b` (when on a given commit for a pre-release) - # - generic one: `ma1uta/ma1sd:latest-dev` - # - # It's hard to predict the first one, so we'll use the latter. - name: "ma1uta/ma1sd:latest-dev" - repository: "{{ matrix_ma1sd_docker_image }}" - force_tag: yes - source: local + - name: Ensure ma1sd Docker image is tagged correctly + docker_image: + # The build script always tags the image with 2 tags: + # - based on the branch/version: e.g. `ma1uta/ma1sd:2.4.0` (when on `2.4.0`) + # or `ma1uta/ma1sd:2.4.0-19-ga71d32b` (when on a given commit for a pre-release) + # - generic one: `ma1uta/ma1sd:latest-dev` + # + # It's hard to predict the first one, so we'll use the latter. + name: "ma1uta/ma1sd:latest-dev" + repository: "{{ matrix_ma1sd_docker_image }}" + force_tag: true + source: local when: "matrix_ma1sd_container_image_self_build|bool" - name: Ensure ma1sd config installed @@ -157,7 +157,7 @@ - name: Ensure systemd reloaded after matrix-ma1sd.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_ma1sd_systemd_service_result.changed|bool" - name: Ensure matrix-ma1sd.service restarted, if necessary diff --git a/roles/matrix-ma1sd/tasks/setup_uninstall.yml b/roles/matrix-ma1sd/tasks/setup_uninstall.yml index 153f6e08c..30a1bfda6 100644 --- a/roles/matrix-ma1sd/tasks/setup_uninstall.yml +++ b/roles/matrix-ma1sd/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-ma1sd state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_ma1sd_service_stat.stat.exists|bool" @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-ma1sd.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_ma1sd_service_stat.stat.exists|bool" - name: Ensure Matrix ma1sd paths don't exist diff --git a/roles/matrix-mailer/defaults/main.yml b/roles/matrix-mailer/defaults/main.yml index 4d8605523..682126d28 100644 --- a/roles/matrix-mailer/defaults/main.yml +++ b/roles/matrix-mailer/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_mailer_enabled: true matrix_mailer_base_path: "{{ matrix_base_data_path }}/mailer" diff --git a/roles/matrix-mailer/tasks/init.yml b/roles/matrix-mailer/tasks/init.yml index d07380f0e..c928d5574 100644 --- a/roles/matrix-mailer/tasks/init.yml +++ b/roles/matrix-mailer/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-mailer/tasks/main.yml b/roles/matrix-mailer/tasks/main.yml index f636614e0..c69dad201 100644 --- a/roles/matrix-mailer/tasks/main.yml +++ b/roles/matrix-mailer/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-mailer/tasks/setup_mailer.yml b/roles/matrix-mailer/tasks/setup_mailer.yml index def178835..1ac4f3394 100644 --- a/roles/matrix-mailer/tasks/setup_mailer.yml +++ b/roles/matrix-mailer/tasks/setup_mailer.yml @@ -12,8 +12,8 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_mailer_base_path }}", when: true } - - { path: "{{ matrix_mailer_container_image_self_build_src_files_path }}", when: "{{ matrix_mailer_container_image_self_build }}" } + - {path: "{{ matrix_mailer_base_path }}", when: true} + - {path: "{{ matrix_mailer_container_image_self_build_src_files_path }}", when: "{{ matrix_mailer_container_image_self_build }}"} when: "matrix_mailer_enabled|bool and item.when" - name: Ensure mailer environment variables file created @@ -41,7 +41,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_mailer_container_image_self_build_src_files_path }}" - pull: yes + pull: true when: "matrix_mailer_enabled|bool and matrix_mailer_container_image_self_build|bool" - name: Ensure exim-relay image is pulled @@ -62,7 +62,7 @@ - name: Ensure systemd reloaded after matrix-mailer.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_mailer_enabled|bool and matrix_mailer_systemd_service_result.changed" # @@ -79,8 +79,8 @@ service: name: matrix-mailer state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "not matrix_mailer_enabled|bool and matrix_mailer_service_stat.stat.exists" @@ -92,7 +92,7 @@ - name: Ensure systemd reloaded after matrix-mailer.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_mailer_enabled|bool and matrix_mailer_service_stat.stat.exists" - name: Ensure Matrix mailer environment variables path doesn't exist diff --git a/roles/matrix-nginx-proxy/defaults/main.yml b/roles/matrix-nginx-proxy/defaults/main.yml index 6932c8c06..ee241189c 100644 --- a/roles/matrix-nginx-proxy/defaults/main.yml +++ b/roles/matrix-nginx-proxy/defaults/main.yml @@ -1,3 +1,4 @@ +--- matrix_nginx_proxy_enabled: true matrix_nginx_proxy_version: 1.21.5-alpine diff --git a/roles/matrix-nginx-proxy/tasks/init.yml b/roles/matrix-nginx-proxy/tasks/init.yml index 0161da23f..ddc8cb47b 100644 --- a/roles/matrix-nginx-proxy/tasks/init.yml +++ b/roles/matrix-nginx-proxy/tasks/init.yml @@ -1,3 +1,4 @@ +--- - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-nginx-proxy.service'] }}" when: matrix_nginx_proxy_enabled|bool diff --git a/roles/matrix-nginx-proxy/tasks/main.yml b/roles/matrix-nginx-proxy/tasks/main.yml index ad1119511..74f8e8d1d 100644 --- a/roles/matrix-nginx-proxy/tasks/main.yml +++ b/roles/matrix-nginx-proxy/tasks/main.yml @@ -1,3 +1,4 @@ +--- - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always @@ -35,4 +36,4 @@ set_fact: matrix_nginx_proxy_role_executed: true tags: - - always + - always diff --git a/roles/matrix-nginx-proxy/tasks/self_check_well_known_file.yml b/roles/matrix-nginx-proxy/tasks/self_check_well_known_file.yml index 6f831a290..588cd1e78 100644 --- a/roles/matrix-nginx-proxy/tasks/self_check_well_known_file.yml +++ b/roles/matrix-nginx-proxy/tasks/self_check_well_known_file.yml @@ -14,7 +14,7 @@ validate_certs: "{{ well_known_file_check.validate_certs }}" headers: Origin: example.com - check_mode: no + check_mode: false register: result_well_known_matrix ignore_errors: true @@ -44,7 +44,7 @@ validate_certs: "{{ well_known_file_check.validate_certs }}" headers: Origin: example.com - check_mode: no + check_mode: false register: result_well_known_identity ignore_errors: true diff --git a/roles/matrix-nginx-proxy/tasks/setup_nginx_proxy.yml b/roles/matrix-nginx-proxy/tasks/setup_nginx_proxy.yml index e5021468a..373bc55b0 100644 --- a/roles/matrix-nginx-proxy/tasks/setup_nginx_proxy.yml +++ b/roles/matrix-nginx-proxy/tasks/setup_nginx_proxy.yml @@ -195,7 +195,7 @@ - name: Ensure systemd reloaded after matrix-nginx-proxy.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_nginx_proxy_enabled and matrix_nginx_proxy_systemd_service_result.changed" @@ -213,8 +213,8 @@ service: name: matrix-nginx-proxy state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "not matrix_nginx_proxy_enabled|bool and matrix_nginx_proxy_service_stat.stat.exists" @@ -226,7 +226,7 @@ - name: Ensure systemd reloaded after matrix-nginx-proxy.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_nginx_proxy_enabled|bool and matrix_nginx_proxy_service_stat.stat.exists" - name: Ensure Matrix nginx-proxy configuration for matrix domain deleted diff --git a/roles/matrix-nginx-proxy/tasks/setup_well_known.yml b/roles/matrix-nginx-proxy/tasks/setup_well_known.yml index 3e43a8c60..1c85552c3 100644 --- a/roles/matrix-nginx-proxy/tasks/setup_well_known.yml +++ b/roles/matrix-nginx-proxy/tasks/setup_well_known.yml @@ -1,3 +1,4 @@ +--- - set_fact: matrix_well_known_file_path: "{{ matrix_static_files_base_path }}/.well-known/matrix/client" @@ -21,4 +22,4 @@ dest: "{{ matrix_static_files_base_path }}/.well-known/matrix" mode: 0644 owner: "{{ matrix_user_username }}" - group: "{{ matrix_user_groupname }}" \ No newline at end of file + group: "{{ matrix_user_groupname }}" diff --git a/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_lets_encrypt_obtain_for_domain.yml b/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_lets_encrypt_obtain_for_domain.yml index e820b0edb..e4dd53c21 100644 --- a/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_lets_encrypt_obtain_for_domain.yml +++ b/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_lets_encrypt_obtain_for_domain.yml @@ -1,3 +1,4 @@ +--- - debug: msg: "Dealing with SSL certificate retrieval for domain: {{ domain_name }}" @@ -13,16 +14,16 @@ domain_name_needs_cert: "{{ not domain_name_certificate_path_stat.stat.exists }}" - block: - - name: Ensure required service for obtaining is started - service: - name: "{{ matrix_ssl_pre_obtaining_required_service_name }}" - state: started - register: matrix_ssl_pre_obtaining_required_service_start_result + - name: Ensure required service for obtaining is started + service: + name: "{{ matrix_ssl_pre_obtaining_required_service_name }}" + state: started + register: matrix_ssl_pre_obtaining_required_service_start_result - - name: Wait some time, so that the required service for obtaining can start - wait_for: - timeout: "{{ matrix_ssl_pre_obtaining_required_service_start_wait_time_seconds }}" - when: "matrix_ssl_pre_obtaining_required_service_start_result.changed|bool" + - name: Wait some time, so that the required service for obtaining can start + wait_for: + timeout: "{{ matrix_ssl_pre_obtaining_required_service_start_wait_time_seconds }}" + when: "matrix_ssl_pre_obtaining_required_service_start_result.changed|bool" when: "domain_name_needs_cert|bool and matrix_ssl_pre_obtaining_required_service_name != ''" # This will fail if there is something running on port 80 (like matrix-nginx-proxy). diff --git a/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_manually_managed.yml b/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_manually_managed.yml index ea39f5e9d..7bcd3d748 100644 --- a/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_manually_managed.yml +++ b/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_manually_managed.yml @@ -5,4 +5,4 @@ with_items: "{{ matrix_ssl_domains_to_obtain_certificates_for }}" loop_control: loop_var: domain_name - when: "matrix_ssl_retrieval_method == 'manually-managed'" \ No newline at end of file + when: "matrix_ssl_retrieval_method == 'manually-managed'" diff --git a/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_manually_managed_verify_for_domain.yml b/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_manually_managed_verify_for_domain.yml index be0444b13..2b5bb1f31 100644 --- a/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_manually_managed_verify_for_domain.yml +++ b/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_manually_managed_verify_for_domain.yml @@ -20,4 +20,4 @@ - fail: msg: "Failed finding a certificate key file (for domain `{{ domain_name }}`) at `{{ matrix_ssl_certificate_verification_cert_key_path }}`" - when: "not matrix_ssl_certificate_verification_cert_key_path_stat_result.stat.exists" \ No newline at end of file + when: "not matrix_ssl_certificate_verification_cert_key_path_stat_result.stat.exists" diff --git a/roles/matrix-postgres-backup/defaults/main.yml b/roles/matrix-postgres-backup/defaults/main.yml index efce36562..59ae50766 100644 --- a/roles/matrix-postgres-backup/defaults/main.yml +++ b/roles/matrix-postgres-backup/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_postgres_backup_enabled: false matrix_postgres_backup_connection_hostname: "matrix-postgres" diff --git a/roles/matrix-postgres-backup/tasks/init.yml b/roles/matrix-postgres-backup/tasks/init.yml index c6a9bd7ec..f74cea06e 100644 --- a/roles/matrix-postgres-backup/tasks/init.yml +++ b/roles/matrix-postgres-backup/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-postgres-backup.service'] }}" when: matrix_postgres_backup_enabled|bool diff --git a/roles/matrix-postgres-backup/tasks/setup_postgres_backup.yml b/roles/matrix-postgres-backup/tasks/setup_postgres_backup.yml index 68eae4430..72329db3f 100644 --- a/roles/matrix-postgres-backup/tasks/setup_postgres_backup.yml +++ b/roles/matrix-postgres-backup/tasks/setup_postgres_backup.yml @@ -52,7 +52,7 @@ - name: Ensure systemd reloaded after matrix-postgres-backup.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_postgres_backup_enabled|bool and matrix_postgres_backup_systemd_service_result.changed" # @@ -69,8 +69,8 @@ service: name: matrix-postgres-backup state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "not matrix_postgres_backup_enabled|bool and matrix_postgres_backup_service_stat.stat.exists" - name: Ensure matrix-postgres-backup.service doesn't exist @@ -81,7 +81,7 @@ - name: Ensure systemd reloaded after matrix-postgres-backup.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_postgres_backup_enabled|bool and matrix_postgres_backup_service_stat.stat.exists" - name: Check existence of matrix-postgres-backup backup path diff --git a/roles/matrix-postgres/defaults/main.yml b/roles/matrix-postgres/defaults/main.yml index 424132862..4d338e7d5 100644 --- a/roles/matrix-postgres/defaults/main.yml +++ b/roles/matrix-postgres/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_postgres_enabled: true matrix_postgres_connection_hostname: "matrix-postgres" diff --git a/roles/matrix-postgres/tasks/import_generic_sqlite_db.yml b/roles/matrix-postgres/tasks/import_generic_sqlite_db.yml index a42c6f552..2a673ee3f 100644 --- a/roles/matrix-postgres/tasks/import_generic_sqlite_db.yml +++ b/roles/matrix-postgres/tasks/import_generic_sqlite_db.yml @@ -57,7 +57,7 @@ service: name: matrix-postgres state: started - daemon_reload: yes + daemon_reload: true register: matrix_postgres_service_start_result - name: Wait a bit, so that Postgres can start diff --git a/roles/matrix-postgres/tasks/import_postgres.yml b/roles/matrix-postgres/tasks/import_postgres.yml index b8e932199..948c4b3aa 100644 --- a/roles/matrix-postgres/tasks/import_postgres.yml +++ b/roles/matrix-postgres/tasks/import_postgres.yml @@ -48,7 +48,7 @@ service: name: matrix-postgres state: started - daemon_reload: yes + daemon_reload: true - name: Wait a bit, so that Postgres can start wait_for: diff --git a/roles/matrix-postgres/tasks/import_synapse_sqlite_db.yml b/roles/matrix-postgres/tasks/import_synapse_sqlite_db.yml index ea15c5a86..2dafba591 100644 --- a/roles/matrix-postgres/tasks/import_synapse_sqlite_db.yml +++ b/roles/matrix-postgres/tasks/import_synapse_sqlite_db.yml @@ -37,7 +37,7 @@ service: name: matrix-postgres state: stopped - daemon_reload: yes + daemon_reload: true - name: Ensure postgres data is wiped out file: @@ -56,7 +56,7 @@ service: name: matrix-postgres state: restarted - daemon_reload: yes + daemon_reload: true - name: Wait a bit, so that Postgres can start wait_for: diff --git a/roles/matrix-postgres/tasks/init.yml b/roles/matrix-postgres/tasks/init.yml index a0f2ae60f..e5ebd9c56 100644 --- a/roles/matrix-postgres/tasks/init.yml +++ b/roles/matrix-postgres/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-postgres.service'] }}" when: matrix_postgres_enabled|bool diff --git a/roles/matrix-postgres/tasks/main.yml b/roles/matrix-postgres/tasks/main.yml index b9c2ae7c9..79890417f 100644 --- a/roles/matrix-postgres/tasks/main.yml +++ b/roles/matrix-postgres/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-postgres/tasks/migrate_postgres_data_directory.yml b/roles/matrix-postgres/tasks/migrate_postgres_data_directory.yml index e62feee39..f927783fa 100644 --- a/roles/matrix-postgres/tasks/migrate_postgres_data_directory.yml +++ b/roles/matrix-postgres/tasks/migrate_postgres_data_directory.yml @@ -29,7 +29,7 @@ service: name: matrix-postgres state: stopped - daemon_reload: yes + daemon_reload: true when: "result_pg_old_data_dir_stat.stat.exists" - name: Find files and directories in old Postgres data path @@ -68,5 +68,5 @@ - name: Ensure systemd reloaded after getting rid of outdated matrix-postgres.service service: - daemon_reload: yes + daemon_reload: true when: "result_pg_old_data_dir_stat.stat.exists" diff --git a/roles/matrix-postgres/tasks/run_vacuum.yml b/roles/matrix-postgres/tasks/run_vacuum.yml index 19a27562f..0b7a60f81 100644 --- a/roles/matrix-postgres/tasks/run_vacuum.yml +++ b/roles/matrix-postgres/tasks/run_vacuum.yml @@ -27,7 +27,7 @@ service: name: matrix-postgres state: started - daemon_reload: yes + daemon_reload: true - name: Wait a bit, so that Postgres can start wait_for: @@ -71,7 +71,7 @@ service: name: matrix-synapse state: stopped - daemon_reload: yes + daemon_reload: true - name: Run Postgres vacuum command command: "{{ matrix_postgres_vacuum_command }}" @@ -86,5 +86,5 @@ service: name: matrix-synapse state: started - daemon_reload: yes + daemon_reload: true when: "matrix_postgres_synapse_was_running|bool" diff --git a/roles/matrix-postgres/tasks/setup_postgres.yml b/roles/matrix-postgres/tasks/setup_postgres.yml index 96a20d254..dc170460d 100644 --- a/roles/matrix-postgres/tasks/setup_postgres.yml +++ b/roles/matrix-postgres/tasks/setup_postgres.yml @@ -65,7 +65,7 @@ state: directory owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" - recurse: yes + recurse: true when: matrix_postgres_enabled|bool - name: Ensure Postgres environment variables file created @@ -115,7 +115,7 @@ - name: Ensure systemd reloaded after matrix-postgres.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_postgres_enabled|bool and matrix_postgres_systemd_service_result.changed" - include_tasks: @@ -158,7 +158,7 @@ service: name: matrix-postgres state: stopped - daemon_reload: yes + daemon_reload: true when: "not matrix_postgres_enabled|bool and matrix_postgres_service_stat.stat.exists" - name: Ensure matrix-postgres.service doesn't exist @@ -169,7 +169,7 @@ - name: Ensure systemd reloaded after matrix-postgres.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_postgres_enabled|bool and matrix_postgres_service_stat.stat.exists" - name: Check existence of matrix-postgres local data path diff --git a/roles/matrix-postgres/tasks/upgrade_postgres.yml b/roles/matrix-postgres/tasks/upgrade_postgres.yml index 564265d85..bf98d938a 100644 --- a/roles/matrix-postgres/tasks/upgrade_postgres.yml +++ b/roles/matrix-postgres/tasks/upgrade_postgres.yml @@ -64,7 +64,7 @@ service: name: matrix-postgres state: started - daemon_reload: yes + daemon_reload: true - name: Wait a bit, so that Postgres can start wait_for: @@ -107,9 +107,9 @@ - name: Ensure matrix-postgres autoruns and is restarted service: name: matrix-postgres - enabled: yes + enabled: true state: restarted - daemon_reload: yes + daemon_reload: true - name: Wait a bit, so that Postgres can start wait_for: @@ -166,7 +166,7 @@ service: name: matrix-synapse state: started - daemon_reload: yes + daemon_reload: true - debug: msg: "NOTE: Your old Postgres data directory is preserved at `{{ postgres_auto_upgrade_backup_data_path }}`. You might want to get rid of it once you've confirmed that all is well." diff --git a/roles/matrix-postgres/tasks/util/create_additional_databases.yml b/roles/matrix-postgres/tasks/util/create_additional_databases.yml index 0ad460ddd..de87f98c4 100644 --- a/roles/matrix-postgres/tasks/util/create_additional_databases.yml +++ b/roles/matrix-postgres/tasks/util/create_additional_databases.yml @@ -4,7 +4,7 @@ service: name: matrix-postgres state: started - daemon_reload: yes + daemon_reload: true register: matrix_postgres_service_start_result - name: Wait a bit, so that Postgres can start diff --git a/roles/matrix-postgres/tasks/util/migrate_db_to_postgres.yml b/roles/matrix-postgres/tasks/util/migrate_db_to_postgres.yml index cf595ade2..73acb4330 100644 --- a/roles/matrix-postgres/tasks/util/migrate_db_to_postgres.yml +++ b/roles/matrix-postgres/tasks/util/migrate_db_to_postgres.yml @@ -66,7 +66,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_postgres_pgloader_container_image_self_build_src_path }}" - pull: yes + pull: true when: "matrix_postgres_pgloader_container_image_self_build|bool" - name: Ensure pgloader Docker image is pulled @@ -91,7 +91,7 @@ service: name: matrix-postgres state: started - daemon_reload: yes + daemon_reload: true register: matrix_postgres_service_start_result - name: Wait a bit, so that Postgres can start diff --git a/roles/matrix-prometheus-node-exporter/defaults/main.yml b/roles/matrix-prometheus-node-exporter/defaults/main.yml index 2ec0d23c6..5e50a1d77 100644 --- a/roles/matrix-prometheus-node-exporter/defaults/main.yml +++ b/roles/matrix-prometheus-node-exporter/defaults/main.yml @@ -1,3 +1,4 @@ +--- # matrix-prometheus-node-exporter is an Prometheus exporter for machine metrics # See: https://prometheus.io/docs/guides/node-exporter/ diff --git a/roles/matrix-prometheus-node-exporter/tasks/init.yml b/roles/matrix-prometheus-node-exporter/tasks/init.yml index 2894b7176..db44a7ab9 100644 --- a/roles/matrix-prometheus-node-exporter/tasks/init.yml +++ b/roles/matrix-prometheus-node-exporter/tasks/init.yml @@ -1,5 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-prometheus-node-exporter.service'] }}" when: matrix_prometheus_node_exporter_enabled|bool - - diff --git a/roles/matrix-prometheus-node-exporter/tasks/main.yml b/roles/matrix-prometheus-node-exporter/tasks/main.yml index 172b57215..71bbb8d74 100644 --- a/roles/matrix-prometheus-node-exporter/tasks/main.yml +++ b/roles/matrix-prometheus-node-exporter/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-prometheus-node-exporter/tasks/setup.yml b/roles/matrix-prometheus-node-exporter/tasks/setup.yml index fa8eb7675..419f3592b 100644 --- a/roles/matrix-prometheus-node-exporter/tasks/setup.yml +++ b/roles/matrix-prometheus-node-exporter/tasks/setup.yml @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-prometheus.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_prometheus_node_exporter_enabled|bool and matrix_prometheus_node_exporter_systemd_service_result.changed" # @@ -38,8 +38,8 @@ service: name: matrix-prometheus-node-exporter state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "not matrix_prometheus_node_exporter_enabled|bool and matrix_prometheus_node_exporter_service_stat.stat.exists" @@ -51,5 +51,5 @@ - name: Ensure systemd reloaded after matrix-prometheus-node-exporter.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_prometheus_node_exporter_enabled|bool and matrix_prometheus_node_exporter_service_stat.stat.exists" diff --git a/roles/matrix-prometheus-postgres-exporter/defaults/main.yml b/roles/matrix-prometheus-postgres-exporter/defaults/main.yml index 338f58d3a..c96a6ea84 100644 --- a/roles/matrix-prometheus-postgres-exporter/defaults/main.yml +++ b/roles/matrix-prometheus-postgres-exporter/defaults/main.yml @@ -1,3 +1,4 @@ +--- # matrix-prometheus-postgres-exporter is an Prometheus exporter for postgres metrics # See: https://github.com/prometheus-community/postgres_exporter @@ -11,8 +12,8 @@ matrix_prometheus_postgres_exporter_docker_image_force_pull: "{{ matrix_promethe # A list of extra arguments to pass to the container matrix_prometheus_postgres_exporter_container_extra_arguments: ["-e PG_EXPORTER_AUTO_DISCOVER_DATABASES=true", - "-e PG_EXPORTER_WEB_LISTEN_ADDRESS=\":{{matrix_prometheus_postgres_exporter_port}}\"", - "-e DATA_SOURCE_NAME=\"postgresql://{{matrix_prometheus_postgres_exporter_database_username}}:{{matrix_prometheus_postgres_exporter_database_password}}@{{matrix_prometheus_postgres_exporter_database_hostname}}:5432/{{matrix_prometheus_postgres_exporter_database_name}}?sslmode=disable\"" ] + "-e PG_EXPORTER_WEB_LISTEN_ADDRESS=\":{{matrix_prometheus_postgres_exporter_port}}\"", + "-e DATA_SOURCE_NAME=\"postgresql://{{matrix_prometheus_postgres_exporter_database_username}}:{{matrix_prometheus_postgres_exporter_database_password}}@{{matrix_prometheus_postgres_exporter_database_hostname}}:5432/{{matrix_prometheus_postgres_exporter_database_name}}?sslmode=disable\""] # List of systemd services that matrix-prometheus-postgres-exporter.service depends on matrix_prometheus_postgres_exporter_systemd_required_services_list: ['docker.service'] @@ -46,4 +47,4 @@ matrix_prometheus_postgres_exporter_database_name: 'matrix_prometheus_postgres_e matrix_prometheus_postgres_exporter_container_http_host_bind_port: '' matrix_prometheus_postgres_exporter_dashboard_urls: -- "https://grafana.com/api/dashboards/9628/revisions/7/download" \ No newline at end of file + - "https://grafana.com/api/dashboards/9628/revisions/7/download" diff --git a/roles/matrix-prometheus-postgres-exporter/tasks/init.yml b/roles/matrix-prometheus-postgres-exporter/tasks/init.yml index 2bd6904ec..ddea23ab1 100644 --- a/roles/matrix-prometheus-postgres-exporter/tasks/init.yml +++ b/roles/matrix-prometheus-postgres-exporter/tasks/init.yml @@ -1,5 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-prometheus-postgres-exporter.service'] }}" when: matrix_prometheus_postgres_exporter_enabled|bool - - diff --git a/roles/matrix-prometheus-postgres-exporter/tasks/main.yml b/roles/matrix-prometheus-postgres-exporter/tasks/main.yml index e3c364fa9..e94970995 100644 --- a/roles/matrix-prometheus-postgres-exporter/tasks/main.yml +++ b/roles/matrix-prometheus-postgres-exporter/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-prometheus-postgres-exporter/tasks/setup.yml b/roles/matrix-prometheus-postgres-exporter/tasks/setup.yml index 37743b66f..a6c49816c 100644 --- a/roles/matrix-prometheus-postgres-exporter/tasks/setup.yml +++ b/roles/matrix-prometheus-postgres-exporter/tasks/setup.yml @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-prometheus.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_prometheus_postgres_exporter_enabled|bool and matrix_prometheus_postgres_exporter_systemd_service_result.changed" # @@ -38,8 +38,8 @@ service: name: matrix-prometheus-postgres-exporter state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "not matrix_prometheus_postgres_exporter_enabled|bool and matrix_prometheus_postgres_exporter_service_stat.stat.exists" @@ -51,5 +51,5 @@ - name: Ensure systemd reloaded after matrix-prometheus-postgres-exporter.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_prometheus_postgres_exporter_enabled|bool and matrix_prometheus_postgres_exporter_service_stat.stat.exists" diff --git a/roles/matrix-prometheus/defaults/main.yml b/roles/matrix-prometheus/defaults/main.yml index d76ce7442..ed52ea160 100644 --- a/roles/matrix-prometheus/defaults/main.yml +++ b/roles/matrix-prometheus/defaults/main.yml @@ -1,3 +1,4 @@ +--- # matrix-prometheus is an open-source systems monitoring and alerting toolkit # See: https://github.com/matrix-org/synapse/blob/master/docs/metrics-howto.md diff --git a/roles/matrix-prometheus/tasks/init.yml b/roles/matrix-prometheus/tasks/init.yml index 12fae831a..6587ddd91 100644 --- a/roles/matrix-prometheus/tasks/init.yml +++ b/roles/matrix-prometheus/tasks/init.yml @@ -1,5 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-prometheus.service'] }}" when: matrix_prometheus_enabled|bool - - diff --git a/roles/matrix-prometheus/tasks/main.yml b/roles/matrix-prometheus/tasks/main.yml index 20f18cc3b..c74918fa8 100644 --- a/roles/matrix-prometheus/tasks/main.yml +++ b/roles/matrix-prometheus/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-prometheus/tasks/setup_install.yml b/roles/matrix-prometheus/tasks/setup_install.yml index 15a692797..80f3e5d75 100644 --- a/roles/matrix-prometheus/tasks/setup_install.yml +++ b/roles/matrix-prometheus/tasks/setup_install.yml @@ -46,5 +46,5 @@ - name: Ensure systemd reloaded after matrix-prometheus.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_prometheus_systemd_service_result.changed|bool" diff --git a/roles/matrix-prometheus/tasks/setup_uninstall.yml b/roles/matrix-prometheus/tasks/setup_uninstall.yml index d99c1a8e4..c9f07f52e 100644 --- a/roles/matrix-prometheus/tasks/setup_uninstall.yml +++ b/roles/matrix-prometheus/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-prometheus state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_prometheus_service_stat.stat.exists|bool" @@ -22,5 +22,5 @@ - name: Ensure systemd reloaded after matrix-prometheus.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_prometheus_service_stat.stat.exists|bool" diff --git a/roles/matrix-redis/defaults/main.yml b/roles/matrix-redis/defaults/main.yml index 355679d05..88d3d7397 100644 --- a/roles/matrix-redis/defaults/main.yml +++ b/roles/matrix-redis/defaults/main.yml @@ -1,3 +1,5 @@ +--- + matrix_redis_enabled: true matrix_redis_connection_password: "" diff --git a/roles/matrix-redis/tasks/init.yml b/roles/matrix-redis/tasks/init.yml index 490688512..99c52026d 100644 --- a/roles/matrix-redis/tasks/init.yml +++ b/roles/matrix-redis/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-redis'] }}" when: matrix_redis_enabled|bool diff --git a/roles/matrix-redis/tasks/main.yml b/roles/matrix-redis/tasks/main.yml index 595b09f55..430b6a646 100644 --- a/roles/matrix-redis/tasks/main.yml +++ b/roles/matrix-redis/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-redis/tasks/setup_redis.yml b/roles/matrix-redis/tasks/setup_redis.yml index f1f32238f..a37174a38 100644 --- a/roles/matrix-redis/tasks/setup_redis.yml +++ b/roles/matrix-redis/tasks/setup_redis.yml @@ -33,7 +33,7 @@ state: directory owner: "{{ matrix_user_username }}" group: "{{ matrix_user_username }}" - recurse: yes + recurse: true when: matrix_redis_enabled|bool - name: Ensure redis environment variables file created @@ -55,7 +55,7 @@ - name: Ensure systemd reloaded after matrix-redis.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_redis_enabled|bool and matrix_redis_systemd_service_result.changed" # @@ -72,8 +72,8 @@ service: name: matrix-redis state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true when: "not matrix_redis_enabled|bool and matrix_redis_service_stat.stat.exists" - name: Ensure matrix-redis.service doesn't exist @@ -84,7 +84,7 @@ - name: Ensure systemd reloaded after matrix-redis.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_redis_enabled|bool and matrix_redis_service_stat.stat.exists" - name: Check existence of matrix-redis local data path diff --git a/roles/matrix-registration/defaults/main.yml b/roles/matrix-registration/defaults/main.yml index 4705fb5eb..d924551a1 100644 --- a/roles/matrix-registration/defaults/main.yml +++ b/roles/matrix-registration/defaults/main.yml @@ -1,3 +1,4 @@ +--- # matrix-registration is a simple python application to have a token based matrix registration # See: https://zeratax.github.io/matrix-registration/ diff --git a/roles/matrix-registration/tasks/generate_token.yml b/roles/matrix-registration/tasks/generate_token.yml index ae5bdf4c2..4e337b016 100644 --- a/roles/matrix-registration/tasks/generate_token.yml +++ b/roles/matrix-registration/tasks/generate_token.yml @@ -1,3 +1,5 @@ +--- + - name: Fail if playbook called incorrectly fail: msg: "The `one_time` variable needs to be provided to this playbook, via --extra-vars" @@ -23,7 +25,7 @@ "one_time": {{ 'true' if one_time == 'yes' else 'false' }}, "ex_date": {{ ex_date|to_json }} } - check_mode: no + check_mode: false register: matrix_registration_api_result - set_fact: @@ -37,7 +39,7 @@ Full token details are: {{ matrix_registration_api_result.json }} - check_mode: no + check_mode: false - name: Inject result message into matrix_playbook_runtime_results set_fact: @@ -47,4 +49,4 @@ + [matrix_registration_api_result_message] }} - check_mode: no + check_mode: false diff --git a/roles/matrix-registration/tasks/init.yml b/roles/matrix-registration/tasks/init.yml index 47220103b..cae182587 100644 --- a/roles/matrix-registration/tasks/init.yml +++ b/roles/matrix-registration/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 @@ -10,49 +11,49 @@ when: matrix_registration_enabled|bool - block: - - name: Fail if matrix-nginx-proxy role already executed - fail: - msg: >- - Trying to append matrix-registration's reverse-proxying configuration to matrix-nginx-proxy, - 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-registration role. - when: matrix_nginx_proxy_role_executed|default(False)|bool + - name: Fail if matrix-nginx-proxy role already executed + fail: + msg: >- + Trying to append matrix-registration's reverse-proxying configuration to matrix-nginx-proxy, + 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-registration role. + when: matrix_nginx_proxy_role_executed|default(False)|bool - - name: Generate matrix-registration proxying configuration for matrix-nginx-proxy - set_fact: - matrix_registration_matrix_nginx_proxy_configuration: | - rewrite ^{{ matrix_registration_public_endpoint }}$ {{ matrix_nginx_proxy_x_forwarded_proto_value }}://$server_name{{ matrix_registration_public_endpoint }}/ permanent; - rewrite ^{{ matrix_registration_public_endpoint }}/$ {{ matrix_nginx_proxy_x_forwarded_proto_value }}://$server_name{{ matrix_registration_public_endpoint }}/register redirect; + - name: Generate matrix-registration proxying configuration for matrix-nginx-proxy + set_fact: + matrix_registration_matrix_nginx_proxy_configuration: | + rewrite ^{{ matrix_registration_public_endpoint }}$ {{ matrix_nginx_proxy_x_forwarded_proto_value }}://$server_name{{ matrix_registration_public_endpoint }}/ permanent; + rewrite ^{{ matrix_registration_public_endpoint }}/$ {{ matrix_nginx_proxy_x_forwarded_proto_value }}://$server_name{{ matrix_registration_public_endpoint }}/register redirect; - location ~ ^{{ matrix_registration_public_endpoint }}/(.*) { - {% 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-registration:5000"; - proxy_pass http://$backend/$1; - {% else %} - {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:8767/$1; - {% endif %} + location ~ ^{{ matrix_registration_public_endpoint }}/(.*) { + {% 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-registration:5000"; + proxy_pass http://$backend/$1; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://127.0.0.1:8767/$1; + {% endif %} - {# - Workaround matrix-registration serving the background image at /static - (see https://github.com/ZerataX/matrix-registration/issues/47) - #} - sub_filter_once off; - sub_filter_types text/css; - sub_filter "/static/" "{{ matrix_registration_public_endpoint }}/static/"; - } + {# + Workaround matrix-registration serving the background image at /static + (see https://github.com/ZerataX/matrix-registration/issues/47) + #} + sub_filter_once off; + sub_filter_types text/css; + sub_filter "/static/" "{{ matrix_registration_public_endpoint }}/static/"; + } - - name: Register matrix-registration proxying configuration with matrix-nginx-proxy - set_fact: - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | - {{ - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) - + - [matrix_registration_matrix_nginx_proxy_configuration] - }} + - name: Register matrix-registration proxying configuration with matrix-nginx-proxy + set_fact: + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | + {{ + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) + + + [matrix_registration_matrix_nginx_proxy_configuration] + }} tags: - always when: matrix_registration_enabled|bool diff --git a/roles/matrix-registration/tasks/list_tokens.yml b/roles/matrix-registration/tasks/list_tokens.yml index dea3eb31f..9ef40d274 100644 --- a/roles/matrix-registration/tasks/list_tokens.yml +++ b/roles/matrix-registration/tasks/list_tokens.yml @@ -1,3 +1,5 @@ +--- + - name: Call matrix-registration list all tokens API uri: url: "{{ matrix_registration_api_token_endpoint }}" @@ -8,7 +10,7 @@ Authorization: "SharedSecret {{ matrix_registration_admin_secret }}" method: GET body_format: json - check_mode: no + check_mode: false register: matrix_registration_api_result - set_fact: @@ -16,7 +18,7 @@ matrix-registration result: {{ matrix_registration_api_result.json | to_nice_json }} - check_mode: no + check_mode: false - name: Inject result message into matrix_playbook_runtime_results set_fact: @@ -26,4 +28,4 @@ + [matrix_registration_api_result_message] }} - check_mode: no + check_mode: false diff --git a/roles/matrix-registration/tasks/main.yml b/roles/matrix-registration/tasks/main.yml index 3324e083b..ca5743846 100644 --- a/roles/matrix-registration/tasks/main.yml +++ b/roles/matrix-registration/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-registration/tasks/setup_install.yml b/roles/matrix-registration/tasks/setup_install.yml index 0d7da9cee..31e9c35d6 100644 --- a/roles/matrix-registration/tasks/setup_install.yml +++ b/roles/matrix-registration/tasks/setup_install.yml @@ -39,10 +39,10 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_registration_base_path }}", when: true } - - { path: "{{ matrix_registration_config_path }}", when: true } - - { path: "{{ matrix_registration_data_path }}", when: true } - - { path: "{{ matrix_registration_docker_src_files_path }}", when: "{{ matrix_registration_container_image_self_build }}"} + - {path: "{{ matrix_registration_base_path }}", when: true} + - {path: "{{ matrix_registration_config_path }}", when: true} + - {path: "{{ matrix_registration_data_path }}", when: true} + - {path: "{{ matrix_registration_docker_src_files_path }}", when: "{{ matrix_registration_container_image_self_build }}"} when: "item.when|bool" - name: Ensure matrix-registration image is pulled @@ -71,7 +71,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_registration_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_registration_container_image_self_build|bool" - name: Ensure matrix-registration config installed @@ -91,7 +91,7 @@ - name: Ensure systemd reloaded after matrix-registration.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_registration_systemd_service_result.changed|bool" - name: Ensure matrix-registration.service restarted, if necessary diff --git a/roles/matrix-registration/tasks/setup_uninstall.yml b/roles/matrix-registration/tasks/setup_uninstall.yml index 8afd10849..4b7c195fe 100644 --- a/roles/matrix-registration/tasks/setup_uninstall.yml +++ b/roles/matrix-registration/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-registration state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_registration_service_stat.stat.exists|bool" @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-registration.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_registration_service_stat.stat.exists|bool" - name: Ensure matrix-registration Docker image doesn't exist diff --git a/roles/matrix-sygnal/defaults/main.yml b/roles/matrix-sygnal/defaults/main.yml index 595f8022f..15bce68c1 100644 --- a/roles/matrix-sygnal/defaults/main.yml +++ b/roles/matrix-sygnal/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Sygnal is a reference Push Gateway for Matrix. # To make use of it for delivering push notificatins, you'll need to develop/build your own Matrix app. # Learn more here: https://github.com/matrix-org/sygnal diff --git a/roles/matrix-sygnal/tasks/init.yml b/roles/matrix-sygnal/tasks/init.yml index 559a3681d..efa17a4d6 100644 --- a/roles/matrix-sygnal/tasks/init.yml +++ b/roles/matrix-sygnal/tasks/init.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-sygnal.service'] }}" when: matrix_sygnal_enabled|bool diff --git a/roles/matrix-sygnal/tasks/main.yml b/roles/matrix-sygnal/tasks/main.yml index c00862a4b..385798225 100644 --- a/roles/matrix-sygnal/tasks/main.yml +++ b/roles/matrix-sygnal/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-sygnal/tasks/setup_install.yml b/roles/matrix-sygnal/tasks/setup_install.yml index b85b6bfff..cd54a51de 100644 --- a/roles/matrix-sygnal/tasks/setup_install.yml +++ b/roles/matrix-sygnal/tasks/setup_install.yml @@ -36,5 +36,5 @@ - name: Ensure systemd reloaded after matrix-sygnal.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_sygnal_systemd_service_result.changed|bool" diff --git a/roles/matrix-sygnal/tasks/setup_uninstall.yml b/roles/matrix-sygnal/tasks/setup_uninstall.yml index f2b6133f7..5a81a1b29 100644 --- a/roles/matrix-sygnal/tasks/setup_uninstall.yml +++ b/roles/matrix-sygnal/tasks/setup_uninstall.yml @@ -9,8 +9,8 @@ service: name: matrix-sygnal state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_sygnal_service_stat.stat.exists|bool" @@ -22,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-sygnal.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_sygnal_service_stat.stat.exists|bool" - name: Ensure Sygnal base directory doesn't exist diff --git a/roles/matrix-sygnal/tasks/validate_config.yml b/roles/matrix-sygnal/tasks/validate_config.yml index 1cf8357ee..2121edf45 100644 --- a/roles/matrix-sygnal/tasks/validate_config.yml +++ b/roles/matrix-sygnal/tasks/validate_config.yml @@ -1,3 +1,5 @@ +--- + - name: Fail if no Sygnal apps defined fail: msg: >- diff --git a/roles/matrix-synapse-admin/defaults/main.yml b/roles/matrix-synapse-admin/defaults/main.yml index db1024fac..6ad6bd161 100644 --- a/roles/matrix-synapse-admin/defaults/main.yml +++ b/roles/matrix-synapse-admin/defaults/main.yml @@ -1,3 +1,4 @@ +--- # matrix-synapse-admin is a web UI for mananging the Synapse Matrix server # See: https://github.com/Awesome-Technologies/synapse-admin diff --git a/roles/matrix-synapse-admin/tasks/init.yml b/roles/matrix-synapse-admin/tasks/init.yml index 3ce5a6935..ccaa03f60 100644 --- a/roles/matrix-synapse-admin/tasks/init.yml +++ b/roles/matrix-synapse-admin/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 @@ -10,40 +11,40 @@ when: matrix_synapse_admin_enabled|bool - block: - - name: Fail if matrix-nginx-proxy role already executed - fail: - msg: >- - Trying to append Synapse Admin's reverse-proxying configuration to matrix-nginx-proxy, - 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-admin role. - when: matrix_nginx_proxy_role_executed|default(False)|bool + - name: Fail if matrix-nginx-proxy role already executed + fail: + msg: >- + Trying to append Synapse Admin's reverse-proxying configuration to matrix-nginx-proxy, + 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-admin role. + when: matrix_nginx_proxy_role_executed|default(False)|bool - - name: Generate Synapse Admin proxying configuration for matrix-nginx-proxy - set_fact: - matrix_synapse_admin_matrix_nginx_proxy_configuration: | - rewrite ^{{ matrix_synapse_admin_public_endpoint }}$ {{ matrix_nginx_proxy_x_forwarded_proto_value }}://$server_name{{ matrix_synapse_admin_public_endpoint }}/ permanent; + - name: Generate Synapse Admin proxying configuration for matrix-nginx-proxy + set_fact: + matrix_synapse_admin_matrix_nginx_proxy_configuration: | + rewrite ^{{ matrix_synapse_admin_public_endpoint }}$ {{ matrix_nginx_proxy_x_forwarded_proto_value }}://$server_name{{ matrix_synapse_admin_public_endpoint }}/ permanent; - location ~ ^{{ matrix_synapse_admin_public_endpoint }}/(.*) { - {% 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-admin:80"; - proxy_pass http://$backend/$1; - {% else %} - {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:8766/$1; - {% endif %} - } + location ~ ^{{ matrix_synapse_admin_public_endpoint }}/(.*) { + {% 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-admin:80"; + proxy_pass http://$backend/$1; + {% else %} + {# Generic configuration for use outside of our container setup #} + proxy_pass http://127.0.0.1:8766/$1; + {% endif %} + } - - name: Register Synapse Admin proxying configuration with matrix-nginx-proxy - set_fact: - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | - {{ - matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) - + - [matrix_synapse_admin_matrix_nginx_proxy_configuration] - }} + - name: Register Synapse Admin proxying configuration with matrix-nginx-proxy + set_fact: + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | + {{ + matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([]) + + + [matrix_synapse_admin_matrix_nginx_proxy_configuration] + }} tags: - always when: matrix_synapse_admin_enabled|bool diff --git a/roles/matrix-synapse-admin/tasks/main.yml b/roles/matrix-synapse-admin/tasks/main.yml index b5cb16893..0095f753a 100644 --- a/roles/matrix-synapse-admin/tasks/main.yml +++ b/roles/matrix-synapse-admin/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always diff --git a/roles/matrix-synapse-admin/tasks/setup.yml b/roles/matrix-synapse-admin/tasks/setup.yml index 9eac7f903..ab1e6d466 100644 --- a/roles/matrix-synapse-admin/tasks/setup.yml +++ b/roles/matrix-synapse-admin/tasks/setup.yml @@ -30,7 +30,7 @@ build: dockerfile: Dockerfile path: "{{ matrix_synapse_admin_docker_src_files_path }}" - pull: yes + pull: true when: "matrix_synapse_admin_enabled|bool and matrix_synapse_admin_container_image_self_build|bool" - name: Ensure matrix-synapse-admin.service installed @@ -43,7 +43,7 @@ - name: Ensure systemd reloaded after matrix-synapse-admin.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_synapse_admin_enabled|bool and matrix_synapse_admin_systemd_service_result.changed" # @@ -59,8 +59,8 @@ service: name: matrix-synapse-admin state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "not matrix_synapse_admin_enabled|bool and matrix_synapse_admin_service_stat.stat.exists" @@ -72,7 +72,7 @@ - name: Ensure systemd reloaded after matrix-synapse-admin.service removal service: - daemon_reload: yes + daemon_reload: true when: "not matrix_synapse_admin_enabled|bool and matrix_synapse_admin_service_stat.stat.exists" - name: Ensure matrix-synapse-admin Docker image doesn't exist diff --git a/roles/matrix-synapse/defaults/main.yml b/roles/matrix-synapse/defaults/main.yml index 364f26a56..80a1e0f23 100644 --- a/roles/matrix-synapse/defaults/main.yml +++ b/roles/matrix-synapse/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Synapse is a Matrix homeserver # See: https://github.com/matrix-org/synapse @@ -471,7 +472,7 @@ matrix_synapse_database_database: "synapse" matrix_synapse_turn_uris: [] matrix_synapse_turn_shared_secret: "" -matrix_synapse_turn_allow_guests: False +matrix_synapse_turn_allow_guests: false matrix_synapse_email_enabled: false matrix_synapse_email_smtp_host: "" @@ -582,7 +583,7 @@ matrix_synapse_spam_checker: [] matrix_synapse_modules: [] -matrix_synapse_encryption_enabled_by_default_for_room_type: off +matrix_synapse_encryption_enabled_by_default_for_room_type: false matrix_synapse_trusted_key_servers: - server_name: "matrix.org" diff --git a/roles/matrix-synapse/tasks/ext/ldap-auth/setup.yml b/roles/matrix-synapse/tasks/ext/ldap-auth/setup.yml index e760626dc..374c9e55d 100644 --- a/roles/matrix-synapse/tasks/ext/ldap-auth/setup.yml +++ b/roles/matrix-synapse/tasks/ext/ldap-auth/setup.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_synapse_password_providers_enabled: true diff --git a/roles/matrix-synapse/tasks/ext/mjolnir-antispam/setup_install.yml b/roles/matrix-synapse/tasks/ext/mjolnir-antispam/setup_install.yml index a416e42ba..ec298ccd2 100644 --- a/roles/matrix-synapse/tasks/ext/mjolnir-antispam/setup_install.yml +++ b/roles/matrix-synapse/tasks/ext/mjolnir-antispam/setup_install.yml @@ -5,7 +5,7 @@ name: - git state: present - update_cache: no + update_cache: false when: "ansible_os_family == 'RedHat'" - name: Ensure git installed (Debian) @@ -13,7 +13,7 @@ name: - git state: present - update_cache: no + update_cache: false when: "ansible_os_family == 'Debian'" - name: Ensure git installed (Archlinux) @@ -21,7 +21,7 @@ name: - git state: present - update_cache: no + update_cache: false when: "ansible_distribution == 'Archlinux'" - name: Clone mjolnir-antispam git repository diff --git a/roles/matrix-synapse/tasks/ext/synapse-simple-antispam/setup_install.yml b/roles/matrix-synapse/tasks/ext/synapse-simple-antispam/setup_install.yml index 706cc5882..740d9474c 100644 --- a/roles/matrix-synapse/tasks/ext/synapse-simple-antispam/setup_install.yml +++ b/roles/matrix-synapse/tasks/ext/synapse-simple-antispam/setup_install.yml @@ -10,7 +10,7 @@ name: - git state: present - update_cache: no + update_cache: false when: "ansible_os_family == 'RedHat'" - name: Ensure git installed (Debian) @@ -18,7 +18,7 @@ name: - git state: present - update_cache: no + update_cache: false when: "ansible_os_family == 'Debian'" - name: Ensure git installed (Archlinux) @@ -26,7 +26,7 @@ name: - git state: present - update_cache: no + update_cache: false when: "ansible_distribution == 'Archlinux'" - name: Clone synapse-simple-antispam git repository diff --git a/roles/matrix-synapse/tasks/goofys/setup_install.yml b/roles/matrix-synapse/tasks/goofys/setup_install.yml index 147efabfd..9e3870e5c 100644 --- a/roles/matrix-synapse/tasks/goofys/setup_install.yml +++ b/roles/matrix-synapse/tasks/goofys/setup_install.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_fuse_installed.yml" - name: Ensure Goofys Docker image is pulled @@ -12,7 +14,7 @@ stat: path: "{{ matrix_s3_media_store_path }}" register: local_path_matrix_s3_media_store_path_stat - ignore_errors: yes + ignore_errors: true - name: Ensure Matrix Goofys external storage mountpoint exists file: @@ -39,5 +41,5 @@ - name: Ensure systemd reloaded after matrix-goofys.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_goofys_systemd_service_result.changed" diff --git a/roles/matrix-synapse/tasks/goofys/setup_uninstall.yml b/roles/matrix-synapse/tasks/goofys/setup_uninstall.yml index 317a5371e..c00206eff 100644 --- a/roles/matrix-synapse/tasks/goofys/setup_uninstall.yml +++ b/roles/matrix-synapse/tasks/goofys/setup_uninstall.yml @@ -1,3 +1,5 @@ +--- + - name: Check existence of matrix-goofys service stat: path: "{{ matrix_systemd_path }}/matrix-goofys.service" @@ -7,8 +9,8 @@ service: name: matrix-goofys state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_goofys_service_stat.stat.exists" @@ -20,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-goofys.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_goofys_service_stat.stat.exists" - name: Ensure goofys environment variables file doesn't exist diff --git a/roles/matrix-synapse/tasks/import_media_store.yml b/roles/matrix-synapse/tasks/import_media_store.yml index 42455b44c..8e9626806 100644 --- a/roles/matrix-synapse/tasks/import_media_store.yml +++ b/roles/matrix-synapse/tasks/import_media_store.yml @@ -44,8 +44,8 @@ service: name: matrix-synapse state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result # This can only work with local files, not if the media store is on Amazon S3, @@ -54,11 +54,11 @@ synchronize: src: "{{ server_path_media_store }}/" dest: "{{ matrix_synapse_media_store_path }}" - delete: yes + delete: true # It's wasteful to preserve owner/group now. We chown below anyway. - owner: no - group: no - times: yes + owner: false + group: false + times: true delegate_to: "{{ inventory_hostname }}" # This is for the generic case and fails in other cases (remote file systems), @@ -68,7 +68,7 @@ path: "{{ matrix_synapse_media_store_path }}" owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" - recurse: yes + recurse: true when: "not matrix_s3_media_store_enabled|bool" # We don't chown for Goofys, because due to the way it's mounted, @@ -78,7 +78,7 @@ service: name: "{{ item }}" state: started - daemon_reload: yes + daemon_reload: true when: "stopping_result.changed" with_items: - matrix-synapse diff --git a/roles/matrix-synapse/tasks/init.yml b/roles/matrix-synapse/tasks/init.yml index bc23fc861..bee1783e2 100644 --- a/roles/matrix-synapse/tasks/init.yml +++ b/roles/matrix-synapse/tasks/init.yml @@ -1,3 +1,4 @@ +--- # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 # and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 - name: Fail if trying to self-build on Ansible < 2.8 diff --git a/roles/matrix-synapse/tasks/main.yml b/roles/matrix-synapse/tasks/main.yml index 17eef9ccd..552358434 100644 --- a/roles/matrix-synapse/tasks/main.yml +++ b/roles/matrix-synapse/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - import_tasks: "{{ role_path }}/tasks/init.yml" tags: - always @@ -52,4 +54,4 @@ set_fact: matrix_synapse_role_executed: true tags: - - always + - always diff --git a/roles/matrix-synapse/tasks/register_user.yml b/roles/matrix-synapse/tasks/register_user.yml index 9c2a3ea04..2a1c57082 100644 --- a/roles/matrix-synapse/tasks/register_user.yml +++ b/roles/matrix-synapse/tasks/register_user.yml @@ -19,7 +19,7 @@ service: name: matrix-synapse state: started - daemon_reload: yes + daemon_reload: true register: start_result - name: Wait a while, so that Synapse can manage to start diff --git a/roles/matrix-synapse/tasks/rust-synapse-compress-state/compress_room.yml b/roles/matrix-synapse/tasks/rust-synapse-compress-state/compress_room.yml index 46cad8083..36ef0a3a7 100644 --- a/roles/matrix-synapse/tasks/rust-synapse-compress-state/compress_room.yml +++ b/roles/matrix-synapse/tasks/rust-synapse-compress-state/compress_room.yml @@ -1,3 +1,5 @@ +--- + - debug: msg: "Compressing room `{{ room_details.room_id }}` having {{ room_details.count }} state group rows" diff --git a/roles/matrix-synapse/tasks/rust-synapse-compress-state/main.yml b/roles/matrix-synapse/tasks/rust-synapse-compress-state/main.yml index 106c59d5b..ad8497ccd 100644 --- a/roles/matrix-synapse/tasks/rust-synapse-compress-state/main.yml +++ b/roles/matrix-synapse/tasks/rust-synapse-compress-state/main.yml @@ -1,3 +1,4 @@ +--- # Pre-checks - name: Fail if Postgres not enabled @@ -80,12 +81,12 @@ # Row 3 contains a space when there's no result. - block: - - debug: var="matrix_synapse_rust_synapse_compress_state_find_rooms_command_result" + - debug: var="matrix_synapse_rust_synapse_compress_state_find_rooms_command_result" - - name: Fail if room find result is not what we expect - fail: - msg: >- - Expecting 4 lines in the "find rooms" result. + - name: Fail if room find result is not what we expect + fail: + msg: >- + Expecting 4 lines in the "find rooms" result. when: "matrix_synapse_rust_synapse_compress_state_find_rooms_command_result.failed or matrix_synapse_rust_synapse_compress_state_find_rooms_command_result.stdout_lines|length != 4" - block: diff --git a/roles/matrix-synapse/tasks/self_check_client_api.yml b/roles/matrix-synapse/tasks/self_check_client_api.yml index 30244d500..407a79ff6 100644 --- a/roles/matrix-synapse/tasks/self_check_client_api.yml +++ b/roles/matrix-synapse/tasks/self_check_client_api.yml @@ -7,7 +7,7 @@ validate_certs: "{{ matrix_synapse_self_check_validate_certificates }}" register: result_matrix_synapse_client_api ignore_errors: true - check_mode: no + check_mode: false when: matrix_synapse_enabled|bool - name: Fail if Matrix Client API not working diff --git a/roles/matrix-synapse/tasks/self_check_federation_api.yml b/roles/matrix-synapse/tasks/self_check_federation_api.yml index 57c9e56b1..322493721 100644 --- a/roles/matrix-synapse/tasks/self_check_federation_api.yml +++ b/roles/matrix-synapse/tasks/self_check_federation_api.yml @@ -7,7 +7,7 @@ validate_certs: "{{ matrix_synapse_self_check_validate_certificates }}" register: result_matrix_synapse_federation_api ignore_errors: true - check_mode: no + check_mode: false when: matrix_synapse_enabled|bool - name: Fail if Matrix Federation API not working @@ -17,7 +17,7 @@ - name: Fail if Matrix Federation API unexpectedly enabled fail: - msg: "Matrix Federation API is up at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_synapse_federation_api_url_endpoint_public }}`) despite being disabled." + 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" - name: Report working Matrix Federation API diff --git a/roles/matrix-synapse/tasks/setup_synapse.yml b/roles/matrix-synapse/tasks/setup_synapse.yml index f8bc05a1c..47e404f41 100644 --- a/roles/matrix-synapse/tasks/setup_synapse.yml +++ b/roles/matrix-synapse/tasks/setup_synapse.yml @@ -8,9 +8,9 @@ owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" with_items: - - { path: "{{ matrix_synapse_config_dir_path }}", when: true } - - { path: "{{ matrix_synapse_ext_path }}", when: true } - - { path: "{{ matrix_synapse_docker_src_files_path }}", when: "{{ matrix_synapse_container_image_self_build }}" } + - {path: "{{ matrix_synapse_config_dir_path }}", when: true} + - {path: "{{ matrix_synapse_ext_path }}", when: true} + - {path: "{{ matrix_synapse_docker_src_files_path }}", when: "{{ matrix_synapse_container_image_self_build }}"} # 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. diff --git a/roles/matrix-synapse/tasks/synapse/setup_install.yml b/roles/matrix-synapse/tasks/synapse/setup_install.yml index 8f96a54dc..7838b6249 100644 --- a/roles/matrix-synapse/tasks/synapse/setup_install.yml +++ b/roles/matrix-synapse/tasks/synapse/setup_install.yml @@ -5,7 +5,7 @@ stat: path: "{{ matrix_synapse_media_store_path }}" register: local_path_media_store_stat - ignore_errors: yes + ignore_errors: true # This is separate and conditional, to ensure we don't execute it # if the path already exists or we failed to check, because it's mounted using fuse. @@ -19,32 +19,32 @@ when: "not local_path_media_store_stat.failed and not local_path_media_store_stat.stat.exists" - block: - - name: Ensure Synapse repository is present on self-build - git: - repo: "{{ matrix_synapse_container_image_self_build_repo }}" - dest: "{{ matrix_synapse_docker_src_files_path }}" - version: "{{ matrix_synapse_docker_image.split(':')[1] }}" - force: "yes" - register: matrix_synapse_git_pull_results + - name: Ensure Synapse repository is present on self-build + git: + repo: "{{ matrix_synapse_container_image_self_build_repo }}" + dest: "{{ matrix_synapse_docker_src_files_path }}" + version: "{{ matrix_synapse_docker_image.split(':')[1] }}" + force: "yes" + register: matrix_synapse_git_pull_results - - name: Check if Synapse Docker image exists - command: "{{ matrix_host_command_docker }} images --quiet --filter 'reference={{ matrix_synapse_docker_image }}'" - register: matrix_synapse_docker_image_check_result + - name: Check if Synapse Docker image exists + command: "{{ matrix_host_command_docker }} images --quiet --filter 'reference={{ matrix_synapse_docker_image }}'" + register: matrix_synapse_docker_image_check_result - # Invoking the `docker build` command here, instead of calling the `docker_image` Ansible module, - # because the latter does not support BuildKit. - # See: https://github.com/ansible-collections/community.general/issues/514 - - name: Ensure Synapse Docker image is built - shell: - chdir: "{{ matrix_synapse_docker_src_files_path }}" - cmd: | - {{ matrix_host_command_docker }} build \ - -t "{{ matrix_synapse_docker_image }}" \ - -f docker/Dockerfile \ - . - environment: - DOCKER_BUILDKIT: 1 - when: "matrix_synapse_git_pull_results.changed|bool or matrix_synapse_docker_image_check_result.stdout == ''" + # Invoking the `docker build` command here, instead of calling the `docker_image` Ansible module, + # because the latter does not support BuildKit. + # See: https://github.com/ansible-collections/community.general/issues/514 + - name: Ensure Synapse Docker image is built + shell: + chdir: "{{ matrix_synapse_docker_src_files_path }}" + cmd: | + {{ matrix_host_command_docker }} build \ + -t "{{ matrix_synapse_docker_image }}" \ + -f docker/Dockerfile \ + . + 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" - name: Ensure Synapse Docker image is pulled @@ -105,7 +105,7 @@ - name: Ensure systemd reloaded after matrix-synapse.service installation service: - daemon_reload: yes + daemon_reload: true when: "matrix_synapse_systemd_service_result.changed" - name: Ensure matrix-synapse-register-user script created diff --git a/roles/matrix-synapse/tasks/synapse/setup_uninstall.yml b/roles/matrix-synapse/tasks/synapse/setup_uninstall.yml index 070856e48..911d12851 100644 --- a/roles/matrix-synapse/tasks/synapse/setup_uninstall.yml +++ b/roles/matrix-synapse/tasks/synapse/setup_uninstall.yml @@ -1,3 +1,5 @@ +--- + - name: Check existence of matrix-synapse service stat: path: "{{ matrix_systemd_path }}/matrix-synapse.service" @@ -7,8 +9,8 @@ service: name: matrix-synapse state: stopped - enabled: no - daemon_reload: yes + enabled: false + daemon_reload: true register: stopping_result when: "matrix_synapse_service_stat.stat.exists" @@ -20,7 +22,7 @@ - name: Ensure systemd reloaded after matrix-synapse.service removal service: - daemon_reload: yes + daemon_reload: true when: "matrix_synapse_service_stat.stat.exists" - name: Ensure Synapse Docker image doesn't exist diff --git a/roles/matrix-synapse/tasks/synapse/workers/init.yml b/roles/matrix-synapse/tasks/synapse/workers/init.yml index c6fc32c30..f59313bde 100644 --- a/roles/matrix-synapse/tasks/synapse/workers/init.yml +++ b/roles/matrix-synapse/tasks/synapse/workers/init.yml @@ -1,3 +1,4 @@ +--- # Below is a huge hack for dynamically building a list of workers and finally assigning it to `matrix_synapse_workers_enabled_list`. # # set_fact within a loop does not work reliably in Ansible (it only executes on the first iteration for some reason), diff --git a/roles/matrix-synapse/tasks/synapse/workers/setup_uninstall.yml b/roles/matrix-synapse/tasks/synapse/workers/setup_uninstall.yml index d0440d22d..f03576112 100644 --- a/roles/matrix-synapse/tasks/synapse/workers/setup_uninstall.yml +++ b/roles/matrix-synapse/tasks/synapse/workers/setup_uninstall.yml @@ -8,7 +8,7 @@ name: "{{ item.key }}" state: stopped 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 + 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: diff --git a/roles/matrix-synapse/tasks/synapse/workers/util/inject_systemd_services_for_worker.yml b/roles/matrix-synapse/tasks/synapse/workers/util/inject_systemd_services_for_worker.yml index 62b426257..2669e1491 100644 --- a/roles/matrix-synapse/tasks/synapse/workers/util/inject_systemd_services_for_worker.yml +++ b/roles/matrix-synapse/tasks/synapse/workers/util/inject_systemd_services_for_worker.yml @@ -1,3 +1,4 @@ +--- # The tasks below run before `validate_config.yml`. # To avoid failing with a cryptic error message, we'll do validation here. # diff --git a/roles/matrix-synapse/tasks/synapse/workers/util/setup_files_for_worker.yml b/roles/matrix-synapse/tasks/synapse/workers/util/setup_files_for_worker.yml index 93ed65751..2247cd894 100644 --- a/roles/matrix-synapse/tasks/synapse/workers/util/setup_files_for_worker.yml +++ b/roles/matrix-synapse/tasks/synapse/workers/util/setup_files_for_worker.yml @@ -1,3 +1,5 @@ +--- + - set_fact: matrix_synapse_worker_systemd_service_name: "matrix-synapse-worker-{{ matrix_synapse_worker_details.type }}-{{ matrix_synapse_worker_details.instanceId }}" diff --git a/roles/matrix-synapse/tasks/update_user_password.yml b/roles/matrix-synapse/tasks/update_user_password.yml index 78136785a..fd348d9db 100644 --- a/roles/matrix-synapse/tasks/update_user_password.yml +++ b/roles/matrix-synapse/tasks/update_user_password.yml @@ -19,14 +19,14 @@ service: name: matrix-synapse state: started - daemon_reload: yes + daemon_reload: true register: start_result - name: Ensure matrix-postgres is started service: name: matrix-postgres state: started - daemon_reload: yes + daemon_reload: true register: postgres_start_result diff --git a/roles/matrix-synapse/vars/workers.yml b/roles/matrix-synapse/vars/workers.yml index 1a279ad6b..7145e0fc3 100644 --- a/roles/matrix-synapse/vars/workers.yml +++ b/roles/matrix-synapse/vars/workers.yml @@ -206,7 +206,7 @@ matrix_synapse_workers_generic_worker_endpoints: # You might also wish to investigate the `update_user_directory` and # `media_instance_running_background_jobs` settings. -# pusher worker (no API endpoints) [ + # pusher worker (no API endpoints) [ # Handles sending push notifications to sygnal and email. Doesn't handle any # REST endpoints itself, but you should set `start_pushers: False` in the # shared configuration file to stop the main synapse sending push notifications. @@ -220,18 +220,18 @@ matrix_synapse_workers_generic_worker_endpoints: # - pusher_worker2 # ``` -# ] + # ] -# appservice worker (no API endpoints) [ + # appservice worker (no API endpoints) [ # Handles sending output traffic to Application Services. Doesn't handle any # REST endpoints itself, but you should set `notify_appservices: False` in the # shared configuration file to stop the main synapse sending appservice notifications. # Note this worker cannot be load-balanced: only one instance should be active. -# ] + # ] -# federation_sender worker (no API endpoints) [ + # federation_sender worker (no API endpoints) [ # Handles sending federation traffic to other servers. Doesn't handle any # REST endpoints itself, but you should set `send_federation: False` in the # shared configuration file to stop the main synapse sending this traffic. From 8de4e061e1fb09d982cb47321a43c94481cbd213 Mon Sep 17 00:00:00 2001 From: Marko Weltzer Date: Sat, 5 Feb 2022 21:36:11 +0100 Subject: [PATCH 2/6] feat: add yamllint gh action --- .github/workflows/matrix.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/matrix.yml diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml new file mode 100644 index 000000000..fe683f5b5 --- /dev/null +++ b/.github/workflows/matrix.yml @@ -0,0 +1,19 @@ +--- +name: Matrix CI + +# yamllint disable-line rule:truthy +on: + push: + pull_request: + schedule: + - cron: 0 12 * * * + +jobs: + yamllint: + name: 🧹 yamllint + runs-on: ubuntu-latest + steps: + - name: ⤵️ Check out configuration from GitHub + uses: actions/checkout@v2.4.0 + - name: 🚀 Run yamllint + uses: frenck/action-yamllint@v1.1.2 From de025425b53d3ab32b9f9c22d8e12db99031bae7 Mon Sep 17 00:00:00 2001 From: Marko Weltzer Date: Sun, 6 Feb 2022 11:30:38 +0100 Subject: [PATCH 3/6] fix: revert changes to .md files --- docs/configuring-playbook-bot-go-neb.md | 6 +++--- docs/configuring-playbook-bot-mjolnir.md | 2 +- docs/configuring-playbook-bridge-mautrix-facebook.md | 2 +- docs/configuring-playbook-bridge-mautrix-googlechat.md | 2 +- docs/configuring-playbook-bridge-mautrix-hangouts.md | 2 +- docs/configuring-playbook-bridge-mautrix-signal.md | 2 +- docs/configuring-playbook-bridge-mautrix-telegram.md | 2 +- docs/configuring-playbook-bridge-mautrix-whatsapp.md | 2 +- docs/configuring-playbook-dimension.md | 2 +- docs/configuring-playbook-email2matrix.md | 2 +- docs/updating-users-passwords.md | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/configuring-playbook-bot-go-neb.md b/docs/configuring-playbook-bot-go-neb.md index 00072b77a..33ce4dd31 100644 --- a/docs/configuring-playbook-bot-go-neb.md +++ b/docs/configuring-playbook-bot-go-neb.md @@ -28,7 +28,7 @@ If you use curl, you can get an access token like this: ``` curl -X POST --header 'Content-Type: application/json' -d '{ - "identifier": { "type": "m.id.user", "user": "bot.go-neb"}, + "identifier": { "type": "m.id.user", "user": "bot.go-neb" }, "password": "a strong password", "type": "m.login.password" }' 'https://matrix.YOURDOMAIN/_matrix/client/r0/login' @@ -198,8 +198,8 @@ matrix_bot_go_neb_services: # Each room will get the notification with the alert rendered with the given template rooms: "!someroomid:domain.tld": - text_template: "{% raw %}{{range .Alerts -}} [{{ .Status }}] {{index .Labels \"alertname\"}}: {{index .Annotations \"description\"}} {{ end -}}{% endraw %}" - html_template: "{% raw %}{{range .Alerts -}} {{ $severity := index .Labels \"severity\"}} {{ if eq .Status \"firing\"}} {{ if eq $severity \"critical\"}} [FIRING - CRITICAL] {{ else if eq $severity \"warning\"}} [FIRING - WARNING] {{ else }} [FIRING - {{ $severity }}] {{ end }} {{ else }} [RESOLVED] {{ end }} {{ index .Labels \"alertname\"}} : {{ index .Annotations \"description\"}} source
{{end -}}{% endraw %}" + text_template: "{% raw %}{{range .Alerts -}} [{{ .Status }}] {{index .Labels \"alertname\" }}: {{index .Annotations \"description\"}} {{ end -}}{% endraw %}" + html_template: "{% raw %}{{range .Alerts -}} {{ $severity := index .Labels \"severity\" }} {{ if eq .Status \"firing\" }} {{ if eq $severity \"critical\"}} [FIRING - CRITICAL] {{ else if eq $severity \"warning\"}} [FIRING - WARNING] {{ else }} [FIRING - {{ $severity }}] {{ end }} {{ else }} [RESOLVED] {{ end }} {{ index .Labels \"alertname\"}} : {{ index .Annotations \"description\"}} source
{{end -}}{% endraw %}" msg_type: "m.text" # Must be either `m.text` or `m.notice` ``` diff --git a/docs/configuring-playbook-bot-mjolnir.md b/docs/configuring-playbook-bot-mjolnir.md index 5c2e14e44..5ddb2ad3c 100644 --- a/docs/configuring-playbook-bot-mjolnir.md +++ b/docs/configuring-playbook-bot-mjolnir.md @@ -28,7 +28,7 @@ If you use curl, you can get an access token like this: ``` curl -X POST --header 'Content-Type: application/json' -d '{ - "identifier": { "type": "m.id.user", "user": "bot.mjolnir"}, + "identifier": { "type": "m.id.user", "user": "bot.mjolnir" }, "password": "PASSWORD_FOR_THE_BOT", "type": "m.login.password" }' 'https://matrix.DOMAIN/_matrix/client/r0/login' diff --git a/docs/configuring-playbook-bridge-mautrix-facebook.md b/docs/configuring-playbook-bridge-mautrix-facebook.md index 69462cee7..282865e73 100644 --- a/docs/configuring-playbook-bridge-mautrix-facebook.md +++ b/docs/configuring-playbook-bridge-mautrix-facebook.md @@ -50,7 +50,7 @@ When using this method, **each user** that wishes to enable Double Puppeting nee ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME"}, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Facebook", "initial_device_display_name": "Mautrix-Facebook"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Facebook", "initial_device_display_name": "Mautrix-Facebook"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/configuring-playbook-bridge-mautrix-googlechat.md b/docs/configuring-playbook-bridge-mautrix-googlechat.md index d2b0fc1ea..381d1f290 100644 --- a/docs/configuring-playbook-bridge-mautrix-googlechat.md +++ b/docs/configuring-playbook-bridge-mautrix-googlechat.md @@ -33,7 +33,7 @@ When using this method, **each user** that wishes to enable Double Puppeting nee ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME"}, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-googlechat", "initial_device_display_name": "Mautrix-googlechat"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-googlechat", "initial_device_display_name": "Mautrix-googlechat"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/configuring-playbook-bridge-mautrix-hangouts.md b/docs/configuring-playbook-bridge-mautrix-hangouts.md index 30f015067..f6129777d 100644 --- a/docs/configuring-playbook-bridge-mautrix-hangouts.md +++ b/docs/configuring-playbook-bridge-mautrix-hangouts.md @@ -35,7 +35,7 @@ When using this method, **each user** that wishes to enable Double Puppeting nee ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME"}, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Hangouts", "initial_device_display_name": "Mautrix-Hangouts"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Hangouts", "initial_device_display_name": "Mautrix-Hangouts"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/configuring-playbook-bridge-mautrix-signal.md b/docs/configuring-playbook-bridge-mautrix-signal.md index 0aacb32f4..f47640b9f 100644 --- a/docs/configuring-playbook-bridge-mautrix-signal.md +++ b/docs/configuring-playbook-bridge-mautrix-signal.md @@ -77,7 +77,7 @@ When using this method, **each user** that wishes to enable Double Puppeting nee ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME"}, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Signal", "initial_device_display_name": "Mautrix-Signal"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Signal", "initial_device_display_name": "Mautrix-Signal"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/configuring-playbook-bridge-mautrix-telegram.md b/docs/configuring-playbook-bridge-mautrix-telegram.md index c92607449..0ac6c1030 100644 --- a/docs/configuring-playbook-bridge-mautrix-telegram.md +++ b/docs/configuring-playbook-bridge-mautrix-telegram.md @@ -32,7 +32,7 @@ When using this method, **each user** that wishes to enable Double Puppeting nee ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME"}, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Telegram", "initial_device_display_name": "Mautrix-Telegram"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Telegram", "initial_device_display_name": "Mautrix-Telegram"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/configuring-playbook-bridge-mautrix-whatsapp.md b/docs/configuring-playbook-bridge-mautrix-whatsapp.md index a6c975a9e..2af38be1f 100644 --- a/docs/configuring-playbook-bridge-mautrix-whatsapp.md +++ b/docs/configuring-playbook-bridge-mautrix-whatsapp.md @@ -48,7 +48,7 @@ When using this method, **each user** that wishes to enable Double Puppeting nee ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME"}, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Whatsapp", "initial_device_display_name": "Mautrix-Whatsapp"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Whatsapp", "initial_device_display_name": "Mautrix-Whatsapp"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/configuring-playbook-dimension.md b/docs/configuring-playbook-dimension.md index bc9d63e77..b938a6a32 100644 --- a/docs/configuring-playbook-dimension.md +++ b/docs/configuring-playbook-dimension.md @@ -53,7 +53,7 @@ To get an access token for the Dimension user, you can follow one of two options ``` curl -X POST --header 'Content-Type: application/json' -d '{ - "identifier": { "type": "m.id.user", "user": "YourDimensionUsername"}, + "identifier": { "type": "m.id.user", "user": "YourDimensionUsername" }, "password": "YourDimensionPassword", "type": "m.login.password" }' 'https://matrix.YOURDOMAIN/_matrix/client/r0/login' diff --git a/docs/configuring-playbook-email2matrix.md b/docs/configuring-playbook-email2matrix.md index 734a0273c..510a9dcc8 100644 --- a/docs/configuring-playbook-email2matrix.md +++ b/docs/configuring-playbook-email2matrix.md @@ -40,7 +40,7 @@ To do this, you can execute a command like this: ``` curl \ ---data '{"identifier": {"type": "m.id.user", "user": "email2matrix"}, "password": "MATRIX_PASSWORD_FOR_THE_USER", "type": "m.login.password", "device_id": "Email2Matrix", "initial_device_display_name": "Email2Matrix"}' \ +--data '{"identifier": {"type": "m.id.user", "user": "email2matrix" }, "password": "MATRIX_PASSWORD_FOR_THE_USER", "type": "m.login.password", "device_id": "Email2Matrix", "initial_device_display_name": "Email2Matrix"}' \ https://matrix.DOMAIN/_matrix/client/r0/login ``` diff --git a/docs/updating-users-passwords.md b/docs/updating-users-passwords.md index 0bf1e1815..7d2f28329 100644 --- a/docs/updating-users-passwords.md +++ b/docs/updating-users-passwords.md @@ -41,5 +41,5 @@ If you didn't make your account a server admin when you created it, you can use ### Example: To set @user:domain.com's password to `correct_horse_battery_staple` you could use this curl command: ``` -curl -XPOST -d '{ "new_password": "correct_horse_battery_staple"}' "https://matrix./_matrix/client/r0/admin/reset_password/@user:domain.com?access_token=MDA...this_is_my_access_token +curl -XPOST -d '{ "new_password": "correct_horse_battery_staple" }' "https://matrix./_matrix/client/r0/admin/reset_password/@user:domain.com?access_token=MDA...this_is_my_access_token ``` From 8e8bf55e159a664524db09ef97b9114c77441c17 Mon Sep 17 00:00:00 2001 From: Marko Weltzer Date: Wed, 9 Feb 2022 08:52:53 +0100 Subject: [PATCH 4/6] fix: missing spaces on closing } --- .github/dependabot.yaml | 7 +++++ .github/workflows/matrix.yml | 3 -- group_vars/matrix_servers | 59 +++++++----------------------------- 3 files changed, 18 insertions(+), 51 deletions(-) create mode 100644 .github/dependabot.yaml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 000000000..b9c3cd49d --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,7 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: daily diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index fe683f5b5..bb388e39b 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -1,12 +1,9 @@ --- name: Matrix CI -# yamllint disable-line rule:truthy on: push: pull_request: - schedule: - - cron: 0 12 * * * jobs: yamllint: diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index c2670afdb..596fba130 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -265,7 +265,7 @@ matrix_beeper_linkedin_homeserver_token: "{{ '%s' | format(matrix_homeserver_gen matrix_beeper_linkedin_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}" -matrix_beeper_linkedin_bridge_presence: "{{ matrix_synapse_presence_enabled if matrix_synapse_enabled else true}}" +matrix_beeper_linkedin_bridge_presence: "{{ matrix_synapse_presence_enabled if matrix_synapse_enabled else true }}" matrix_beeper_linkedin_database_password: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'maulinkedin.db') | to_uuid }}" @@ -303,7 +303,7 @@ matrix_mautrix_facebook_homeserver_token: "{{ '%s' | format(matrix_homeserver_ge matrix_mautrix_facebook_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}" -matrix_mautrix_facebook_bridge_presence: "{{ matrix_synapse_presence_enabled if matrix_synapse_enabled else true}}" +matrix_mautrix_facebook_bridge_presence: "{{ matrix_synapse_presence_enabled if matrix_synapse_enabled else true }}" # We'd like to force-set people with external Postgres to SQLite, so the bridge role can complain # and point them to a migration path. @@ -427,7 +427,7 @@ matrix_mautrix_instagram_homeserver_token: "{{ '%s' | format(matrix_homeserver_g matrix_mautrix_instagram_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}" -matrix_mautrix_instagram_bridge_presence: "{{ matrix_synapse_presence_enabled if matrix_synapse_enabled else true}}" +matrix_mautrix_instagram_bridge_presence: "{{ matrix_synapse_presence_enabled if matrix_synapse_enabled else true }}" # We'd like to force-set people with external Postgres to SQLite, so the bridge role can complain # and point them to a migration path. @@ -1128,8 +1128,6 @@ matrix_corporal_matrix_registration_shared_secret: "{{ matrix_synapse_registrati # ###################################################################### - - ###################################################################### # # matrix-coturn @@ -1164,8 +1162,6 @@ matrix_coturn_container_additional_volumes: | # ###################################################################### - - ###################################################################### # # matrix-dimension @@ -1243,8 +1239,6 @@ matrix_dynamic_dns_enabled: false # ###################################################################### - - ###################################################################### # # matrix-email2matrix @@ -1261,8 +1255,6 @@ matrix_email2matrix_container_image_self_build: "{{ matrix_architecture not in [ # ###################################################################### - - ###################################################################### # # matrix-jitsi @@ -1307,8 +1299,6 @@ matrix_jitsi_etherpad_base: "{{ matrix_etherpad_base_url if matrix_etherpad_enab # ###################################################################### - - ###################################################################### # # matrix-mailer @@ -1328,8 +1318,6 @@ matrix_mailer_container_image_self_build: "{{ matrix_architecture not in ['amd64 # ###################################################################### - - ###################################################################### # # matrix-ma1sd @@ -1367,7 +1355,7 @@ matrix_ma1sd_threepid_medium_email_connectors_smtp_host: "matrix-mailer" matrix_ma1sd_threepid_medium_email_connectors_smtp_port: 8025 matrix_ma1sd_threepid_medium_email_connectors_smtp_tls: 0 -matrix_ma1sd_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" +matrix_ma1sd_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" matrix_ma1sd_systemd_required_services_list: | {{ @@ -1393,8 +1381,6 @@ matrix_ma1sd_database_password: "{{ '%s' | format(matrix_homeserver_generic_secr # ###################################################################### - - ###################################################################### # # matrix-nginx-proxy @@ -1479,7 +1465,7 @@ matrix_nginx_proxy_proxy_matrix_user_directory_search_enabled: "{{ matrix_ma1sd_ matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_with_container: "{{ matrix_nginx_proxy_proxy_matrix_identity_api_addr_with_container }}" matrix_nginx_proxy_proxy_matrix_user_directory_search_addr_sans_container: "{{ matrix_nginx_proxy_proxy_matrix_identity_api_addr_sans_container }}" -matrix_nginx_proxy_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" +matrix_nginx_proxy_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" # OCSP stapling does not make sense when self-signed certificates are used. # See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1073 @@ -1570,8 +1556,6 @@ matrix_ssl_pre_obtaining_required_service_name: "{{ 'matrix-dynamic-dns' if matr # ###################################################################### - - ###################################################################### # # matrix-postgres @@ -1820,8 +1804,6 @@ matrix_postgres_import_databases_to_ignore: | # ###################################################################### - - ###################################################################### # # matrix-sygnal @@ -1842,8 +1824,6 @@ matrix_sygnal_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enable # ###################################################################### - - ###################################################################### # # matrix-redis @@ -1858,8 +1838,6 @@ matrix_redis_enabled: "{{ matrix_synapse_workers_enabled }}" # ###################################################################### - - ###################################################################### # # matrix-client-element @@ -1886,7 +1864,7 @@ matrix_client_element_integrations_rest_url: "{{ matrix_dimension_integrations_r matrix_client_element_integrations_widgets_urls: "{{ matrix_dimension_integrations_widgets_urls if matrix_dimension_enabled else ['https://scalar.vector.im/api'] }}" matrix_client_element_integrations_jitsi_widget_url: "{{ matrix_dimension_integrations_jitsi_widget_url if matrix_dimension_enabled else 'https://scalar.vector.im/api/widgets/jitsi.html' }}" -matrix_client_element_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" +matrix_client_element_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" matrix_client_element_registration_enabled: "{{ matrix_synapse_enable_registration }}" @@ -1907,8 +1885,6 @@ matrix_client_element_jitsi_preferredDomain: "{{ matrix_server_fqn_jitsi if matr # ###################################################################### - - ###################################################################### # # matrix-client-hydrogen @@ -1924,7 +1900,7 @@ matrix_client_hydrogen_container_http_host_bind_port: "{{ '' if matrix_nginx_pro matrix_client_hydrogen_default_hs_url: "{{ matrix_homeserver_url }}" -matrix_client_hydrogen_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" +matrix_client_hydrogen_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" ###################################################################### # @@ -1932,8 +1908,6 @@ matrix_client_hydrogen_self_check_validate_certificates: "{{ false if matrix_ssl # ###################################################################### - - ###################################################################### # # matrix-client-cinny @@ -1951,7 +1925,7 @@ matrix_client_cinny_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_ matrix_client_cinny_default_hs_url: "{{ matrix_homeserver_url }}" -matrix_client_cinny_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" +matrix_client_cinny_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" ###################################################################### # @@ -1959,8 +1933,6 @@ matrix_client_cinny_self_check_validate_certificates: "{{ false if matrix_ssl_re # ###################################################################### - - ###################################################################### # # matrix-synapse @@ -2042,7 +2014,7 @@ matrix_synapse_turn_uris: | matrix_synapse_turn_shared_secret: "{{ matrix_coturn_turn_static_auth_secret if matrix_coturn_enabled else '' }}" -matrix_synapse_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" +matrix_synapse_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" matrix_synapse_systemd_required_services_list: | {{ @@ -2071,8 +2043,6 @@ matrix_synapse_redis_password: "{{ matrix_redis_connection_password if matrix_re # ###################################################################### - - ###################################################################### # # matrix-synapse-admin @@ -2094,8 +2064,6 @@ matrix_synapse_admin_container_image_self_build: "{{ matrix_architecture != 'amd # ###################################################################### - - ###################################################################### # # matrix-prometheus-node-exporter @@ -2110,8 +2078,6 @@ matrix_prometheus_node_exporter_enabled: false # ###################################################################### - - ###################################################################### # # matrix-prometheus @@ -2145,7 +2111,6 @@ matrix_prometheus_scraper_hookshot_targets: "{{ [matrix_hookshot_container_url|s # ###################################################################### - ###################################################################### # # matrix-prometheus-postgres-exporter @@ -2201,8 +2166,6 @@ matrix_grafana_systemd_wanted_services_list: | # ###################################################################### - - ###################################################################### # # matrix-registration @@ -2228,7 +2191,7 @@ matrix_registration_shared_secret: |- matrix_registration_server_location: "{{ matrix_homeserver_container_url }}" -matrix_registration_api_validate_certs: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" +matrix_registration_api_validate_certs: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" matrix_registration_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" @@ -2320,7 +2283,7 @@ matrix_dendrite_turn_shared_secret: "{{ matrix_coturn_turn_static_auth_secret if matrix_dendrite_disable_tls_validation: "{{ true if matrix_ssl_retrieval_method == 'self-signed' else false }}" -matrix_dendrite_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true}}" +matrix_dendrite_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else true }}" matrix_dendrite_trusted_id_servers: "{{ [matrix_server_fqn_matrix] if matrix_ma1sd_enabled else ['matrix.org', 'vector.im'] }}" From 5addb889b1c9052e5397b48f9b6cf9b56d08e9f3 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 9 Feb 2022 10:27:12 +0200 Subject: [PATCH 5/6] Fix inconsistent spacing --- roles/matrix-awx/tasks/set_variables_dimension.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/matrix-awx/tasks/set_variables_dimension.yml b/roles/matrix-awx/tasks/set_variables_dimension.yml index 7d4011143..d692e0813 100644 --- a/roles/matrix-awx/tasks/set_variables_dimension.yml +++ b/roles/matrix-awx/tasks/set_variables_dimension.yml @@ -14,7 +14,7 @@ - name: Collect access token of @admin-dimension user shell: | - curl -X POST --header 'Content-Type: application/json' -d '{ "identifier": { "type": "m.id.user","user": "admin-dimension"}, "password": "{{ awx_dimension_user_password }}", "type": "m.login.password"}' 'https://matrix.{{ matrix_domain }}/_matrix/client/r0/login' | jq -c '. | {access_token}' | sed 's/.*\":\"//' | sed 's/\"}//' + curl -X POST --header 'Content-Type: application/json' -d '{"identifier": {"type": "m.id.user","user": "admin-dimension"}, "password": "{{ awx_dimension_user_password }}", "type": "m.login.password"}' 'https://matrix.{{ matrix_domain }}/_matrix/client/r0/login' | jq -c '. | {access_token}' | sed 's/.*\":\"//' | sed 's/\"}//' register: awx_dimension_user_access_token - name: Record Synapse variables locally on AWX From 94c9780f7ae333c60c1cc6cce9dae755902ec59c Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 9 Feb 2022 10:38:28 +0200 Subject: [PATCH 6/6] Fix matrix_synapse_encryption_enabled_by_default_for_room_type The value of `off` was taken to be a boolean, but it shouldn't be. Synapse expects a string (currently one of: `all`, `invite`, `off`). --- roles/matrix-synapse/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/matrix-synapse/defaults/main.yml b/roles/matrix-synapse/defaults/main.yml index c3e1eefda..838058ea9 100644 --- a/roles/matrix-synapse/defaults/main.yml +++ b/roles/matrix-synapse/defaults/main.yml @@ -575,7 +575,7 @@ matrix_synapse_spam_checker: [] matrix_synapse_modules: [] -matrix_synapse_encryption_enabled_by_default_for_room_type: false +matrix_synapse_encryption_enabled_by_default_for_room_type: "off" matrix_synapse_trusted_key_servers: - server_name: "matrix.org"