Extend strato backup to collect storage backups.

This commit is contained in:
2024-02-24 10:09:02 +01:00
parent bf1f483aa2
commit b089f31b6d
2 changed files with 20 additions and 0 deletions

View File

@@ -23,6 +23,23 @@
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
loop: "{{ mysql_databases }}"

View File

@@ -35,9 +35,12 @@ svj-password: !vault |
customers:
buehler:
database: buehler
storage: /var/lib/docker/volumes/buehler-tmp_buehler-storage/_data/app/public
scheidle:
database: scheidle
roundcube:
database: roundcube
svj:
database: svj
storage: /var/lib/docker/volumes/svj-media/_data