diff --git a/roles/mgrote_munin_server/tasks/main.yml b/roles/mgrote_munin_server/tasks/main.yml index ac6bb564..87a3f860 100644 --- a/roles/mgrote_munin_server/tasks/main.yml +++ b/roles/mgrote_munin_server/tasks/main.yml @@ -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