29 lines
585 B
YAML
29 lines
585 B
YAML
---
|
|
# handlers file for borgmatic
|
|
|
|
- name: Initialize repository
|
|
ansible.builtin.command:
|
|
argv:
|
|
- "{{ which_borgmatic.stdout }}"
|
|
- init
|
|
- --encryption
|
|
- repokey
|
|
when: repo_infos | length == 0
|
|
become: true
|
|
loop: "{{ borgmatic_repositories }}"
|
|
|
|
- name: Restore repository
|
|
ansible.builtin.command:
|
|
argv:
|
|
- "{{ which_borgmatic.stdout }}"
|
|
- extract
|
|
- --archive
|
|
- latest
|
|
- --destination
|
|
- /
|
|
when:
|
|
- repo_infos | length > 0
|
|
- borgmatic_restore_first
|
|
become: true
|
|
loop: "{{ borgmatic_repositories }}"
|