infrastructure/playbooks/tasks/steps/restore-volume.yml

17 lines
542 B
YAML
Raw Normal View History

2024-10-28 23:13:56 +00:00
- name: Get infos on volume "{{ volume.name }}"
2024-10-19 13:18:54 +00:00
community.docker.docker_volume_info:
2024-10-28 23:13:56 +00:00
name: "{{ volume.name }}"
2024-10-19 13:18:54 +00:00
register: volume_info_result
2024-10-28 23:13:56 +00:00
- name: Restore volume "{{ volume.name }}"
2024-10-19 13:18:54 +00:00
ansible.builtin.command:
2024-10-28 23:13:56 +00:00
cmd: sudo autorestic -c .autorestic.all.yml restore -l {{ volume.name }} --from borgbase
2024-10-19 13:18:54 +00:00
chdir: "{{ (services_path, 'backup') | path_join }}"
when: not volume_info_result.exists
changed_when: true
become: true
register: cmd_result_backup
until: "cmd_result_backup is not failed"
retries: 10
delay: 10