Add service priorities - try to stop/start them in an optimal order

This commit is contained in:
Slavi Pantaleev
2022-11-23 08:43:46 +02:00
parent 0ea7cb5d18
commit 360e643f84
8 changed files with 123 additions and 86 deletions

View File

@ -27,7 +27,7 @@
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 | map(attribute='name')"
- name: Ensure unnecessary worker systemd services are cleaned
ansible.builtin.file:

View File

@ -53,7 +53,7 @@
when: "'replication_port' not in matrix_synapse_worker_details"
- ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + [matrix_synapse_worker_details.name + '.service'] }}"
matrix_systemd_services_list_auto: "{{ matrix_systemd_services_list_auto + [{'name': (matrix_synapse_worker_details.name + '.service'), 'priority': 1100}] }}"
- ansible.builtin.set_fact:
matrix_synapse_webserving_workers_systemd_services_list: "{{ matrix_synapse_webserving_workers_systemd_services_list + [matrix_synapse_worker_details.name + '.service'] }}"