You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
722 B
YAML
27 lines
722 B
YAML
---
|
|
- hosts: servers
|
|
tasks:
|
|
- name: Find backup
|
|
find:
|
|
paths: /mnt/hdds/backups/
|
|
patterns: linkding
|
|
use_regex: true
|
|
recurse: true
|
|
register: files_matched
|
|
- name: Stop the container
|
|
docker_container:
|
|
name: linkding
|
|
state: stopped
|
|
- name: Restore Volume
|
|
environment:
|
|
ARCHIVE_NAME: "{{ files_matched.files[0].path }}"
|
|
VOLUME_TO_CREATE: linkding_data
|
|
ansible.builtin.command: docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/chatton/docker-volume-backup:master restore-volume --volume ${VOLUME_TO_CREATE} --archive ${ARCHIVE_NAME}
|
|
- name: Start the container
|
|
docker_container:
|
|
name: linkding
|
|
state: started
|
|
|
|
|
|
|