Have it ACTUALLY e-mail me

This commit is contained in:
2025-05-10 23:02:55 -05:00
parent 01ed60a25b
commit 49c73b2efc
2 changed files with 8 additions and 9 deletions

View File

@@ -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

View File

@@ -0,0 +1 @@
gmail_recipient: "phlux@ewnix.net"