Fetch web backups locally.

This commit is contained in:
2021-11-22 07:39:03 +01:00
parent f68bfe9f23
commit 0de059a755

View File

@@ -28,26 +28,36 @@
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
# - name: Backup databases - name: Fetch web backups
# shell: mysqldump -u{{ mysql_user }} -p{{ mysql_password }} {{ item.value.database }} > {{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql fetch:
# loop: "{{ lookup('dict', customers) }}" src: "{{ backup_dir }}/{{ item.key }}/web-{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
# loop_control: dest: "{{ local_backup }}/{{ item.key }}/"
# label: "{{ item.key }}" flat: yes
# when: item.value.storage is defined
# - name: Compress database backups loop: "{{ lookup('dict', customers) }}"
# shell: gzip {{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql loop_control:
# loop: "{{ lookup('dict', customers) }}" label: "{{ item.key }}"
# loop_control:
# label: "{{ item.key }}" - name: Backup databases
# shell: mysqldump -u{{ mysql_user }} -p{{ mysql_password }} {{ item.value.database }} > {{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql
# - name: Fetch database backups loop: "{{ lookup('dict', customers) }}"
# fetch: loop_control:
# src: "{{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql.gz" label: "{{ item.key }}"
# dest: "{{ local_backup }}/{{ item.key }}/"
# flat: yes - name: Compress database backups
# loop: "{{ lookup('dict', customers) }}" shell: gzip {{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql
# loop_control: loop: "{{ lookup('dict', customers) }}"
# label: "{{ item.key }}" loop_control:
label: "{{ item.key }}"
- name: Fetch database backups
fetch:
src: "{{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql.gz"
dest: "{{ local_backup }}/{{ item.key }}/"
flat: yes
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Clean backup directory - name: Clean backup directory
file: file: