ansible-collection-famedly-.../roles/synapse/tasks/main.yml
Johanna Dorothea Reichmann 1985813915
feat(synapse): add support for deploying workers
Can deploy synapse workers and allow costum amounts of workers for each
type. For documentation on how to use, see `roles/synapse/README.md`.

In a docker deployment, each worker runs in their own docker container
with respective listener configurations. Labels can be declared in
`tasks/configure_workers.yml` for routing of requests.

In systemd deployments, each worker runs in it's own systemd service,
which are marked as being part of the main service, so restarting the
main service will restart all the workers as well.
2020-11-23 08:55:07 +01:00

36 lines
1.2 KiB
YAML

---
- name: check that sypervision and deployment are compatible
fail:
msg: "Either both or neither of deployment and supervision method should be docker."
when: (matrix_synapse_supervision_method == "docker" and matrix_synapse_deployment_method != "docker") or
(matrix_synapse_deployment_method == "docker" and matrix_synapse_supervision_method != "docker")
- name: Fail if workers are enabled but no redis is configured for synapse
fail:
msg: "Redis needs to be enabled on synapse in order for workers to be able to be run"
when: matrix_synapse_workers_enabled|bool and not matrix_synapse_redis_enabled|bool
- name: prepare user, group and base directory
import_tasks: prepare.yml
- name: configure workers
import_tasks: configure_workers.yml
when: matrix_synapse_workers_enabled
- name: configure config overrides from workers
import_tasks: configure_worker_overrides.yml
when: matrix_synapse_workers_enabled
- name: configure synapse
import_tasks: configure.yml
- name: deploy workers
import_tasks: deploy_workers.yml
when: matrix_synapse_workers_enabled
- name: deploy synapse
import_tasks: deployment.yml
- name: configure service
import_tasks: systemd.yml
when: matrix_synapse_supervision_method == "systemd"