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

17 lines
526 B
YAML
Raw Normal View History

2024-10-19 13:18:54 +00:00
- name: Get infos on volume "{{ volume_name }}"
community.docker.docker_volume_info:
name: "{{ volume_name }}"
register: volume_info_result
- name: Restore volume "{{ volume_name }}"
ansible.builtin.command:
cmd: sudo autorestic -c .autorestic.all.yml restore -l {{ volume_name }}
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