You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
3 years ago
|
---
|
||
|
|
||
|
- name: Populate service facts
|
||
|
service_facts:
|
||
|
|
||
|
- name: Ensure any worker services are stopped
|
||
|
service:
|
||
|
name: "{{ item.key }}"
|
||
|
state: stopped
|
||
|
with_dict: "{{ ansible_facts.services|default({})|dict2items|selectattr('key', 'match', 'matrix-synapse-worker-.+\\.service')|list|items2dict }}"
|
||
|
|
||
|
- name: Find worker configs to be cleaned
|
||
|
find:
|
||
|
path: "{{ matrix_synapse_config_dir_path }}"
|
||
|
patterns: "worker.*.yaml"
|
||
|
use_regex: true
|
||
|
register: matrix_synapse_workers_current_config_files
|
||
|
|
||
|
- name: Ensure previous worker configs are cleaned
|
||
|
file:
|
||
|
path: "{{ item.path }}"
|
||
|
state: absent
|
||
|
with_items: "{{ matrix_synapse_workers_current_config_files.files }}"
|
||
|
|
||
|
- name: Find worker systemd services to be cleaned
|
||
|
find:
|
||
|
path: "{{ matrix_systemd_path }}"
|
||
|
patterns: "matrix-synapse-worker.*.service"
|
||
|
use_regex: true
|
||
|
register: matrix_synapse_workers_current_systemd_services
|
||
|
|
||
|
- name: Ensure previous worker systemd services are cleaned
|
||
|
file:
|
||
|
path: "{{ item.path }}"
|
||
|
state: absent
|
||
|
with_items: "{{ matrix_synapse_workers_current_systemd_services.files }}"
|