From 083073ac7221ed78a4115da67edbd6c078e58db7 Mon Sep 17 00:00:00 2001 From: chris Date: Sat, 24 Feb 2024 11:56:55 +0100 Subject: [PATCH] Use complete backup stack and send email to production recipient. --- strato-production.yaml | 32 ++++++++++++++++---------------- vars/strato-production.yaml | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/strato-production.yaml b/strato-production.yaml index 4f3b28d..ee89f5f 100644 --- a/strato-production.yaml +++ b/strato-production.yaml @@ -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 diff --git a/vars/strato-production.yaml b/vars/strato-production.yaml index fb93d38..864bbd8 100644 --- a/vars/strato-production.yaml +++ b/vars/strato-production.yaml @@ -45,7 +45,7 @@ customers: storage: /var/lib/docker/volumes/buehler-tmp_buehler-storage/_data/app/public scheidle: database: scheidle - email: Christian Steinle + email: Klaus Scheidle roundcube: database: roundcube svj: