Add restore-volumes task
This commit is contained in:
parent
bd6409bcc0
commit
fd2eec6683
6 changed files with 35 additions and 3 deletions
playbooks/tasks/steps
16
playbooks/tasks/steps/restore-volume.yml
Normal file
16
playbooks/tasks/steps/restore-volume.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
- 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
|
Loading…
Add table
Add a link
Reference in a new issue