From bd238d32a0d29978836985ed192bf06b438bfd91 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 3 Jul 2021 03:14:04 -0400 Subject: enable smtp for grafana --- modules/tozt/files/grafana.ini | 13 ------------- modules/tozt/manifests/prometheus.pp | 4 +++- modules/tozt/templates/grafana.ini | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 14 deletions(-) delete mode 100644 modules/tozt/files/grafana.ini create mode 100644 modules/tozt/templates/grafana.ini diff --git a/modules/tozt/files/grafana.ini b/modules/tozt/files/grafana.ini deleted file mode 100644 index 0c13f1c..0000000 --- a/modules/tozt/files/grafana.ini +++ /dev/null @@ -1,13 +0,0 @@ -[server] -http_port = 3001 -domain = grafana.tozt.net -root_url = https://grafana.tozt.net/ - -[database] -type = postgres -host = 127.0.0.1:5432 -name = grafana -user = grafana - -[users] -allow_sign_up = false diff --git a/modules/tozt/manifests/prometheus.pp b/modules/tozt/manifests/prometheus.pp index 8120cdc..13bc406 100644 --- a/modules/tozt/manifests/prometheus.pp +++ b/modules/tozt/manifests/prometheus.pp @@ -17,8 +17,10 @@ class tozt::prometheus { source => 'puppet:///modules/tozt/prometheus-override.conf'; } + $smtp_password = secret::value("grafana_smtp_password") + file { "/etc/grafana.ini": - source => "puppet:///modules/tozt/grafana.ini", + content => template("tozt/grafana.ini"), require => Package["grafana"]; } diff --git a/modules/tozt/templates/grafana.ini b/modules/tozt/templates/grafana.ini new file mode 100644 index 0000000..05bbe24 --- /dev/null +++ b/modules/tozt/templates/grafana.ini @@ -0,0 +1,21 @@ +[server] +http_port = 3001 +domain = grafana.tozt.net +root_url = https://grafana.tozt.net/ + +[database] +type = postgres +host = 127.0.0.1:5432 +name = grafana +user = grafana + +[users] +allow_sign_up = false + +[smtp] +enabled = true +host = mail.tozt.net:587 +user = grafana-noreply@tozt.net +password = <%= @smtp_password %> +from_address = grafana-noreply@tozt.net +startTLS_policy = MandatoryStartTLS -- cgit v1.2.3-54-g00ecf