- 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