Use variable for local backup dir and compress backups.

This commit is contained in:
2021-11-22 05:38:00 +01:00
parent 644fe5c527
commit 164c55e10e
2 changed files with 9 additions and 1 deletions

View File

@@ -28,10 +28,16 @@
loop_control:
label: "{{ item.key }}"
- name: Compress database backups
shell: gzip {{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Fetch backups
fetch:
src: "{{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql"
dest: "/backup/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql"
dest: "{{ local_backup }}/{{ item.key }}/"
flat: yes
loop: "{{ lookup('dict', customers) }}"
loop_control:

View File

@@ -19,3 +19,5 @@ customers:
roundcube:
database: roundcube
local_backup: /home/semaphore/backup