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

64 lines
1.4 KiB
YAML
Raw Permalink Normal View History

2022-02-27 16:05:34 -05:00
- name: Install matrix packages
community.general.pacman:
name: matrix-synapse
state: present
- name: Copy signing key
copy:
2022-03-01 17:43:44 -05:00
src: signing.key.secret
2022-02-27 16:05:34 -05:00
dest: /etc/synapse/signing.key
2022-03-02 19:58:31 -05:00
notify: Restart synapse
2022-03-04 13:08:47 -05:00
ignore_errors: true
2022-02-27 16:05:34 -05:00
- name: Deploy matrix homeserver configuration
template:
2022-03-01 17:43:44 -05:00
src: homeserver.yaml.j2
2022-02-27 16:05:34 -05:00
dest: /etc/synapse/homeserver.yaml
2022-03-02 19:58:31 -05:00
notify: Restart synapse
2022-02-27 16:05:34 -05:00
- name: Deploy matrix logging configuration
template:
2022-03-01 17:43:44 -05:00
src: log.config.j2
2022-02-27 16:05:34 -05:00
dest: /etc/synapse/log.config
2022-03-02 19:58:31 -05:00
notify: Restart synapse
2022-02-27 16:05:34 -05:00
- 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
2022-03-02 19:58:31 -05:00
- 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
2022-02-27 16:05:34 -05:00
- name: Enable matrix service
service:
name: synapse
enabled: yes
state: started