From 8093d467c2f81afe4d321d0547e2cfc2c4067f57 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Fri, 6 Mar 2020 19:20:52 +0100 Subject: [PATCH] Fix ssmtp for mail cofniguration --- modules/profile/manifests/mail.pp | 5 ++++- modules/profile/templates/mail/ssmtp.conf.erb | 7 ++++++- modules/role/manifests/caldance.pp | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/profile/manifests/mail.pp b/modules/profile/manifests/mail.pp index 0b4a7a5..ee295dd 100644 --- a/modules/profile/manifests/mail.pp +++ b/modules/profile/manifests/mail.pp @@ -5,7 +5,10 @@ class profile::mail ( ) { ensure_packages(["s-nail", "ssmtp"]) - $hostname = lookup("base_installation::real_hostname") + $mail_host = "mail.immae.eu" + $password_seed = lookup("base_installation::puppet_pass_seed") + $ldap_password = generate_password(24, $password_seed, "ldap") + $ldap_cn = lookup("base_installation::ldap_cn") file { "/etc/ssmtp/ssmtp.conf": ensure => "present", diff --git a/modules/profile/templates/mail/ssmtp.conf.erb b/modules/profile/templates/mail/ssmtp.conf.erb index 1766140..ea5bc99 100644 --- a/modules/profile/templates/mail/ssmtp.conf.erb +++ b/modules/profile/templates/mail/ssmtp.conf.erb @@ -11,4 +11,9 @@ mailhub=<%= @mailhub %>:<%= @mailhub_port %> # Where will the mail seem to come from? #rewriteDomain=y # The full hostname -hostname=<%= @hostname %> +hostname=<%= @mail_host %> +TLS_CA_FILE=/etc/ssl/certs/ca-certificates.crt +UseTLS=Yes +UseSTARTTLS=Yes +AuthUser=<%= @ldap_cn %> +AuthPass=<%= @ldap_password %> diff --git a/modules/role/manifests/caldance.pp b/modules/role/manifests/caldance.pp index edf5790..b397d02 100644 --- a/modules/role/manifests/caldance.pp +++ b/modules/role/manifests/caldance.pp @@ -142,7 +142,7 @@ class role::caldance ( profile::postgresql::master { "postgresql master for caldance": letsencrypt_host => $web_host, - backup_hosts => ["backup-1"], + backup_hosts => [], } postgresql::server::db { $pg_db: -- 2.41.0