Try to send Email with database backup.
This commit is contained in:
@@ -57,6 +57,24 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.key }}"
|
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
|
- name: Clean backup directory
|
||||||
file:
|
file:
|
||||||
path: "{{ backup_dir }}"
|
path: "{{ backup_dir }}"
|
||||||
|
|||||||
@@ -3,6 +3,13 @@ systems: ['buehler', 'scheidle', 'roundcube', 'svj']
|
|||||||
databases: ['buehler', 'scheidle', 'roundcube', 'svj']
|
databases: ['buehler', 'scheidle', 'roundcube', 'svj']
|
||||||
mysql_databases: ['buehler', 'scheidle', 'roundcube', 'svj']
|
mysql_databases: ['buehler', 'scheidle', 'roundcube', 'svj']
|
||||||
local_backup: /home/semaphore/backup
|
local_backup: /home/semaphore/backup
|
||||||
|
mail-password: !vault |
|
||||||
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
|
61393862616339373134316535306665363535653031656531376130353634613537376131626536
|
||||||
|
3033323466386366613136383164653730343634636139630a663766663163333038373132343331
|
||||||
|
66653564653030386237376338626337383534376665373239326563343765376534313763326439
|
||||||
|
3231663238353537630a386464613236373039313530616436393663376163663536373734663133
|
||||||
|
3838
|
||||||
buehler-password: !vault |
|
buehler-password: !vault |
|
||||||
$ANSIBLE_VAULT;1.1;AES256
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
37306230376433313631326230313739396238666239323362366164363831643664306535346464
|
37306230376433313631326230313739396238666239323362366164363831643664306535346464
|
||||||
@@ -38,6 +45,7 @@ customers:
|
|||||||
storage: /var/lib/docker/volumes/buehler-tmp_buehler-storage/_data/app/public
|
storage: /var/lib/docker/volumes/buehler-tmp_buehler-storage/_data/app/public
|
||||||
scheidle:
|
scheidle:
|
||||||
database: scheidle
|
database: scheidle
|
||||||
|
email: Christian Steinle <christiansteinle@arcor.de>
|
||||||
roundcube:
|
roundcube:
|
||||||
database: roundcube
|
database: roundcube
|
||||||
svj:
|
svj:
|
||||||
|
|||||||
Reference in New Issue
Block a user