mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2024-11-07 19:27:35 +01:00
353bc7c362
· needs documentation; no checks yet for port clashes or typos in worker name · according to https://github.com/matrix-org/synapse/wiki/Workers-setup-with-nginx#results about 90% of requests go to the synchrotron endpoint · thus, the synchrotron worker is especially suited to be load-balanced · most of the other workers are documented to support only a single instance · https://github.com/matrix-org/synapse/blob/master/docs/workers.md
42 lines
1.5 KiB
YAML
42 lines
1.5 KiB
YAML
---
|
|
|
|
- name: Ensure synapse worker base service file installed
|
|
template:
|
|
src: "{{ role_path }}/templates/synapse/systemd/matrix-synapse-worker@.service.j2"
|
|
dest: "{{ matrix_systemd_path }}/matrix-synapse-worker@.service"
|
|
mode: 0644
|
|
register: matrix_synapse_worker_systemd_service_result
|
|
|
|
- name: Ensure previous worker service symlinks are cleaned (FIXME)
|
|
file:
|
|
path: "{{ item.root + '/' + item.path }}"
|
|
state: absent
|
|
when:
|
|
- item.state == 'link'
|
|
- item.path is match('matrix-synapse-worker@*.service')
|
|
with_filetree:
|
|
- "{{ matrix_systemd_path }}/matrix-synapse.service.wants"
|
|
|
|
- name: Ensure systemd reloaded the worker service unit
|
|
service:
|
|
daemon_reload: yes
|
|
|
|
- name: Ensure individual worker service symlinks exist
|
|
service:
|
|
name: "matrix-synapse-worker@{{ item.worker }}:{{ item.port }}.service"
|
|
enabled: true
|
|
with_items: "{{ matrix_synapse_workers_enabled_list }}"
|
|
|
|
- name: Ensure creation of specific worker configs
|
|
template:
|
|
src: "{{ role_path }}/templates/synapse/worker.yaml.j2"
|
|
dest: "{{ matrix_synapse_config_dir_path }}/worker.{{ item.worker }}:{{ item.port }}.yaml"
|
|
with_list: "{{ matrix_synapse_workers_enabled_list }}"
|
|
|
|
- name: Add workers to synapse.wants list
|
|
set_fact:
|
|
matrix_synapse_systemd_wanted_services_list: >
|
|
{{ matrix_synapse_systemd_wanted_services_list +
|
|
['matrix-synapse-worker@' + item.worker + ':' + item.port|string + '.service'] }}
|
|
with_items: "{{ matrix_synapse_workers_enabled_list }}"
|