Extract restic repo init to shared task file
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>
This commit is contained in:
parent
16da843131
commit
796428cbda
3 changed files with 11 additions and 15 deletions
|
|
@ -20,11 +20,5 @@
|
|||
dest: /root/.ssh/config
|
||||
mode: "0644"
|
||||
|
||||
- name: Initialize restic repo on Storage Box (if needed)
|
||||
ansible.builtin.shell: |
|
||||
source /etc/restic/restic.env
|
||||
restic snapshots > /dev/null 2>&1 || restic init
|
||||
touch /etc/restic/.initialized
|
||||
args:
|
||||
creates: /etc/restic/.initialized
|
||||
- ansible.builtin.include_tasks: init.yml
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue