From 7d77b38355d3dde9bcaee9975e6a79d2adfb3cb1 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sun, 9 Aug 2020 01:02:18 -0400 Subject: [PATCH] Misc cleanup for dispatcher --- host_vars/dispatcher.example | 1 + roles/monit-dashboard/templates/servers.json | 28 ++++++++++---------- roles/msmtp/templates/msmtprc | 8 ++++++ 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/host_vars/dispatcher.example b/host_vars/dispatcher.example index b50a4a0..e658838 100644 --- a/host_vars/dispatcher.example +++ b/host_vars/dispatcher.example @@ -1,4 +1,5 @@ --- +msmtp_containerized: true msmtp_email_address: user@domain.tld msmtp_smtp_server: "smtp.domain.tld" msmtp_smtp_from: "piframe@domain.tld" diff --git a/roles/monit-dashboard/templates/servers.json b/roles/monit-dashboard/templates/servers.json index a59fe6c..54718d5 100644 --- a/roles/monit-dashboard/templates/servers.json +++ b/roles/monit-dashboard/templates/servers.json @@ -1,14 +1,14 @@ -{ - "dispatcher": { - "url": "http://127.0.0.1:2812", - "user": "{{ monit_web_user }}", - "passwd": "{{ monit_web_pasword }}" - }{{ "," if items is defined and (items|length>0) }} -{% for frame in items %} - "{{ frame.name }}": { - "url": "http://{{ frame.wireguard_address }}:2812", - "user": "{{ frame.monit_web_user }}", - "passwd": "{{ frame.monit_web_pasword }}" - }{{ "," if not loop.last }} -{% endfor %} -} +{ + "dispatcher": { + "url": "http://127.0.0.1:2812", + "user": "{{ monit_web_user }}", + "passwd": "{{ monit_web_pasword }}" + }{{ "," if items is defined and (items|length>0) }} +{% for frame in items %} + "{{ frame.name }}": { + "url": "http://{{ frame.wireguard_address }}:2812", + "user": "{{ frame.monit_web_user }}", + "passwd": "{{ frame.monit_web_pasword }}" + }{{ "," if not loop.last }} +{% endfor %} +} diff --git a/roles/msmtp/templates/msmtprc b/roles/msmtp/templates/msmtprc index 6af883e..a209592 100644 --- a/roles/msmtp/templates/msmtprc +++ b/roles/msmtp/templates/msmtprc @@ -4,7 +4,11 @@ auth on tls on tls_trust_file /etc/ssl/certs/ca-certificates.crt +{$ if msmtp_containerized %} +logfile /opt/misc/msmtp.log +{% else %} logfile /var/log/msmtp.log +{% endif %} from {{ msmtp_smtp_from }} keepbcc on @@ -19,4 +23,8 @@ password {{ msmtp_smtp_password }} # Set a default account account default : piframe +{% if msmtp_containerized %} +aliases /opt/misc/aliases +{% else %} aliases /etc/aliases +{% endif %}