43 lines
No EOL
1 KiB
YAML
43 lines
No EOL
1 KiB
YAML
---
|
|
|
|
- name: Copy archives
|
|
ansible.builtin.copy:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
loop:
|
|
- { src: '{{ restore.n8n.n8n_archive }}', dest: 'n8n_n8n.tar.gz' }
|
|
- { src: '{{ restore.n8n.db_archive }}', dest: 'n8n_db.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: './n8n_n8n.tar.gz', volume: 'n8n_n8n' }
|
|
- { path: './n8n_db.tar.gz', volume: 'n8n_db' }
|
|
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: 'n8n_n8n.tar.gz' }
|
|
- { path: 'n8n_db.tar.gz' } |