1
0
Fork 0
myserver-configuration/roles/cloud/tasks/restore_nextcloud.yml

36 lines
No EOL
784 B
YAML

---
- 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