2022-02-05 20:32:54 +00:00
|
|
|
---
|
2021-02-18 16:19:51 +00:00
|
|
|
# The tasks below run before `validate_config.yml`.
|
|
|
|
# To avoid failing with a cryptic error message, we'll do validation here.
|
|
|
|
#
|
|
|
|
# This check is mostly relevant to people who explicitly define `matrix_synapse_workers_enabled_list`
|
|
|
|
# (Synapse Workers users from the earlier days of this PR - https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/456).
|
|
|
|
#
|
|
|
|
# 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
|
2022-07-18 07:39:08 +00:00
|
|
|
ansible.builtin.fail:
|
2022-07-18 08:22:05 +00:00
|
|
|
msg: "Synapse workers (like {{ matrix_synapse_worker_details | to_json }}) need to define an instanceId property (type + instanceId must be unique)"
|
2021-02-18 16:19:51 +00:00
|
|
|
when: "'instanceId' not in matrix_synapse_worker_details"
|
2021-01-25 10:14:46 +00:00
|
|
|
|
2022-07-18 07:39:08 +00:00
|
|
|
- ansible.builtin.set_fact:
|
2021-02-18 16:19:51 +00:00
|
|
|
matrix_synapse_worker_systemd_service_name: "matrix-synapse-worker-{{ matrix_synapse_worker_details.type }}-{{ matrix_synapse_worker_details.instanceId }}.service"
|
2021-01-25 10:14:46 +00:00
|
|
|
|
2022-07-18 07:39:08 +00:00
|
|
|
- ansible.builtin.set_fact:
|
2021-01-25 10:14:46 +00:00
|
|
|
matrix_systemd_services_list: "{{ matrix_systemd_services_list + [matrix_synapse_worker_systemd_service_name] }}"
|