2018-07-30 14:56:33 +00:00
|
|
|
---
|
|
|
|
- name: Create directory for media storage
|
|
|
|
file:
|
2018-12-02 22:16:49 +00:00
|
|
|
name: "/opt/synapse/{{ item }}"
|
2018-07-30 14:56:33 +00:00
|
|
|
state: directory
|
|
|
|
owner: synapse
|
|
|
|
group: synapse
|
2018-12-02 22:16:49 +00:00
|
|
|
loop:
|
|
|
|
- media_store
|
|
|
|
- uploads
|
|
|
|
- ssl
|
2018-07-30 14:56:33 +00:00
|
|
|
|
|
|
|
- name: Deploy config
|
|
|
|
template:
|
|
|
|
src: "homeserver.yaml.j2"
|
|
|
|
dest: "/opt/synapse/homeserver.yaml"
|
|
|
|
owner: synapse
|
|
|
|
group: synapse
|
|
|
|
notify:
|
|
|
|
- "restart synapse"
|
|
|
|
|
2018-12-02 22:12:30 +00:00
|
|
|
- name: Configure logging
|
|
|
|
import_tasks: logging.yml
|
2018-07-30 14:56:33 +00:00
|
|
|
|
2018-12-02 22:25:50 +00:00
|
|
|
- name: Create signing key
|
|
|
|
shell: >
|
|
|
|
/opt/synapse/env/bin/python -c "
|
|
|
|
from signedjson import key;
|
|
|
|
with open('/opt/synapse/ssl/{{ matrix_synapse_domain}}.signing.key','w') as file:
|
|
|
|
key.write_signing_keys(file, [key.generate_signing_key('first')]);
|
|
|
|
"
|
2018-07-30 14:56:33 +00:00
|
|
|
args:
|
2018-12-02 22:25:50 +00:00
|
|
|
creates: /opt/synapse/ssl/{{ matrix_synapse_domain }}.signing.key
|
2018-07-30 14:56:33 +00:00
|
|
|
become: true
|
2018-12-02 22:25:50 +00:00
|
|
|
become_user: synapse
|
|
|
|
notify:
|
|
|
|
- "restart synapse"
|
2018-12-02 22:25:20 +00:00
|
|
|
|
|
|
|
- name: Use letsencrypt certificate
|
|
|
|
include_tasks: letsencrypt.yml
|
|
|
|
when: not skip_letsencrypt
|