Have it ACTUALLY e-mail me
This commit is contained in:
@@ -22,15 +22,13 @@
|
|||||||
{{ apt_upgrade.stdout }}
|
{{ apt_upgrade.stdout }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- name: Write summary to file
|
- name: Email the upgrade summary using Gmail SMTP
|
||||||
ansible.builtin.copy:
|
|
||||||
dest: /tmp/apt-upgrade-summary.txt
|
|
||||||
content: "{{ upgrade_summary }}"
|
|
||||||
|
|
||||||
- name: Email the upgrade summary
|
|
||||||
ansible.builtin.mail:
|
ansible.builtin.mail:
|
||||||
host: localhost
|
host: smtp.gmail.com
|
||||||
port: 25
|
port: 587
|
||||||
to: you@example.com
|
username: "{{ lookup('env', 'SMTP_USER') }}"
|
||||||
|
password: "{{ lookup('env', 'SMTP_PASS') }}"
|
||||||
|
to: "{{ gmail_recipient }}"
|
||||||
subject: "Debian Package Upgrade Report - {{ inventory_hostname }}"
|
subject: "Debian Package Upgrade Report - {{ inventory_hostname }}"
|
||||||
body: "{{ upgrade_summary }}"
|
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