Get all backups in one step and cleanup afterwards.
This commit is contained in:
12
hetzner.yaml
12
hetzner.yaml
@@ -36,9 +36,11 @@
|
|||||||
|
|
||||||
- name: Fetch backups
|
- name: Fetch backups
|
||||||
fetch:
|
fetch:
|
||||||
src: "{{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
|
src: "{{ backup_dir }}"
|
||||||
dest: "{{ local_backup }}/{{ item.key }}/"
|
dest: "{{ local_backup }}"
|
||||||
flat: yes
|
flat: yes
|
||||||
loop: "{{ lookup('dict', customers) }}"
|
|
||||||
loop_control:
|
- name: Clean backup directory
|
||||||
label: "{{ item.key }}"
|
file:
|
||||||
|
path: "{{ backup_dir }}
|
||||||
|
state: absent
|
||||||
|
|||||||
Reference in New Issue
Block a user