From 6966572f6977bddac19eff22e2649fec2425b4e5 Mon Sep 17 00:00:00 2001 From: Christian Steinle Date: Thu, 24 Apr 2025 16:23:34 +0200 Subject: [PATCH] Add playbook to fetch remote backups. --- fetch-backup.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 fetch-backup.yaml diff --git a/fetch-backup.yaml b/fetch-backup.yaml new file mode 100644 index 0000000..af3c50d --- /dev/null +++ b/fetch-backup.yaml @@ -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 }}" + \ No newline at end of file