data.coop-ansible/roles/docker/tasks/services/matrix_element.yml

71 lines
1.8 KiB
YAML

# vim: ft=yaml.ansible
---
- name: Create Matrix volume folders
file:
name: "{{ services.matrix.volume_folder }}/{{ volume }}"
state: directory
owner: "991"
group: "991"
loop:
- "data"
- "data/uploads"
- "data/media"
loop_control:
loop_var: volume
- name: Create Matrix DB folder
file:
name: "{{ services.matrix.volume_folder }}/db"
state: "directory"
- name: Create Element volume folders
file:
name: "{{ services.element.volume_folder }}/{{ volume }}"
state: directory
loop:
- "data"
loop_control:
loop_var: volume
- name: Upload Element config.json
template:
src: element/config.json.j2
dest: "{{ services.element.volume_folder }}/data/config.json"
- name: Upload Element riot.im.conf
copy:
src: element/riot.im.conf
dest: "{{ services.element.volume_folder }}/data/riot.im.conf"
- name: upload vhost config for matrix domain
copy:
src: vhost/matrix
dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ services.matrix.domain }}"
- name: Upload vhost config for Element domain
copy:
src: vhost/element
dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ item }}"
loop: "{{ services.element.domains }}"
- name: Upload homeserver.yaml
template:
src: matrix/homeserver.yaml.j2
dest: "{{ services.matrix.volume_folder }}/data/homeserver.yaml"
- name: upload matrix logging config
copy:
src: matrix/log.config
dest: "{{ services.matrix.volume_folder }}/data/matrix.data.coop.log.config"
- name: Upload Compose file for Matrix and Element
template:
src: compose-files/matrix_element.yml.j2
dest: "{{ services.matrix.volume_folder }}/docker-compose.yml"
- name: Deploy Matrix and Element
docker_compose:
project_src: "{{ services.matrix.volume_folder }}"
pull: true
state: present