From a9007433478ee77ea9ebe4828d762727a4a2c44f Mon Sep 17 00:00:00 2001 From: Romain Pelisse Date: Mon, 15 Apr 2024 10:34:07 +0200 Subject: [PATCH] cron: enhance subject of daily run's email --- roles/cron/templates/ansible-daily-run.sh.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/cron/templates/ansible-daily-run.sh.j2 b/roles/cron/templates/ansible-daily-run.sh.j2 index ff18de4..05b2efa 100644 --- a/roles/cron/templates/ansible-daily-run.sh.j2 +++ b/roles/cron/templates/ansible-daily-run.sh.j2 @@ -10,7 +10,7 @@ rm "${ZEUS_STATUS_FILE}" touch "${ZEUS_STATUS_FILE}" readonly LOGFILE="$(mktemp)" -echo "Ansible Daily run on Olympus" > "${LOGFILE}" +echo "$(hostname) " > "${LOGFILE}" zeus_status() { if [ -s "${ZEUS_STATUS_FILE}" ]; then @@ -23,7 +23,7 @@ zeus_status() { mail_report_and_clean() { local subject=$(head -1 "${LOGFILE}" | sed -e "s;$; (Status: $(zeus_status));") cat "${LOGFILE}" | \ - mailx -r "{{ mailer.to }}" -s "{{ jobs.name }}:${subject}" \ + mailx -r "{{ mailer.to }}" -s "{{ jobs.name }}: ${subject}" \ -S smtp="{{ mailer.smtp.host }}:{{mailer.smtp.port }}" "{{ mailer.replyTo }}" rm -f "${LOGFILE}" }