Get all backups in one step and cleanup afterwards.

This commit is contained in:
2021-11-22 05:47:50 +01:00
parent 431464248e
commit 23eaa2a36e

View File

@@ -36,9 +36,11 @@
- name: Fetch backups
fetch:
src: "{{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
dest: "{{ local_backup }}/{{ item.key }}/"
src: "{{ backup_dir }}"
dest: "{{ local_backup }}"
flat: yes
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Clean backup directory
file:
path: "{{ backup_dir }}
state: absent