matrix: add initial conduit-only config
This commit is contained in:
parent
b5e9afe5a4
commit
ef8f5da37d
11 changed files with 182 additions and 0 deletions
64
roles/matrix/tasks/main.yml
Normal file
64
roles/matrix/tasks/main.yml
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
---
|
||||
- name: Ensure data directory is present
|
||||
ansible.builtin.file:
|
||||
path: '/mnt/data1/matrix'
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
|
||||
- name: Ensure data subvolumes are present
|
||||
community.general.btrfs_subvolume:
|
||||
name: '/matrix/{{ item }}'
|
||||
with_items:
|
||||
- 'conduit'
|
||||
|
||||
- name: Ensure subvolume permissions are correct
|
||||
ansible.builtin.file:
|
||||
path: "/mnt/data1/matrix/{{ item.dir }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: {{ item.owner }}
|
||||
group: {{ item.group }}
|
||||
loop:
|
||||
- dir: 'conduit'
|
||||
owner: 1000
|
||||
group: 1000
|
||||
|
||||
- name: Ensure configuration directory is present
|
||||
ansible.builtin.file:
|
||||
path: '/etc/matrix'
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Ensure Conduit config file is present
|
||||
ansible.builtin.copy:
|
||||
src: 'conduit.toml'
|
||||
dest: '/etc/matrix/conduit.toml'
|
||||
mode: '0644'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
notify: conduit-restart
|
||||
|
||||
- name: Ensure compose file is present
|
||||
ansible.builtin.copy:
|
||||
src: 'compose.yml'
|
||||
dest: '/etc/matrix/compose.yml'
|
||||
mode: '0644'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
register: res
|
||||
|
||||
- name: Ensure stack is deployed
|
||||
ansible.builtin.shell:
|
||||
chdir: '/etc/matrix'
|
||||
cmd: 'docker compose up -d --remove-orphans'
|
||||
when: 'res.changed'
|
||||
|
||||
- name: Ensure backup script is present
|
||||
ansible.builtin.copy:
|
||||
src: 'matrix.backup.sh'
|
||||
dest: '/etc/backups/matrix.backup.sh'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
mode: '0644'
|
||||
Loading…
Add table
Add a link
Reference in a new issue