kandra: Template and insert email credentials.

This commit is contained in:
Alex Vandiver
2024-03-21 21:28:10 +00:00
committed by Tim Abbott
parent 75411b264e
commit e06b1794a8
2 changed files with 21 additions and 6 deletions

View File

@@ -56,6 +56,10 @@ class kandra::profile::grafana inherits kandra::profile::base {
notify => Service[supervisor],
}
$email_host = zulipconf('grafana', 'email_host', '')
$email_from = zulipconf('grafana', 'email_from', '')
$email_user = zulipsecret('secrets', 'grafana_email_user', '')
$email_password = zulipsecret('secrets', 'grafana_email_password', '')
file { '/etc/grafana':
ensure => directory,
owner => 'root',
@@ -63,11 +67,11 @@ class kandra::profile::grafana inherits kandra::profile::base {
mode => '0755',
}
file { '/etc/grafana/grafana.ini':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/kandra/grafana/grafana.ini',
notify => Service[supervisor],
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
content => template('kandra/grafana.ini.template.erb'),
notify => Service[supervisor],
}
}

View File

@@ -29,6 +29,17 @@ domain = monitoring.teleport.zulipchat.net
root_url = https://monitoring.teleport.zulipchat.net/
#################################### SMTP ####################################
[smtp]
enabled = true
from_name = Grafana
from_address = <%= @email_from %>
host = <%= @email_host %>
user = <%= @email_user %>
password = <%= @email_password %>
startTLS_policy = MandatoryStartTLS
#################################### Auth JWT ####################################
[auth.jwt]
# Grafana should trust the JWT that is provided in a header from Teleport; see