ansible-collection-famedly-.../tasks/configure.yml

55 lines
1.3 KiB
YAML

---
- name: Generate registration secret
block:
- command: /usr/bin/pwgen -sn 84 1
register: pwgen
delegate_to: localhost
become: false
- set_fact:
matrix_synapse_registration_secret: "{{ pwgen.stdout }}"
when: matrix_synapse_registration_secret is not defined
- name: create user
user:
name: synapse
state: present
register: synapse_user
tags:
- pre_install
- name: create directory
file:
name: /opt/synapse
state: directory
owner: synapse
group: synapse
tags:
- pre_install
- name: Create directory for media storage
file:
name: "{{ item }}"
state: directory
owner: synapse
group: synapse
loop:
- "{{ matrix_synapse_config.media_store_path }}"
- "{{ matrix_synapse_config.uploads_path }}"
- /opt/synapse/tls
- name: Deploy config
copy:
content: "{{ matrix_synapse_config | to_nice_yaml }}"
dest: "/opt/synapse/homeserver.yaml"
owner: synapse
group: synapse
notify:
- "restart matrix-synapse"
- name: Configure logging
import_tasks: logging.yml
when: matrix_synapse_supervision_method == "systemd"
# TODO: Figure out how to make sure that logging ends up in rsyslog no matter what system we run on
- name: Create certificates
include_tasks: crypto.yml