- 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
- name: Deploy matrix logging configuration
src: log.config.j2
dest: /etc/synapse/log.config
- 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
src: synapse.service.j2
dest: /etc/systemd/system/synapse.service.d/override.conf
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
recurse: yes
owner: synapse
group: synapse
when: data_folder.stat.pw_name != "synapse"
- name: Enable matrix service
service:
name: synapse
enabled: yes
state: started