Use complete backup stack and send email to production recipient.

This commit is contained in:
2024-02-24 11:56:55 +01:00
parent d41d71e7ab
commit 083073ac72
2 changed files with 17 additions and 17 deletions

View File

@@ -23,22 +23,22 @@
loop_control:
label: "{{ item.key }}"
# - name: Backup web directories
# shell: tar cvfz {{ backup_dir }}/{{ item.key }}/web-{{ ansible_date_time.iso8601_basic_short }}.tar.gz {{ item.value.storage }}
# when: item.value.storage is defined
# loop: "{{ lookup('dict', customers) }}"
# loop_control:
# label: "{{ item.key }}"
#
# - name: Fetch web backups
# fetch:
# src: "{{ backup_dir }}/{{ item.key }}/web-{{ ansible_date_time.iso8601_basic_short }}.tar.gz"
# dest: "{{ local_backup }}/{{ item.key }}/"
# flat: yes
# when: item.value.storage is defined
# loop: "{{ lookup('dict', customers) }}"
# loop_control:
# label: "{{ item.key }}"
- name: Backup web directories
shell: tar cvfz {{ backup_dir }}/{{ item.key }}/web-{{ ansible_date_time.iso8601_basic_short }}.tar.gz {{ item.value.storage }}
when: item.value.storage is defined
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Fetch web backups
fetch:
src: "{{ backup_dir }}/{{ item.key }}/web-{{ ansible_date_time.iso8601_basic_short }}.tar.gz"
dest: "{{ local_backup }}/{{ item.key }}/"
flat: yes
when: item.value.storage is defined
loop: "{{ lookup('dict', customers) }}"
loop_control:
label: "{{ item.key }}"
- name: Backup mysql databases
shell: docker exec {{ item }}-db mysqldump -u{{ item }} -p{{ lookup('vars', item ~ '-password') }} {{ item }} > {{ backup_dir }}/{{ item }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql