From 82caf31189f11a9bca4836260e8ee8ba954690f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 17 Mar 2018 11:00:48 +0100 Subject: Add mail profile --- modules/profile/manifests/mail.pp | 14 ++++++++++++++ modules/profile/templates/mail/ssmtp.conf.erb | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 modules/profile/manifests/mail.pp create mode 100644 modules/profile/templates/mail/ssmtp.conf.erb (limited to 'modules/profile') diff --git a/modules/profile/manifests/mail.pp b/modules/profile/manifests/mail.pp new file mode 100644 index 0000000..cc47b77 --- /dev/null +++ b/modules/profile/manifests/mail.pp @@ -0,0 +1,14 @@ +class profile::mail ( + String $mailhub, + Optional[Integer] $mailhub_port = 25, +) { + ensure_packages(["s-nail", "ssmtp"]) + + $hostname = lookup("base_installation::real_hostname") + + file { "/etc/ssmtp/ssmtp.conf": + ensure => "present", + content => template("profile/mail/ssmtp.conf.erb"), + } +} + diff --git a/modules/profile/templates/mail/ssmtp.conf.erb b/modules/profile/templates/mail/ssmtp.conf.erb new file mode 100644 index 0000000..e7a0410 --- /dev/null +++ b/modules/profile/templates/mail/ssmtp.conf.erb @@ -0,0 +1,14 @@ +# +# /etc/ssmtp.conf -- a config file for sSMTP sendmail. +# +# The person who gets all mail for userids < 1000 +# Make this empty to disable rewriting. +root=postmaster +# The place where the mail goes. The actual machine name is required +# no MX records are consulted. Commonly mailhosts are named mail.domain.com +# The example will fit if you are in domain.com and you mailhub is so named. +mailhub=<%= @mailhub %>:<%= @mailhub_port %> +# Where will the mail seem to come from? +#rewriteDomain=y +# The full hostname +hostname=<%= @hostname %> -- cgit v1.2.3