Rearrange matrix+riot ansible script, move volumes to host mounts.

This commit is contained in:
Jesper Hess 2019-03-04 21:38:36 +01:00
parent 55c8e77254
commit 1f8b1827ff
Signed by untrusted user: graffen
GPG key ID: 351A89E40D763F0F
4 changed files with 28 additions and 21 deletions

View file

@ -23,9 +23,11 @@ fider:
matrix:
domain: "matrix.{{ base_domain }}"
volume_folder: "{{ volume_root_folder }}/matrix"
riot:
domain: "riot.{{ base_domain }}"
volume_folder: "{{ volume_root_folder }}/riot"
privatebin:
domain: "paste.{{ base_domain }}"

View file

@ -23,7 +23,7 @@
"feature_tabbed_settings": "enable",
"feature_sas": "enable"
},
"welcomeUserId": "@riot-bot:matrix.org",
"welcomeUserId": "",
"piwik": false,
"roomDirectory": {
"servers": [

View file

@ -1,26 +1,35 @@
---
- name: create matrix volume folders
file:
name: "{{ matrix.volume_folder }}/{{ volume }}"
state: directory
loop:
- "db"
loop_control:
loop_var: volume
- name: create riot volume folders
file:
name: "{{ riot.volume_folder }}/{{ volume }}"
state: directory
loop:
- "data"
loop_control:
loop_var: volume
- name: matrix network
docker_network:
name: matrix
- name: matrix database volume
docker_volume:
name: matrix_db
- name: riot volume
docker_volume:
name: riot_app
- name: upload riot config.json
template:
src: files/configs/riot-config.json
dest: /var/lib/docker/volumes/riot_app/_data/config.json
src: files/configs/riot/config.json
dest: "{{ riot.volume_folder }}/data/config.json"
- name: upload riot.im.conf
template:
src: files/configs/riot.im.conf
dest: /var/lib/docker/volumes/riot_app/_data/riot.im.conf
src: files/configs/riot/riot.im.conf
dest: "{{ riot.volume_folder }}/data/riot.im.conf"
- name: matrix database container
docker_container:
@ -31,7 +40,7 @@
networks:
- name: matrix
volumes:
- matrix_db:/var/lib/postgresql/data
- "{{ matrix.volume_folder }}/db:/var/lib/postgresql/data"
env:
POSTGRES_USER: "synapse"
POSTGRES_PASSWORD: "{{ postgres_passwords.matrix }}"
@ -43,9 +52,6 @@
restart_policy: unless-stopped
networks:
- name: matrix
published_ports:
- 8008:8008
- 8448:8448
env:
SYNAPSE_SERVER_NAME: "{{ base_domain }}"
SYNAPSE_REPORT_STATS: "False"
@ -69,13 +75,12 @@
networks:
- name: matrix
- name: external_services
volumes:
- riot_app:/data
published_ports:
- 8080
- "8080"
volumes:
- "{{ riot.volume_folder }}/data:/data"
env:
VIRTUAL_HOST: "{{ riot.domain }}"
VIRTUAL_PORT: "8080"
LETSENCRYPT_HOST: "{{ riot.domain }}"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"