Add playbook to fetch remote backups.
This commit is contained in:
25
fetch-backup.yaml
Normal file
25
fetch-backup.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
|
||||
- name: Fetch remote backups
|
||||
hosts: all
|
||||
gather_facts: true
|
||||
|
||||
tasks:
|
||||
- name: Fetch volume backups
|
||||
fetch:
|
||||
src: "{{ backup_location }}{{ item[0].name }}/{{ item[1] }}-volume-{{ ansible_date_time.iso8601_basic_short }}.tar.gz"
|
||||
dest: "{{ local_backup }}{{ item[0].name }}/"
|
||||
flat: yes
|
||||
loop: "{{ containers | subelements('volumes', skip_missing=True) }}"
|
||||
loop_control:
|
||||
label: "{{ item[1] }}"
|
||||
|
||||
- name: Fetch database backups
|
||||
fetch:
|
||||
src: "{{ backup_location }}{{ item[0].name }}/{{ item[1].container }}-{{ ansible_date_time.iso8601_basic_short }}.sql"
|
||||
dest: "{{ local_backup }}{{ item[0].name }}/"
|
||||
flat: yes
|
||||
loop: "{{ containers | subelements('database', skip_missing=True) }}"
|
||||
loop_control:
|
||||
label: "{{ item[1].name }}"
|
||||
|
||||
Reference in New Issue
Block a user