[AUTO-RESTORE] Add all
This commit is contained in:
parent
7dd38fd226
commit
a291e78db6
12 changed files with 267 additions and 12 deletions
|
@ -1,4 +1,8 @@
|
|||
---
|
||||
|
||||
- ansible.builtin.import_tasks: base.yml
|
||||
name: base
|
||||
name: base
|
||||
|
||||
- ansible.builtin.import_tasks: restore.yml
|
||||
name: restore
|
||||
when: restore.protonmail.protonmail_archive
|
40
roles/protonmail/tasks/restore.yml
Normal file
40
roles/protonmail/tasks/restore.yml
Normal file
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
|
||||
- name: Copy archives
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
loop:
|
||||
- { src: '{{ restore.protonmail.protonmail_archive }}', dest: 'protonmail_protonmail.tar.gz' }
|
||||
|
||||
- name: Stop nextcloud container
|
||||
community.docker.docker_compose:
|
||||
project_src: home_assistant
|
||||
state: absent
|
||||
become: true
|
||||
|
||||
- name: Restore backup
|
||||
community.docker.docker_container:
|
||||
name: volume_restore
|
||||
image: volume_restore:latest
|
||||
auto_remove: yes
|
||||
tty: true
|
||||
volumes:
|
||||
- "{{ item.path }}:/backup/archive.tar.gz"
|
||||
- "{{ item.volume }}:/backup/dest"
|
||||
loop:
|
||||
- { path: './protonmail_protonmail.tar.gz', volume: 'protonmail_protonmail' }
|
||||
become: true
|
||||
|
||||
- name: Start nextcloud container
|
||||
community.docker.docker_compose:
|
||||
project_src: home_assistant
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: Remove archive
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
loop:
|
||||
- { path: 'protonmail_protonmail.tar.gz' }
|
Loading…
Add table
Add a link
Reference in a new issue