ansible-collection-famedly-.../roles/synapse/tasks/configure.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

55 lines
1.3 KiB
YAML

---
- name: Create secrets directory
file:
path: "{{ matrix_synapse_secrets_path }}"
state: directory
owner: synapse
group: synapse
mode: 0750
tags:
- pre_install
- name: Generate secrets
include_tasks: generate_secret.yml
loop:
- file: "macaroon.key"
var: "macaroon_file"
- file: "registration.key"
var: "registration_shared_secret_file"
- file: "form.key"
var: "form_secret_file"
loop_control:
loop_var: secret
- name: Create directories for media storage and tls
file:
path: "{{ item }}"
state: directory
owner: synapse
group: synapse
mode: 0770
loop:
- "{{ matrix_synapse_config.media_store_path }}"
- "{{ matrix_synapse_config.uploads_path }}"
- "{{ matrix_synapse_base_path }}/tls"
- name: Merge replication listener config
set_fact:
matrix_synapse_config: "{{ matrix_synapse_config | combine(matrix_synapse_worker_config, recursive=True, list_merge='append') }}"
when: matrix_synapse_workers_enabled
- name: Deploy config
copy:
content: "{{ matrix_synapse_config | to_nice_yaml }}"
dest: "{{ matrix_synapse_base_path }}/homeserver.yaml"
owner: synapse
group: synapse
mode: 0660
notify:
- "restart matrix-synapse"
- name: Configure logging
import_tasks: logging.yml
- name: Create certificates
include_tasks: crypto.yml