2019-02-09 10:20:11 +00:00
|
|
|
---
|
2019-03-04 20:38:36 +00:00
|
|
|
- name: create matrix volume folders
|
|
|
|
file:
|
|
|
|
name: "{{ matrix.volume_folder }}/{{ volume }}"
|
|
|
|
state: directory
|
2019-03-07 20:28:54 +00:00
|
|
|
owner: "991"
|
|
|
|
group: "991"
|
2019-03-04 20:38:36 +00:00
|
|
|
loop:
|
2019-03-07 20:28:54 +00:00
|
|
|
- "data"
|
|
|
|
- "data/uploads"
|
|
|
|
- "data/media"
|
2019-03-04 20:38:36 +00:00
|
|
|
loop_control:
|
|
|
|
loop_var: volume
|
|
|
|
|
2019-03-07 20:28:54 +00:00
|
|
|
- name: create matrix DB folder
|
|
|
|
file:
|
|
|
|
name: "{{ matrix.volume_folder }}/db"
|
|
|
|
state: "directory"
|
|
|
|
|
2019-03-04 20:38:36 +00:00
|
|
|
- name: create riot volume folders
|
|
|
|
file:
|
|
|
|
name: "{{ riot.volume_folder }}/{{ volume }}"
|
|
|
|
state: directory
|
|
|
|
loop:
|
|
|
|
- "data"
|
|
|
|
loop_control:
|
|
|
|
loop_var: volume
|
2019-02-09 10:20:11 +00:00
|
|
|
|
2019-02-09 14:43:15 +00:00
|
|
|
- name: upload riot config.json
|
|
|
|
template:
|
2019-03-04 20:38:36 +00:00
|
|
|
src: files/configs/riot/config.json
|
|
|
|
dest: "{{ riot.volume_folder }}/data/config.json"
|
2019-02-09 14:43:15 +00:00
|
|
|
|
|
|
|
- name: upload riot.im.conf
|
|
|
|
template:
|
2019-03-04 20:38:36 +00:00
|
|
|
src: files/configs/riot/riot.im.conf
|
|
|
|
dest: "{{ riot.volume_folder }}/data/riot.im.conf"
|
2019-02-09 14:43:15 +00:00
|
|
|
|
2019-03-05 07:28:53 +00:00
|
|
|
- name: upload vhost config for root domain
|
|
|
|
template:
|
|
|
|
src: files/configs/matrix/vhost-root
|
|
|
|
dest: "{{ nginx.volume_folder }}/vhost/{{ base_domain }}"
|
|
|
|
|
2019-03-05 08:06:19 +00:00
|
|
|
- name: upload vhost config for matrix domain
|
|
|
|
template:
|
|
|
|
src: files/configs/matrix/vhost-matrix
|
|
|
|
dest: "{{ nginx.volume_folder }}/vhost/{{ matrix.domain }}"
|
|
|
|
|
2020-11-27 09:23:58 +00:00
|
|
|
- name: upload vhost config for riot domain
|
|
|
|
template:
|
|
|
|
src: files/configs/matrix/vhost-riot
|
2021-02-01 19:51:28 +00:00
|
|
|
dest: "{{ nginx.volume_folder }}/vhost/{{ riot.domains[0] }}"
|
2020-11-27 09:23:58 +00:00
|
|
|
|
2019-03-07 20:28:54 +00:00
|
|
|
- name: upload homeserver.yaml
|
|
|
|
template:
|
2021-07-03 06:44:35 +00:00
|
|
|
src: "files/configs/matrix/homeserver.yaml.j2"
|
2019-03-07 20:28:54 +00:00
|
|
|
dest: "{{ matrix.volume_folder }}/data/homeserver.yaml"
|
|
|
|
|
|
|
|
- name: upload matrix logging config
|
|
|
|
template:
|
|
|
|
src: "files/configs/matrix/matrix.data.coop.log.config"
|
|
|
|
dest: "{{ matrix.volume_folder }}/data/matrix.data.coop.log.config"
|
|
|
|
|
2019-03-15 17:56:27 +00:00
|
|
|
- name: set up matrix and riot
|
2021-02-01 20:06:23 +00:00
|
|
|
docker_compose:
|
2019-03-15 17:56:27 +00:00
|
|
|
project_name: matrix
|
|
|
|
pull: yes
|
|
|
|
definition:
|
|
|
|
version: "3.6"
|
|
|
|
services:
|
|
|
|
matrix_db:
|
|
|
|
container_name: matrix_db
|
|
|
|
image: postgres:10
|
|
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
|
|
- matrix
|
|
|
|
volumes:
|
|
|
|
- "{{ matrix.volume_folder }}/db:/var/lib/postgresql/data"
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: "synapse"
|
|
|
|
POSTGRES_PASSWORD: "{{ postgres_passwords.matrix }}"
|
|
|
|
|
|
|
|
matrix_app:
|
|
|
|
container_name: matrix
|
2021-10-10 13:25:54 +00:00
|
|
|
image: matrixdotorg/synapse:v1.44.0
|
2019-03-15 17:56:27 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
|
|
- matrix
|
2020-02-26 19:55:21 +00:00
|
|
|
- external_services
|
2019-03-15 17:56:27 +00:00
|
|
|
ports:
|
|
|
|
- 8008
|
2020-02-26 19:55:21 +00:00
|
|
|
volumes:
|
2019-03-15 17:56:27 +00:00
|
|
|
- "{{ matrix.volume_folder }}/data:/data"
|
|
|
|
environment:
|
|
|
|
SYNAPSE_CONFIG_PATH: "/data/homeserver.yaml"
|
2019-03-30 08:35:04 +00:00
|
|
|
SYNAPSE_CACHE_FACTOR: "2"
|
2019-03-15 17:56:27 +00:00
|
|
|
SYNAPSE_LOG_LEVEL: "INFO"
|
|
|
|
VIRTUAL_HOST: "{{ matrix.domain }}"
|
|
|
|
VIRTUAL_PORT: "8008"
|
|
|
|
LETSENCRYPT_HOST: "{{ matrix.domain }}"
|
|
|
|
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
|
2019-02-09 14:43:15 +00:00
|
|
|
|
2019-03-15 17:56:27 +00:00
|
|
|
riot:
|
|
|
|
container_name: riot_app
|
2021-10-10 13:25:54 +00:00
|
|
|
image: avhost/docker-matrix-riot:v1.9.0
|
2019-03-15 17:56:27 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
|
|
- matrix
|
|
|
|
- external_services
|
|
|
|
ports:
|
|
|
|
- 8080
|
|
|
|
volumes:
|
2020-02-26 19:55:21 +00:00
|
|
|
- "{{ riot.volume_folder }}/data:/data"
|
2019-03-15 17:56:27 +00:00
|
|
|
environment:
|
2020-12-17 07:43:24 +00:00
|
|
|
VIRTUAL_HOST: "{{ riot.domains|join(',') }}"
|
2019-03-15 17:56:27 +00:00
|
|
|
VIRTUAL_PORT: "8080"
|
2020-12-17 07:43:24 +00:00
|
|
|
LETSENCRYPT_HOST: "{{ riot.domains|join(',') }}"
|
2019-03-15 17:56:27 +00:00
|
|
|
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
|
2019-02-09 17:49:03 +00:00
|
|
|
|
2020-02-26 19:55:21 +00:00
|
|
|
networks:
|
2019-03-15 17:56:27 +00:00
|
|
|
external_services:
|
|
|
|
external:
|
|
|
|
name: external_services
|
|
|
|
matrix:
|
|
|
|
name: "matrix"
|