[BACKUP_RESTORE] Add docker + begin implement for nextcloud service

This commit is contained in:
Florian RICHER 2023-05-21 17:51:54 +02:00
parent 1419a89d03
commit efa7c2e42d
8 changed files with 81 additions and 2 deletions

View file

@ -4,4 +4,8 @@
name: base
- ansible.builtin.import_tasks: cron.yml
name: cron
name: cron
- ansible.builtin.import_tasks: restore_nextcloud.yml
name: restore_nextcloud
when: restore.cloud.nextcloud_archive

View file

@ -0,0 +1,36 @@
---
- name: Copy archive
ansible.builtin.copy:
src: "{{ restore.cloud.nextcloud_archive }}"
dest: archive.tar.gz
- name: Stop nextcloud container
community.docker.docker_compose:
project_src: cloud
state: absent
services: nextcloud
become: true
- name: Restore backup
community.docker.docker_container:
name: volume_restore
image: volume_restore:latest
state: present
recreate: true
volumes:
- ./archive.tar.gz:/backup/archive.tar.gz
- cloud_nextcloud:/backup/dest
become: true
- name: Start nextcloud container
community.docker.docker_compose:
project_src: cloud
state: present
services: nextcloud
become: true
- name: Remove archive
ansible.builtin.file:
path: archive.tar.gz
state: absent