From 9dc3881659814987390d37b7cbcc0f4ee47d0843 Mon Sep 17 00:00:00 2001 From: chris Date: Sat, 24 Feb 2024 11:02:05 +0100 Subject: [PATCH] Temporary test to speed up backup and use correct backup directory for sending emails. --- strato-production.yaml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/strato-production.yaml b/strato-production.yaml index 201f833..e294ca5 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 @@ -57,7 +57,7 @@ loop_control: label: "{{ item.key }}" - - name: Sending Email + - name: Send Email community.general.mail: host: smtp.vodafonemail.de port: 465 @@ -67,7 +67,7 @@ subject: Datenbank Backup body: System {{ ansible_hostname }} has been successfully provisioned. attach: - - "{{ backup_dir }}/{{ item }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql.gz" + - "{{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql.gz" delegate_to: localhost when: item.value.email is defined loop: "{{ lookup('dict', customers) }}"