diff --git a/strato-production.yaml b/strato-production.yaml index 6336cbf..7567126 100644 --- a/strato-production.yaml +++ b/strato-production.yaml @@ -57,6 +57,24 @@ loop_control: label: "{{ item.key }}" + - name: Sending Email + community.general.mail: + host: smtp.vodafonemail.de + port: 465 + username: christiansteinle@arcor.de + password: "{{ mail-password }}" + to: {{ item.value.email }} + subject: Datenbank Backup + body: System {{ ansible_hostname }} has been successfully provisioned. + attach: + - {{ backup_dir }}/{{ item }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql.gz + delegate_to: localhost + when: item.value.email is defined + loop: "{{ lookup('dict', customers) }}" + loop_control: + label: "{{ item.key }}" + + - name: Clean backup directory file: path: "{{ backup_dir }}" diff --git a/vars/strato-production.yaml b/vars/strato-production.yaml index e4ec03b..62bb801 100644 --- a/vars/strato-production.yaml +++ b/vars/strato-production.yaml @@ -3,6 +3,13 @@ systems: ['buehler', 'scheidle', 'roundcube', 'svj'] databases: ['buehler', 'scheidle', 'roundcube', 'svj'] mysql_databases: ['buehler', 'scheidle', 'roundcube', 'svj'] local_backup: /home/semaphore/backup +mail-password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 61393862616339373134316535306665363535653031656531376130353634613537376131626536 + 3033323466386366613136383164653730343634636139630a663766663163333038373132343331 + 66653564653030386237376338626337383534376665373239326563343765376534313763326439 + 3231663238353537630a386464613236373039313530616436393663376163663536373734663133 + 3838 buehler-password: !vault | $ANSIBLE_VAULT;1.1;AES256 37306230376433313631326230313739396238666239323362366164363831643664306535346464 @@ -38,6 +45,7 @@ customers: storage: /var/lib/docker/volumes/buehler-tmp_buehler-storage/_data/app/public scheidle: database: scheidle + email: Christian Steinle roundcube: database: roundcube svj: