homelab/roles/miniflux/tasks/main.yml

44 lines
1009 B
YAML
Raw Permalink Normal View History

2024-01-12 16:30:15 +01:00
---
- name: Ensure data directory is present
ansible.builtin.file:
path: '/mnt/data1/miniflux'
state: directory
mode: '0755'
owner: 'root'
group: 'root'
- name: Ensure data subvolumes are present
community.general.btrfs_subvolume:
name: '/miniflux/{{ item }}'
with_items:
- 'postgres'
- name: Ensure configuration directory is present
2024-05-20 14:21:21 +02:00
ansible.builtin.file:
2024-01-12 16:30:15 +01:00
path: '/etc/miniflux'
state: directory
mode: '0755'
- name: Ensure compose file is present
2024-05-20 14:21:21 +02:00
ansible.builtin.template:
2024-01-12 16:30:15 +01:00
src: 'compose.yml.j2'
dest: '/etc/miniflux/compose.yml'
mode: '0644'
owner: 'root'
group: 'root'
register: res
- name: Ensure stack is deployed
ansible.builtin.shell:
chdir: '/etc/miniflux'
cmd: 'docker compose up -d --remove-orphans'
when: 'res.changed'
- name: Ensure backup script is present
ansible.builtin.copy:
src: 'miniflux.backup.sh'
dest: '/etc/backups/miniflux.backup.sh'
owner: 'root'
group: 'root'
mode: '0644'