Use fully-qualified module names for builtin Ansible modules

Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/1939
This commit is contained in:
Slavi Pantaleev
2022-07-18 10:39:08 +03:00
parent 78b5be4a26
commit 34cdaade08
297 changed files with 1420 additions and 1420 deletions
roles
matrix-aux
matrix-backup-borg
matrix-base
matrix-bot-buscarron
matrix-bot-go-neb
matrix-bot-honoroit
matrix-bot-matrix-registration-bot
matrix-bot-matrix-reminder-bot
matrix-bot-mjolnir
matrix-bridge-appservice-discord
matrix-bridge-appservice-irc
matrix-bridge-appservice-slack
matrix-bridge-appservice-webhooks
matrix-bridge-beeper-linkedin
matrix-bridge-go-skype-bridge
matrix-bridge-heisenbridge
matrix-bridge-hookshot
matrix-bridge-mautrix-facebook
matrix-bridge-mautrix-googlechat
matrix-bridge-mautrix-hangouts
matrix-bridge-mautrix-instagram
matrix-bridge-mautrix-signal
matrix-bridge-mautrix-telegram
matrix-bridge-mautrix-twitter
matrix-bridge-mautrix-whatsapp
matrix-bridge-mx-puppet-discord
matrix-bridge-mx-puppet-groupme
matrix-bridge-mx-puppet-instagram
matrix-bridge-mx-puppet-slack
matrix-bridge-mx-puppet-steam
matrix-bridge-mx-puppet-twitter
matrix-bridge-sms
matrix-client-cinny
matrix-client-element
matrix-client-hydrogen
matrix-common-after
matrix-corporal
matrix-coturn
matrix-dendrite
matrix-dimension
matrix-dynamic-dns
matrix-email2matrix
matrix-etherpad
matrix-grafana
matrix-jitsi
matrix-ma1sd
matrix-mailer
matrix-nginx-proxy
matrix-ntfy
matrix-postgres-backup
matrix-postgres
matrix-prometheus-node-exporter
matrix-prometheus-postgres-exporter
matrix-prometheus
matrix-redis
matrix-registration
matrix-sygnal
matrix-synapse-admin
matrix-synapse

@ -5,7 +5,7 @@
# so we're forced to do something much uglier.
- name: Build generic workers
set_fact:
ansible.builtin.set_fact:
worker:
type: 'generic_worker'
instanceId: "{{ matrix_synapse_workers_generic_workers_port_range_start + item }}"
@ -15,7 +15,7 @@
loop: "{{ range(0, matrix_synapse_workers_generic_workers_count|int)|list }}"
- name: Build federation sender workers
set_fact:
ansible.builtin.set_fact:
worker:
type: 'federation_sender'
instanceId: "{{ item }}"
@ -26,7 +26,7 @@
# This type of worker can only have a count of 1, at most
- name: Build pusher workers
set_fact:
ansible.builtin.set_fact:
worker:
type: 'pusher'
instanceId: "{{ item }}"
@ -37,7 +37,7 @@
# This type of worker can only have a count of 1, at most
- name: Build appservice workers
set_fact:
ansible.builtin.set_fact:
worker:
type: 'appservice'
instanceId: "{{ item }}"
@ -47,7 +47,7 @@
loop: "{{ range(0, matrix_synapse_workers_appservice_workers_count|int)|list }}"
- name: Build media_repository workers
set_fact:
ansible.builtin.set_fact:
worker:
type: 'media_repository'
instanceId: "{{ matrix_synapse_workers_media_repository_workers_port_range_start + item }}"
@ -57,7 +57,7 @@
loop: "{{ range(0, matrix_synapse_workers_media_repository_workers_count|int)|list }}"
- name: Build frontend_proxy workers
set_fact:
ansible.builtin.set_fact:
worker:
type: 'frontend_proxy'
instanceId: "{{ matrix_synapse_workers_frontend_proxy_workers_port_range_start + item }}"
@ -66,7 +66,7 @@
register: "matrix_synapse_workers_list_results_frontend_proxy_workers"
loop: "{{ range(0, matrix_synapse_workers_frontend_proxy_workers_count|int)|list }}"
- set_fact:
- ansible.builtin.set_fact:
matrix_synapse_dynamic_workers_list: "{{ matrix_synapse_dynamic_workers_list|default([]) + [item.ansible_facts.worker] }}"
with_items: |
{{
@ -83,5 +83,5 @@
matrix_synapse_workers_list_results_frontend_proxy_workers.results
}}
- set_fact:
- ansible.builtin.set_fact:
matrix_synapse_workers_enabled_list: "{{ matrix_synapse_dynamic_workers_list }}"

@ -3,14 +3,14 @@
# A previous version of the worker setup used this.
# This is a temporary cleanup for people who ran that version.
- name: Ensure old matrix-synapse.service.wants directory is gone
file:
ansible.builtin.file:
path: "{{ matrix_systemd_path }}/matrix-synapse.service.wants"
state: absent
# Same. This was part of a previous version of the worker setup.
# No longer necessary.
- name: Ensure matrix-synapse-worker-write-pid script is removed
file:
ansible.builtin.file:
path: "{{ matrix_local_bin_path }}/matrix-synapse-worker-write-pid"
state: absent

@ -9,7 +9,7 @@
# This also deletes some things which we need. They will be recreated below.
- name: Ensure previous worker configs are cleaned
file:
ansible.builtin.file:
path: "{{ item.path }}"
state: absent
with_items: "{{ matrix_synapse_workers_current_config_files.files }}"
@ -22,7 +22,7 @@
register: matrix_synapse_workers_current_systemd_services
- name: Ensure unnecessary worker systemd services are stopped and disabled
service:
ansible.builtin.service:
name: "{{ item.path|basename }}"
state: stopped
enabled: false
@ -30,7 +30,7 @@
when: "not ansible_check_mode and item.path|basename not in matrix_systemd_services_list"
- name: Ensure unnecessary worker systemd services are cleaned
file:
ansible.builtin.file:
path: "{{ item.path }}"
state: absent
with_items: "{{ matrix_synapse_workers_current_systemd_services.files }}"

@ -4,7 +4,7 @@
service_facts:
- name: Ensure any worker services are stopped
service:
ansible.builtin.service:
name: "{{ item.key }}"
state: stopped
with_dict: "{{ ansible_facts.services|default({})|dict2items|selectattr('key', 'match', 'matrix-synapse-worker-.+\\.service')|list|items2dict }}"
@ -18,7 +18,7 @@
register: matrix_synapse_workers_current_config_files
- name: Ensure previous worker configs are cleaned
file:
ansible.builtin.file:
path: "{{ item.path }}"
state: absent
with_items: "{{ matrix_synapse_workers_current_config_files.files }}"
@ -31,7 +31,7 @@
register: matrix_synapse_workers_current_systemd_services
- name: Ensure previous worker systemd services are cleaned
file:
ansible.builtin.file:
path: "{{ item.path }}"
state: absent
with_items: "{{ matrix_synapse_workers_current_systemd_services.files }}"

@ -8,12 +8,12 @@
# In the future, it should be possible to remove this check.
# Our own code which dynamically builds `matrix_synapse_workers_enabled_list` does things right.
- name: Fail if instanceId not defined for worker
fail:
ansible.builtin.fail:
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"
- set_fact:
- ansible.builtin.set_fact:
matrix_synapse_worker_systemd_service_name: "matrix-synapse-worker-{{ matrix_synapse_worker_details.type }}-{{ matrix_synapse_worker_details.instanceId }}.service"
- set_fact:
- ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + [matrix_synapse_worker_systemd_service_name] }}"

@ -1,21 +1,21 @@
---
- set_fact:
- ansible.builtin.set_fact:
matrix_synapse_worker_systemd_service_name: "matrix-synapse-worker-{{ matrix_synapse_worker_details.type }}-{{ matrix_synapse_worker_details.instanceId }}"
- set_fact:
- ansible.builtin.set_fact:
matrix_synapse_worker_container_name: "{{ matrix_synapse_worker_systemd_service_name }}"
- set_fact:
- ansible.builtin.set_fact:
matrix_synapse_worker_config_file_name: "worker.{{ matrix_synapse_worker_details.type }}_{{ matrix_synapse_worker_details.instanceId }}.yaml"
- name: Ensure configuration exists for {{ matrix_synapse_worker_systemd_service_name }}
template:
ansible.builtin.template:
src: "{{ role_path }}/templates/synapse/worker.yaml.j2"
dest: "{{ matrix_synapse_config_dir_path }}/{{ matrix_synapse_worker_config_file_name }}"
- name: Ensure systemd service exists for {{ matrix_synapse_worker_systemd_service_name }}
template:
ansible.builtin.template:
src: "{{ role_path }}/templates/synapse/systemd/matrix-synapse-worker.service.j2"
dest: "{{ matrix_systemd_path }}/{{ matrix_synapse_worker_systemd_service_name }}.service"
mode: 0644