linderhof/roles/restic/tasks/backend.yml
Matthias Johnson 75891c3271 initial commit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 15:09:25 -07:00

19 lines
505 B
YAML

---
- name: Ensure restic local repo directory exists
file:
path: "{{ restic_repo }}"
state: directory
owner: root
group: root
mode: "0700"
when: restic_repo is defined and restic_repo.startswith('/') # only local path
- name: Ensure restic repo is initialized
ansible.builtin.shell: |
set -euo pipefail
source /etc/restic/restic.env
restic snapshots > /dev/null 2>&1 || restic init
touch /etc/restic/.initialized
args:
creates: /etc/restic/.initialized