69 lines
No EOL
1.6 KiB
YAML
69 lines
No EOL
1.6 KiB
YAML
---
|
|
- name: "Set site_data_path to {{ www_path }}/{{ site.slug }}"
|
|
set_fact: site_data_path="{{ www_path }}/{{ site.slug }}"
|
|
tags: always
|
|
|
|
####################
|
|
# Render templates #
|
|
####################
|
|
|
|
- name: "Render templates"
|
|
import_tasks: render.yml
|
|
tags: render
|
|
|
|
##########################
|
|
# Generate configuration #
|
|
##########################
|
|
|
|
- name: "Create folder {{ site_data_path }}"
|
|
file:
|
|
path: "{{ site_data_path }}"
|
|
state: directory
|
|
mode: "770"
|
|
group: "www-data"
|
|
tags: config
|
|
# - name: "Set {{ site_data_path }} permissions"
|
|
# file:
|
|
# path: "{{ site_data_path }}"
|
|
# mode: '770'
|
|
# group: "www-data"
|
|
# become: true
|
|
# tags: config
|
|
|
|
- name: "Copy homeserver.yaml to {{ site_data_path }}"
|
|
copy:
|
|
src: "{{ sites_path }}/{{ site.slug }}/homeserver.yaml"
|
|
dest: "{{ site_data_path }}/homeserver.yaml"
|
|
remote_src: yes
|
|
tags: config
|
|
|
|
- name: "Let synapse generate missing configuration files"
|
|
docker_container:
|
|
name: synapse_config_generator
|
|
image: "matrixdotorg/synapse:{{ synapse.version }}"
|
|
command: "generate"
|
|
volumes:
|
|
- "{{ site_data_path }}:/data"
|
|
env:
|
|
SYNAPSE_SERVER_NAME: "{{ site.url }}"
|
|
SYNAPSE_REPORT_STATS: "no"
|
|
UID: "{{ site.user_uid }}"
|
|
GID: "{{ site.user_gid }}"
|
|
tags: config
|
|
|
|
|
|
############################
|
|
# PostgreSQL configuration #
|
|
############################
|
|
|
|
- name: "Setup PostgreSQL"
|
|
import_tasks: postgres.yml
|
|
tags: postgres
|
|
|
|
#################
|
|
# Setup backups #
|
|
#################
|
|
|
|
- name: "Setup backups"
|
|
import_tasks: backup.yml
|
|
tags: backup |