2018-07-30 16:56:33 +02:00
|
|
|
---
|
2020-11-04 07:01:33 +01:00
|
|
|
- name: create appservice user
|
|
|
|
group:
|
|
|
|
name: "matrix-appservices"
|
|
|
|
state: present
|
|
|
|
system: yes
|
|
|
|
|
2019-02-16 11:25:57 +01:00
|
|
|
- name: create user
|
|
|
|
user:
|
|
|
|
name: synapse
|
|
|
|
state: present
|
2020-11-04 07:01:33 +01:00
|
|
|
groups: [ "matrix-appservices" ]
|
|
|
|
append: yes
|
2019-02-16 11:25:57 +01:00
|
|
|
register: synapse_user
|
|
|
|
tags:
|
|
|
|
- pre_install
|
|
|
|
|
|
|
|
- name: create directory
|
|
|
|
file:
|
2019-02-21 23:17:57 +01:00
|
|
|
path: "{{ matrix_synapse_base_path }}"
|
2019-02-16 11:25:57 +01:00
|
|
|
state: directory
|
|
|
|
owner: synapse
|
|
|
|
group: synapse
|
2020-11-04 07:01:33 +01:00
|
|
|
mode: 0750
|
2019-02-16 11:25:57 +01:00
|
|
|
tags:
|
|
|
|
- pre_install
|
2019-02-12 02:43:26 +01:00
|
|
|
|
2019-02-21 01:29:45 +01:00
|
|
|
- name: Create secrets directory
|
|
|
|
file:
|
|
|
|
path: "{{ matrix_synapse_secrets_path }}"
|
|
|
|
state: directory
|
|
|
|
owner: synapse
|
|
|
|
group: synapse
|
2020-11-04 07:01:33 +01:00
|
|
|
mode: 0750
|
2019-02-21 01:29:45 +01:00
|
|
|
tags:
|
|
|
|
- pre_install
|
|
|
|
|
|
|
|
- name: Generate secrets
|
|
|
|
include_tasks: generate_secret.yml
|
|
|
|
loop:
|
|
|
|
- file: "macaroon.key"
|
|
|
|
var: "macaroon_file"
|
|
|
|
- file: "registration.key"
|
|
|
|
var: "registration_shared_secret_file"
|
|
|
|
- file: "form.key"
|
|
|
|
var: "form_secret_file"
|
|
|
|
loop_control:
|
|
|
|
loop_var: secret
|
|
|
|
|
2020-11-04 07:01:33 +01:00
|
|
|
- name: Create directories for media storage and tls
|
2019-02-15 03:07:03 +01:00
|
|
|
file:
|
2019-02-21 01:29:45 +01:00
|
|
|
path: "{{ item }}"
|
2019-02-15 03:07:03 +01:00
|
|
|
state: directory
|
|
|
|
owner: synapse
|
|
|
|
group: synapse
|
2020-11-04 07:01:33 +01:00
|
|
|
mode: 0770
|
2019-02-15 03:07:03 +01:00
|
|
|
loop:
|
|
|
|
- "{{ matrix_synapse_config.media_store_path }}"
|
|
|
|
- "{{ matrix_synapse_config.uploads_path }}"
|
2019-02-21 23:17:57 +01:00
|
|
|
- "{{ matrix_synapse_base_path }}/tls"
|
2019-02-15 03:07:03 +01:00
|
|
|
|
2018-07-30 16:56:33 +02:00
|
|
|
- name: Deploy config
|
2019-02-15 00:25:14 +01:00
|
|
|
copy:
|
|
|
|
content: "{{ matrix_synapse_config | to_nice_yaml }}"
|
2019-02-21 23:17:57 +01:00
|
|
|
dest: "{{ matrix_synapse_base_path }}/homeserver.yaml"
|
2018-07-30 16:56:33 +02:00
|
|
|
owner: synapse
|
|
|
|
group: synapse
|
2020-11-04 07:01:33 +01:00
|
|
|
mode: 0660
|
2018-07-30 16:56:33 +02:00
|
|
|
notify:
|
2019-02-15 03:08:08 +01:00
|
|
|
- "restart matrix-synapse"
|
2018-07-30 16:56:33 +02:00
|
|
|
|
2018-12-02 23:12:30 +01:00
|
|
|
- name: Configure logging
|
|
|
|
import_tasks: logging.yml
|
2018-07-30 16:56:33 +02:00
|
|
|
|
2018-12-03 23:29:19 +01:00
|
|
|
- name: Create certificates
|
2019-02-12 02:38:17 +01:00
|
|
|
include_tasks: crypto.yml
|