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.
43 lines
1.6 KiB
43 lines
1.6 KiB
5 years ago
|
---
|
||
|
|
||
4 years ago
|
- name: Determine current worker configs
|
||
2 years ago
|
ansible.builtin.find:
|
||
4 years ago
|
path: "{{ matrix_synapse_config_dir_path }}"
|
||
|
patterns: "worker.*.yaml"
|
||
|
use_regex: true
|
||
4 years ago
|
register: matrix_synapse_workers_current_config_files
|
||
4 years ago
|
|
||
4 years ago
|
# This also deletes some things which we need. They will be recreated below.
|
||
4 years ago
|
- name: Ensure previous worker configs are cleaned
|
||
2 years ago
|
ansible.builtin.file:
|
||
4 years ago
|
path: "{{ item.path }}"
|
||
4 years ago
|
state: absent
|
||
4 years ago
|
with_items: "{{ matrix_synapse_workers_current_config_files.files }}"
|
||
4 years ago
|
|
||
4 years ago
|
- name: Determine current worker systemd services
|
||
2 years ago
|
ansible.builtin.find:
|
||
4 years ago
|
path: "{{ matrix_systemd_path }}"
|
||
|
patterns: "matrix-synapse-worker.*.service"
|
||
|
use_regex: true
|
||
|
register: matrix_synapse_workers_current_systemd_services
|
||
4 years ago
|
|
||
4 years ago
|
- name: Ensure unnecessary worker systemd services are stopped and disabled
|
||
2 years ago
|
ansible.builtin.service:
|
||
2 years ago
|
name: "{{ item.path | basename }}"
|
||
4 years ago
|
state: stopped
|
||
|
enabled: false
|
||
|
with_items: "{{ matrix_synapse_workers_current_systemd_services.files }}"
|
||
2 years ago
|
when: "not ansible_check_mode and item.path | basename not in matrix_systemd_services_list"
|
||
4 years ago
|
|
||
|
- name: Ensure unnecessary worker systemd services are cleaned
|
||
2 years ago
|
ansible.builtin.file:
|
||
4 years ago
|
path: "{{ item.path }}"
|
||
|
state: absent
|
||
|
with_items: "{{ matrix_synapse_workers_current_systemd_services.files }}"
|
||
4 years ago
|
|
||
4 years ago
|
- name: Ensure creation of worker systemd service files and configuration files
|
||
2 years ago
|
ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/util/setup_files_for_worker.yml"
|
||
4 years ago
|
with_items: "{{ matrix_synapse_workers_enabled_list }}"
|
||
|
loop_control:
|
||
|
loop_var: matrix_synapse_worker_details
|