2022-12-29 21:13:31 +00:00
|
|
|
# vim: ft=yaml.ansible
|
2019-02-09 10:20:11 +00:00
|
|
|
---
|
2023-04-07 22:35:49 +00:00
|
|
|
- name: Create Matrix volume folders
|
2019-03-04 20:38:36 +00:00
|
|
|
file:
|
2022-11-26 08:15:18 +00:00
|
|
|
name: "{{ services.matrix.volume_folder }}/{{ volume }}"
|
2019-03-04 20:38:36 +00:00
|
|
|
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
|
|
|
|
|
2023-04-07 22:35:49 +00:00
|
|
|
- name: Create Matrix DB folder
|
2019-03-07 20:28:54 +00:00
|
|
|
file:
|
2022-11-26 08:15:18 +00:00
|
|
|
name: "{{ services.matrix.volume_folder }}/db"
|
2019-03-07 20:28:54 +00:00
|
|
|
state: "directory"
|
|
|
|
|
2023-04-07 22:35:49 +00:00
|
|
|
- name: Create Element volume folders
|
2019-03-04 20:38:36 +00:00
|
|
|
file:
|
2023-04-07 22:35:49 +00:00
|
|
|
name: "{{ services.element.volume_folder }}/{{ volume }}"
|
2019-03-04 20:38:36 +00:00
|
|
|
state: directory
|
|
|
|
loop:
|
|
|
|
- "data"
|
|
|
|
loop_control:
|
|
|
|
loop_var: volume
|
2019-02-09 10:20:11 +00:00
|
|
|
|
2023-04-07 22:35:49 +00:00
|
|
|
- name: Upload Element config.json
|
2019-02-09 14:43:15 +00:00
|
|
|
template:
|
2023-07-09 18:27:32 +00:00
|
|
|
src: element.config.json.j2
|
2023-04-07 22:35:49 +00:00
|
|
|
dest: "{{ services.element.volume_folder }}/data/config.json"
|
2019-02-09 14:43:15 +00:00
|
|
|
|
2023-04-07 22:35:49 +00:00
|
|
|
- name: Upload Element riot.im.conf
|
2023-07-09 18:27:32 +00:00
|
|
|
copy:
|
|
|
|
src: element/riot.im.conf
|
2023-04-07 22:35:49 +00:00
|
|
|
dest: "{{ services.element.volume_folder }}/data/riot.im.conf"
|
2019-02-09 14:43:15 +00:00
|
|
|
|
2019-03-05 08:06:19 +00:00
|
|
|
- name: upload vhost config for matrix domain
|
2023-07-09 18:27:32 +00:00
|
|
|
copy:
|
|
|
|
src: vhost/matrix
|
2022-11-26 08:15:18 +00:00
|
|
|
dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ services.matrix.domain }}"
|
2019-03-05 08:06:19 +00:00
|
|
|
|
2023-04-07 22:35:49 +00:00
|
|
|
- name: Upload vhost config for Element domain
|
2023-07-09 18:27:32 +00:00
|
|
|
copy:
|
|
|
|
src: vhost/element
|
2022-11-26 08:15:18 +00:00
|
|
|
dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ item }}"
|
2023-04-07 22:35:49 +00:00
|
|
|
loop: "{{ services.element.domains }}"
|
2020-11-27 09:23:58 +00:00
|
|
|
|
2023-04-07 22:35:49 +00:00
|
|
|
- name: Upload homeserver.yaml
|
2019-03-07 20:28:54 +00:00
|
|
|
template:
|
2023-07-09 18:27:32 +00:00
|
|
|
src: matrix.homeserver.yaml.j2
|
2022-11-26 08:15:18 +00:00
|
|
|
dest: "{{ services.matrix.volume_folder }}/data/homeserver.yaml"
|
2019-03-07 20:28:54 +00:00
|
|
|
|
|
|
|
- name: upload matrix logging config
|
2023-07-09 18:27:32 +00:00
|
|
|
copy:
|
|
|
|
src: matrix/log.config
|
2022-11-26 08:15:18 +00:00
|
|
|
dest: "{{ services.matrix.volume_folder }}/data/matrix.data.coop.log.config"
|
2019-03-07 20:28:54 +00:00
|
|
|
|
2023-04-07 22:35:49 +00:00
|
|
|
- name: Set up Matrix and Element
|
2021-02-01 20:06:23 +00:00
|
|
|
docker_compose:
|
2019-03-15 17:56:27 +00:00
|
|
|
project_name: matrix
|
2023-04-07 22:15:05 +00:00
|
|
|
pull: true
|
2019-03-15 17:56:27 +00:00
|
|
|
definition:
|
|
|
|
version: "3.6"
|
|
|
|
services:
|
2023-04-07 22:15:05 +00:00
|
|
|
postgres:
|
2022-12-28 15:19:07 +00:00
|
|
|
image: "postgres:{{ services.matrix.postgres_version }}"
|
2019-03-15 17:56:27 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
|
|
- matrix
|
|
|
|
volumes:
|
2022-11-26 08:15:18 +00:00
|
|
|
- "{{ services.matrix.volume_folder }}/db:/var/lib/postgresql/data"
|
2019-03-15 17:56:27 +00:00
|
|
|
environment:
|
|
|
|
POSTGRES_USER: "synapse"
|
|
|
|
POSTGRES_PASSWORD: "{{ postgres_passwords.matrix }}"
|
|
|
|
|
2023-04-07 22:15:05 +00:00
|
|
|
synapse:
|
2022-12-28 15:19:07 +00:00
|
|
|
image: "matrixdotorg/synapse:{{ services.matrix.version }}"
|
2019-03-15 17:56:27 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
|
|
- matrix
|
2020-02-26 19:55:21 +00:00
|
|
|
- external_services
|
|
|
|
volumes:
|
2022-11-26 08:15:18 +00:00
|
|
|
- "{{ services.matrix.volume_folder }}/data:/data"
|
2019-03-15 17:56:27 +00:00
|
|
|
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"
|
2022-11-26 08:15:18 +00:00
|
|
|
VIRTUAL_HOST: "{{ services.matrix.domain }}"
|
2019-03-15 17:56:27 +00:00
|
|
|
VIRTUAL_PORT: "8008"
|
2022-11-26 08:15:18 +00:00
|
|
|
LETSENCRYPT_HOST: "{{ services.matrix.domain }}"
|
2019-03-15 17:56:27 +00:00
|
|
|
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
|
2019-02-09 14:43:15 +00:00
|
|
|
|
2023-04-07 22:15:05 +00:00
|
|
|
element:
|
2023-04-07 22:35:49 +00:00
|
|
|
image: "avhost/docker-matrix-element:{{ services.element.version }}"
|
2019-03-15 17:56:27 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
|
|
- matrix
|
|
|
|
- external_services
|
2022-11-16 12:45:58 +00:00
|
|
|
expose:
|
|
|
|
- 8080
|
2019-03-15 17:56:27 +00:00
|
|
|
volumes:
|
2023-04-07 22:35:49 +00:00
|
|
|
- "{{ services.element.volume_folder }}/data:/data"
|
2019-03-15 17:56:27 +00:00
|
|
|
environment:
|
2023-04-07 22:35:49 +00:00
|
|
|
VIRTUAL_HOST: "{{ services.element.domains | join(',') }}"
|
2019-03-15 17:56:27 +00:00
|
|
|
VIRTUAL_PORT: "8080"
|
2023-04-07 22:35:49 +00:00
|
|
|
LETSENCRYPT_HOST: "{{ services.element.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"
|