ansible/roles/backblaze/tasks/backup.yml

18 lines
467 B
YAML
Raw Normal View History

---
- name: Shut down docker
shell:
cmd: "docker compose down --remove-orphans"
chdir: "{{ docker_compose_dir }}"
- name: Backing up for "{{ inventory_hostname }}"
shell:
cmd: "rclone sync {{ item.1 }} secret:{{ item.1 }}"
when: item.0.key == inventory_hostname
loop: "{{ backblaze_paths | dict2items | subelements('value') }}"
become: true
- name: Restart docker
shell:
cmd: "docker compose up -d"
chdir: "{{ docker_compose_dir }}"