fix: all praise the allmighty yamllinter

This commit is contained in:
Marko Weltzer
2022-02-05 21:32:54 +01:00
parent d3983a0f04
commit 7e5b88c3b7
373 changed files with 1565 additions and 1296 deletions

View File

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

View File

@ -1,3 +1,5 @@
---
- set_fact:
matrix_synapse_password_providers_enabled: true

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,5 @@
---
- debug:
msg: "Compressing room `{{ room_details.room_id }}` having {{ room_details.count }} state group rows"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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