This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
homeserver-ansible/roles/services/synapse/tasks/main.yml
dogeystamp daee2706a4
systemd config is now done via override
this means that updates don't brick services instantly
2023-06-27 13:28:39 -04:00

64 lines
1.4 KiB
YAML

- name: Install matrix packages
community.general.pacman:
name: matrix-synapse
state: present
- name: Copy signing key
copy:
src: signing.key.secret
dest: /etc/synapse/signing.key
notify: Restart synapse
ignore_errors: true
- name: Deploy matrix homeserver configuration
template:
src: homeserver.yaml.j2
dest: /etc/synapse/homeserver.yaml
notify: Restart synapse
- name: Deploy matrix logging configuration
template:
src: log.config.j2
dest: /etc/synapse/log.config
notify: Restart synapse
- name: Create systemd override dir
file:
path: /etc/systemd/system/synapse.service.d/
state: directory
owner: root
group: root
mode: 0755
- name: Deploy systemd override conf
template:
src: synapse.service.j2
dest: /etc/systemd/system/synapse.service.d/override.conf
owner: root
group: root
mode: 0644
notify:
- Run daemon-reload for synapse
- Restart synapse
- name: Find owner of data folder
stat:
path: "{{ dataroot }}/synapse/"
register: data_folder
- name: Ensure data folder is under correct owner
file:
path: "{{ dataroot }}/synapse/"
state: directory
recurse: yes
owner: synapse
group: synapse
when: data_folder.stat.pw_name != "synapse"
notify: Restart synapse
- name: Enable matrix service
service:
name: synapse
enabled: yes
state: started