More ansible-lint fixes
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/synapse/setup_install.yml"
|
||||
when: matrix_synapse_enabled|bool
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/synapse/setup_install.yml"
|
||||
when: matrix_synapse_enabled | bool
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/synapse/setup_uninstall.yml"
|
||||
when: "not matrix_synapse_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/synapse/setup_uninstall.yml"
|
||||
when: "not matrix_synapse_enabled | bool"
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# This will throw a Permission Denied error if already mounted using fuse
|
||||
- name: Check Synapse media store path
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_synapse_media_store_path }}"
|
||||
register: local_path_media_store_stat
|
||||
ignore_errors: true
|
||||
@ -46,8 +46,8 @@
|
||||
.
|
||||
environment:
|
||||
DOCKER_BUILDKIT: 1
|
||||
when: "matrix_synapse_git_pull_results.changed|bool or matrix_synapse_docker_image_check_result.stdout == ''"
|
||||
when: "matrix_synapse_container_image_self_build|bool"
|
||||
when: "matrix_synapse_git_pull_results.changed | bool or matrix_synapse_docker_image_check_result.stdout == ''"
|
||||
when: "matrix_synapse_container_image_self_build | bool"
|
||||
|
||||
- name: Ensure Synapse Docker image is pulled
|
||||
docker_image:
|
||||
@ -62,7 +62,7 @@
|
||||
until: result is not failed
|
||||
|
||||
- name: Check if a Synapse signing key exists
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_synapse_config_dir_path }}/{{ matrix_server_fqn_matrix }}.signing.key"
|
||||
register: matrix_synapse_signing_key_stat
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
|
||||
- name: Ensure Synapse homeserver config installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_synapse_configuration|to_nice_yaml(indent=2, width=999999) }}"
|
||||
content: "{{ matrix_synapse_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_synapse_config_dir_path }}/homeserver.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
@ -127,4 +127,4 @@
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
mode: 0644
|
||||
when: matrix_synapse_metrics_proxying_enabled|bool
|
||||
when: matrix_synapse_metrics_proxying_enabled | bool
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-synapse service
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-synapse.service"
|
||||
register: matrix_synapse_service_stat
|
||||
|
||||
@ -34,4 +34,4 @@
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_synapse_base_path }}/external_prometheus.yml.example"
|
||||
state: absent
|
||||
when: "not matrix_synapse_metrics_proxying_enabled|bool"
|
||||
when: "not matrix_synapse_metrics_proxying_enabled | bool"
|
||||
|
@ -12,7 +12,7 @@
|
||||
port: "{{ matrix_synapse_workers_generic_workers_port_range_start + item }}"
|
||||
metrics_port: "{{ matrix_synapse_workers_generic_workers_metrics_range_start + item }}"
|
||||
register: "matrix_synapse_workers_list_results_generic_workers"
|
||||
loop: "{{ range(0, matrix_synapse_workers_generic_workers_count|int)|list }}"
|
||||
loop: "{{ range(0, matrix_synapse_workers_generic_workers_count|int) | list }}"
|
||||
|
||||
- name: Build federation sender workers
|
||||
ansible.builtin.set_fact:
|
||||
@ -22,7 +22,7 @@
|
||||
port: 0
|
||||
metrics_port: "{{ matrix_synapse_workers_federation_sender_workers_metrics_range_start + item }}"
|
||||
register: "matrix_synapse_workers_list_results_federation_sender_workers"
|
||||
loop: "{{ range(0, matrix_synapse_workers_federation_sender_workers_count|int)|list }}"
|
||||
loop: "{{ range(0, matrix_synapse_workers_federation_sender_workers_count|int) | list }}"
|
||||
|
||||
# This type of worker can only have a count of 1, at most
|
||||
- name: Build pusher workers
|
||||
@ -33,7 +33,7 @@
|
||||
port: 0
|
||||
metrics_port: "{{ matrix_synapse_workers_pusher_workers_metrics_range_start + item }}"
|
||||
register: "matrix_synapse_workers_list_results_pusher_workers"
|
||||
loop: "{{ range(0, matrix_synapse_workers_pusher_workers_count|int)|list }}"
|
||||
loop: "{{ range(0, matrix_synapse_workers_pusher_workers_count|int) | list }}"
|
||||
|
||||
# This type of worker can only have a count of 1, at most
|
||||
- name: Build appservice workers
|
||||
@ -44,7 +44,7 @@
|
||||
port: 0
|
||||
metrics_port: "{{ matrix_synapse_workers_appservice_workers_metrics_range_start + item }}"
|
||||
register: "matrix_synapse_workers_list_results_appservice_workers"
|
||||
loop: "{{ range(0, matrix_synapse_workers_appservice_workers_count|int)|list }}"
|
||||
loop: "{{ range(0, matrix_synapse_workers_appservice_workers_count|int) | list }}"
|
||||
|
||||
- name: Build media_repository workers
|
||||
ansible.builtin.set_fact:
|
||||
@ -54,7 +54,7 @@
|
||||
port: "{{ matrix_synapse_workers_media_repository_workers_port_range_start + item }}"
|
||||
metrics_port: "{{ matrix_synapse_workers_media_repository_workers_metrics_range_start + item }}"
|
||||
register: "matrix_synapse_workers_list_results_media_repository_workers"
|
||||
loop: "{{ range(0, matrix_synapse_workers_media_repository_workers_count|int)|list }}"
|
||||
loop: "{{ range(0, matrix_synapse_workers_media_repository_workers_count|int) | list }}"
|
||||
|
||||
- name: Build frontend_proxy workers
|
||||
ansible.builtin.set_fact:
|
||||
@ -64,10 +64,10 @@
|
||||
port: "{{ matrix_synapse_workers_frontend_proxy_workers_port_range_start + item }}"
|
||||
metrics_port: "{{ matrix_synapse_workers_frontend_proxy_workers_metrics_range_start + item }}"
|
||||
register: "matrix_synapse_workers_list_results_frontend_proxy_workers"
|
||||
loop: "{{ range(0, matrix_synapse_workers_frontend_proxy_workers_count|int)|list }}"
|
||||
loop: "{{ range(0, matrix_synapse_workers_frontend_proxy_workers_count|int) | list }}"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_synapse_dynamic_workers_list: "{{ matrix_synapse_dynamic_workers_list|default([]) + [item.ansible_facts.worker] }}"
|
||||
matrix_synapse_dynamic_workers_list: "{{ matrix_synapse_dynamic_workers_list | default([]) + [item.ansible_facts.worker] }}"
|
||||
with_items: |
|
||||
{{
|
||||
matrix_synapse_workers_list_results_generic_workers.results
|
||||
|
@ -14,8 +14,8 @@
|
||||
path: "{{ matrix_local_bin_path }}/matrix-synapse-worker-write-pid"
|
||||
state: absent
|
||||
|
||||
- include_tasks: "{{ role_path }}/tasks/synapse/workers/setup_install.yml"
|
||||
when: "matrix_synapse_enabled|bool and matrix_synapse_workers_enabled|bool"
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/setup_install.yml"
|
||||
when: "matrix_synapse_enabled | bool and matrix_synapse_workers_enabled | bool"
|
||||
|
||||
- include_tasks: "{{ role_path }}/tasks/synapse/workers/setup_uninstall.yml"
|
||||
when: "not matrix_synapse_workers_enabled|bool"
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/setup_uninstall.yml"
|
||||
when: "not matrix_synapse_workers_enabled | bool"
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Determine current worker configs
|
||||
find:
|
||||
ansible.builtin.find:
|
||||
path: "{{ matrix_synapse_config_dir_path }}"
|
||||
patterns: "worker.*.yaml"
|
||||
use_regex: true
|
||||
@ -15,7 +15,7 @@
|
||||
with_items: "{{ matrix_synapse_workers_current_config_files.files }}"
|
||||
|
||||
- name: Determine current worker systemd services
|
||||
find:
|
||||
ansible.builtin.find:
|
||||
path: "{{ matrix_systemd_path }}"
|
||||
patterns: "matrix-synapse-worker.*.service"
|
||||
use_regex: true
|
||||
@ -23,11 +23,11 @@
|
||||
|
||||
- name: Ensure unnecessary worker systemd services are stopped and disabled
|
||||
ansible.builtin.service:
|
||||
name: "{{ item.path|basename }}"
|
||||
name: "{{ item.path | basename }}"
|
||||
state: stopped
|
||||
enabled: false
|
||||
with_items: "{{ matrix_synapse_workers_current_systemd_services.files }}"
|
||||
when: "not ansible_check_mode and item.path|basename not in matrix_systemd_services_list"
|
||||
when: "not ansible_check_mode and item.path | basename not in matrix_systemd_services_list"
|
||||
|
||||
- name: Ensure unnecessary worker systemd services are cleaned
|
||||
ansible.builtin.file:
|
||||
@ -36,7 +36,7 @@
|
||||
with_items: "{{ matrix_synapse_workers_current_systemd_services.files }}"
|
||||
|
||||
- name: Ensure creation of worker systemd service files and configuration files
|
||||
include_tasks: "{{ role_path }}/tasks/synapse/workers/util/setup_files_for_worker.yml"
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/util/setup_files_for_worker.yml"
|
||||
with_items: "{{ matrix_synapse_workers_enabled_list }}"
|
||||
loop_control:
|
||||
loop_var: matrix_synapse_worker_details
|
||||
|
@ -1,17 +1,17 @@
|
||||
---
|
||||
|
||||
- name: Populate service facts
|
||||
service_facts:
|
||||
ansible.builtin.service_facts:
|
||||
|
||||
- name: Ensure any worker services are stopped
|
||||
ansible.builtin.service:
|
||||
name: "{{ item.key }}"
|
||||
state: stopped
|
||||
with_dict: "{{ ansible_facts.services|default({})|dict2items|selectattr('key', 'match', 'matrix-synapse-worker-.+\\.service')|list|items2dict }}"
|
||||
with_dict: "{{ ansible_facts.services | default({})|dict2items|selectattr('key', 'match', 'matrix-synapse-worker-.+\\.service')|list|items2dict }}"
|
||||
when: "item.value['status'] != 'not-found'" # see https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1461
|
||||
|
||||
- name: Find worker configs to be cleaned
|
||||
find:
|
||||
ansible.builtin.find:
|
||||
path: "{{ matrix_synapse_config_dir_path }}"
|
||||
patterns: "worker.*.yaml"
|
||||
use_regex: true
|
||||
@ -24,7 +24,7 @@
|
||||
with_items: "{{ matrix_synapse_workers_current_config_files.files }}"
|
||||
|
||||
- name: Find worker systemd services to be cleaned
|
||||
find:
|
||||
ansible.builtin.find:
|
||||
path: "{{ matrix_systemd_path }}"
|
||||
patterns: "matrix-synapse-worker.*.service"
|
||||
use_regex: true
|
||||
|
@ -9,7 +9,7 @@
|
||||
# Our own code which dynamically builds `matrix_synapse_workers_enabled_list` does things right.
|
||||
- name: Fail if instanceId not defined for worker
|
||||
ansible.builtin.fail:
|
||||
msg: "Synapse workers (like {{ matrix_synapse_worker_details|to_json }}) need to define an instanceId property (type + instanceId must be unique)"
|
||||
msg: "Synapse workers (like {{ matrix_synapse_worker_details | to_json }}) need to define an instanceId property (type + instanceId must be unique)"
|
||||
when: "'instanceId' not in matrix_synapse_worker_details"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
|
Reference in New Issue
Block a user