ff
Some checks failed
ci/woodpecker/push/gitleaks Pipeline was successful
ci/woodpecker/pr/gitleaks Pipeline was successful
ci/woodpecker/push/ansible-lint Pipeline failed
ci/woodpecker/pr/ansible-lint Pipeline failed

This commit is contained in:
Michael Grote 2024-08-12 13:16:19 +02:00
parent 42ede01c42
commit 945d883cb6

View file

@ -55,31 +55,33 @@
# TODO mail config? wie senden?
# COPY munin_mail.conf /etc/munin/munin-conf.d/munin_mail.conf
# configure mail notification
if [[ -n "$MAILCONTACT" && -n "$MAILSERVER" && -n "$MAILPORT" && -n "$MAILUSER" && -n "$MAILPASSWORD" && -n "$MAILDOMAIN" ]] ; then
MAILCONTACT=${MAILCONTACT:="contact@domain.test"}
sed -i "s/mailcontact/$MAILCONTACT/g" /etc/ssmtp/ssmtp.conf
sed -i "s/mailcontact/$MAILCONTACT/g" /etc/munin/munin-conf.d/munin_mail.conf
MAILSERVER=${MAILSERVER:="mail.domain.test"}
sed -i "s/mailserver/$MAILSERVER/g" /etc/ssmtp/ssmtp.conf
sed -i "s/mailserver/$MAILSERVER/g" /etc/ssmtp/revaliases
MAILPORT=${MAILPORT:="25"}
sed -i "s/mailport/$MAILPORT/g" /etc/ssmtp/ssmtp.conf
sed -i "s/mailport/$MAILPORT/g" /etc/ssmtp/revaliases
MAILUSER=${MAILUSER:="alert@domain.test"}
sed -i "s/mailuser/$MAILUSER/g" /etc/ssmtp/ssmtp.conf
MAILFROM=${MAILFROM:="munin@domain.test"}
sed -i "s/mailfrom/$MAILFROM/g" /etc/ssmtp/revaliases
MAILPASSWORD=${MAILPASSWORD:="XXXXXXXXX"}
sed -i "s/mailpassword/$MAILPASSWORD/g" /etc/ssmtp/ssmtp.conf
MAILDOMAIN=${MAILDOMAIN:="domain.test"}
sed -i "s/maildomain/$MAILDOMAIN/g" /etc/ssmtp/ssmtp.conf
sed -i "s/mailhost/$MAILDOMAIN/g" /etc/ssmtp/ssmtp.conf
MAILNAME=${MAILNAME:="Munin"}
sed -i "s/munin application user/$MAILNAME/g" /etc/passwd
else
rm /etc/munin/munin-conf.d/munin_mail.conf /etc/ssmtp/ssmtp.conf
fi
# # configure mail notification
# if [[ -n "$MAILCONTACT" && -n "$MAILSERVER" && -n "$MAILPORT" && -n "$MAILUSER" && -n "$MAILPASSWORD" && -n "$MAILDOMAIN" ]] ; then
# MAILCONTACT=${MAILCONTACT:="contact@domain.test"}
# sed -i "s/mailcontact/$MAILCONTACT/g" /etc/ssmtp/ssmtp.conf
# sed -i "s/mailcontact/$MAILCONTACT/g" /etc/munin/munin-conf.d/munin_mail.conf
# MAILSERVER=${MAILSERVER:="mail.domain.test"}
# sed -i "s/mailserver/$MAILSERVER/g" /etc/ssmtp/ssmtp.conf
# sed -i "s/mailserver/$MAILSERVER/g" /etc/ssmtp/revaliases
# MAILPORT=${MAILPORT:="25"}
# sed -i "s/mailport/$MAILPORT/g" /etc/ssmtp/ssmtp.conf
# sed -i "s/mailport/$MAILPORT/g" /etc/ssmtp/revaliases
# MAILUSER=${MAILUSER:="alert@domain.test"}
# sed -i "s/mailuser/$MAILUSER/g" /etc/ssmtp/ssmtp.conf
# MAILFROM=${MAILFROM:="munin@domain.test"}
# sed -i "s/mailfrom/$MAILFROM/g" /etc/ssmtp/revaliases
# MAILPASSWORD=${MAILPASSWORD:="XXXXXXXXX"}
# sed -i "s/mailpassword/$MAILPASSWORD/g" /etc/ssmtp/ssmtp.conf
# MAILDOMAIN=${MAILDOMAIN:="domain.test"}
# sed -i "s/maildomain/$MAILDOMAIN/g" /etc/ssmtp/ssmtp.conf
# sed -i "s/mailhost/$MAILDOMAIN/g" /etc/ssmtp/ssmtp.conf
# MAILNAME=${MAILNAME:="Munin"}
# sed -i "s/munin application user/$MAILNAME/g" /etc/passwd
# else
# rm /etc/munin/munin-conf.d/munin_mail.conf /etc/ssmtp/ssmtp.conf
# fi
# cronjoib? timer? TODO