restic: Add stack

Adapted from cloudserve-infrastructure, implements a backup stack using
restic. The actual backups have to be implemented by individual other
roles but this sets up initialization, pruning and checking of a repository.
This commit is contained in:
Marty Oehme 2025-07-17 21:38:35 +02:00
parent 93876315ca
commit 86d49a756b
Signed by: Marty
GPG key ID: 4E535BC19C61886E
7 changed files with 146 additions and 0 deletions

View file

@ -0,0 +1,17 @@
---
- name: Create local backup directory
ansible.builtin.file:
state: directory
path: "{{ restic_repo }}"
owner: root
group: root
mode: 0770
when: restic_repo is regex('^/.+')
- name: Deploy restic to compose
community.docker.docker_compose_v2:
project_name: restic
definition: "{{ lookup('template', 'docker-compose.yaml.j2') | from_yaml }}"
remove_orphans: true
wait: true
wait_timeout: 60