homelab/roles/synapse/tasks/main.yml
Ivan Reshetnikov fe8529bfa9
Add arguments for synapse role, fix federation
- Add role arguments
- Open port 8448 for s2s connections
- Make openid and turn server optional
2024-10-29 15:34:38 +05:00

50 lines
1.3 KiB
YAML

---
- name: Create synapse volume
become: true
community.docker.docker_volume:
name: synapse
- name: Create root-owned synapse config dir
become: true
ansible.builtin.file:
path: /etc/synapse
state: directory
mode: "1700"
owner: root
- name: Create nested synapse config dir owned by synapse user
become: true
ansible.builtin.file:
path: /etc/synapse/_data
state: directory
mode: "1700"
owner: "991"
- name: Copy synapse config
become: true
ansible.builtin.template:
src: synapse.yaml.j2
dest: /etc/synapse/_data/homeserver.yaml
owner: "991"
mode: "0600"
register: serverconf
- name: Copy synapse log config
become: true
ansible.builtin.template:
src: log.config.j2
dest: /etc/synapse/_data/log.config
owner: "991"
mode: "0600"
register: logconf
- name: Create synapse container
become: true
community.docker.docker_container:
name: synapse
image: matrixdotorg/synapse:v1.116.0
volumes:
- synapse:/data
- /etc/synapse/_data:/etc/synapse:ro
env:
SYNAPSE_CONFIG_PATH: /etc/synapse/homeserver.yaml
networks:
- name: postgresql
- name: haproxy
restart_policy: unless-stopped
recreate: "{{ serverconf.changed or logconf.changed }}"