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

16 lines
526 B
YAML

- 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