baikal: add server config
This commit is contained in:
parent
ef8f5da37d
commit
35de046d69
8 changed files with 95 additions and 0 deletions
44
roles/baikal/tasks/main.yml
Normal file
44
roles/baikal/tasks/main.yml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
- name: Ensure data directory is present
|
||||
ansible.builtin.file:
|
||||
path: '/mnt/data1/baikal'
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
|
||||
- name: Ensure data subvolumes are present
|
||||
community.general.btrfs_subvolume:
|
||||
name: '/baikal/{{ item }}'
|
||||
loop:
|
||||
- 'Specific'
|
||||
- 'config'
|
||||
|
||||
- name: Ensure configuration directory is present
|
||||
ansible.builtin.file:
|
||||
path: '/etc/baikal'
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Ensure compose file is present
|
||||
ansible.builtin.copy:
|
||||
src: 'compose.yml'
|
||||
dest: '/etc/baikal/compose.yml'
|
||||
mode: '0644'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
register: res
|
||||
|
||||
- name: Ensure stack is deployed
|
||||
ansible.builtin.shell:
|
||||
chdir: '/etc/baikal'
|
||||
cmd: 'docker compose up -d --remove-orphans'
|
||||
when: 'res.changed'
|
||||
|
||||
- name: Ensure backup script is present
|
||||
ansible.builtin.copy:
|
||||
src: 'baikal.backup.sh'
|
||||
dest: '/etc/backups/baikal.backup.sh'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
mode: '0644'
|
||||
Loading…
Add table
Add a link
Reference in a new issue