1
0
Fork 0
myserver-configuration/roles/traefik/tasks/restore.yml

43 lines
No EOL
1.1 KiB
YAML

---
- name: Copy archives
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
loop:
- { src: '{{ restore.traefik.prometheus_archive }}', dest: 'traefik_prometheus.tar.gz' }
- { src: '{{ restore.traefik.grafana_archive }}', dest: 'traefik_grafana.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: './traefik_prometheus.tar.gz', volume: 'traefik_prometheus' }
- { path: './traefik_grafana.tar.gz', volume: 'traefik_grafana' }
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: 'traefik_prometheus.tar.gz' }
- { path: 'traefik_grafana.tar.gz' }