Deduplicate nearly identical init logic from backend.yml and backend_sftp.yml into init.yml. Also fixes missing set -euo pipefail in the sftp backend variant. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9 lines
264 B
YAML
9 lines
264 B
YAML
---
|
|
- name: Initialize restic repo (if needed)
|
|
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
|