Have it ACTUALLY e-mail me
This commit is contained in:
@@ -22,15 +22,13 @@
|
||||
{{ apt_upgrade.stdout }}
|
||||
{% endif %}
|
||||
|
||||
- name: Write summary to file
|
||||
ansible.builtin.copy:
|
||||
dest: /tmp/apt-upgrade-summary.txt
|
||||
content: "{{ upgrade_summary }}"
|
||||
|
||||
- name: Email the upgrade summary
|
||||
- name: Email the upgrade summary using Gmail SMTP
|
||||
ansible.builtin.mail:
|
||||
host: localhost
|
||||
port: 25
|
||||
to: you@example.com
|
||||
host: smtp.gmail.com
|
||||
port: 587
|
||||
username: "{{ lookup('env', 'SMTP_USER') }}"
|
||||
password: "{{ lookup('env', 'SMTP_PASS') }}"
|
||||
to: "{{ gmail_recipient }}"
|
||||
subject: "Debian Package Upgrade Report - {{ inventory_hostname }}"
|
||||
body: "{{ upgrade_summary }}"
|
||||
secure: starttls
|
||||
|
1
roles/infrastructure/debian_update/vars/main.yaml
Normal file
1
roles/infrastructure/debian_update/vars/main.yaml
Normal file
@@ -0,0 +1 @@
|
||||
gmail_recipient: "phlux@ewnix.net"
|
Reference in New Issue
Block a user