diff --git a/strato-production.yaml b/strato-production.yaml index 57c5c2f..6336cbf 100644 --- a/strato-production.yaml +++ b/strato-production.yaml @@ -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 }}" diff --git a/vars/strato-production.yaml b/vars/strato-production.yaml index 89233e9..e4ec03b 100644 --- a/vars/strato-production.yaml +++ b/vars/strato-production.yaml @@ -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 +