mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Implemented systemd-email.service for native-pull-remote-backups
This commit is contained in:
15
roles/native-systemd-email/templates/msmtprc.conf.j2
Normal file
15
roles/native-systemd-email/templates/msmtprc.conf.j2
Normal file
@@ -0,0 +1,15 @@
|
||||
# Set default values for all following accounts.
|
||||
defaults
|
||||
auth on
|
||||
tls on
|
||||
tls_trust_file /etc/ssl/certs/ca-certificates.crt
|
||||
logfile ~/.msmtp.log
|
||||
|
||||
account system_email
|
||||
host {{system_email_host}}
|
||||
port 587
|
||||
from {{system_email}}
|
||||
user {{system_email_username}}
|
||||
password {{system_email_password}}
|
||||
|
||||
account default : system_email
|
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=status email for %i to user
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/bin/systemd-email.sh %i
|
||||
User=nobody
|
||||
Group=systemd-journal
|
11
roles/native-systemd-email/templates/systemd-email.sh.j2
Normal file
11
roles/native-systemd-email/templates/systemd-email.sh.j2
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
/usr/bin/sendmail -t <<ERRMAIL
|
||||
To: {{administrator_email}}
|
||||
From: systemd <{{system_email}}>
|
||||
Subject: $1
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
|
||||
$(systemctl status --full "$1")
|
||||
ERRMAIL
|
Reference in New Issue
Block a user