Begin remove backup from docker + Debian support
This commit is contained in:
parent
e026113bb7
commit
7fe8837098
31 changed files with 82 additions and 565 deletions
|
@ -4,8 +4,4 @@
|
|||
name: base
|
||||
|
||||
- ansible.builtin.import_tasks: cron.yml
|
||||
name: cron
|
||||
|
||||
- ansible.builtin.import_tasks: restore.yml
|
||||
name: restore
|
||||
when: restore.cloud.nextcloud_archive and restore.cloud.db_archive
|
||||
name: cron
|
|
@ -1,43 +0,0 @@
|
|||
---
|
||||
|
||||
- name: Copy archives
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
loop:
|
||||
- { src: '{{ restore.cloud.nextcloud_archive }}', dest: 'cloud_nextcloud.tar.gz' }
|
||||
- { src: '{{ restore.cloud.db_archive }}', dest: 'cloud_db.tar.gz' }
|
||||
|
||||
- name: Stop nextcloud container
|
||||
community.docker.docker_compose:
|
||||
project_src: cloud
|
||||
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: './cloud_nextcloud.tar.gz', volume: 'cloud_nextcloud' }
|
||||
- { path: './cloud_db.tar.gz', volume: 'cloud_db' }
|
||||
become: true
|
||||
|
||||
- name: Start nextcloud container
|
||||
community.docker.docker_compose:
|
||||
project_src: cloud
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: Remove archive
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
loop:
|
||||
- { path: 'cloud_nextcloud.tar.gz' }
|
||||
- { path: 'cloud_db.tar.gz' }
|
Loading…
Add table
Add a link
Reference in a new issue