aboutsummaryrefslogtreecommitdiff
path: root/modules/profile
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-03-17 11:00:48 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-03-19 16:19:17 +0100
commit82caf31189f11a9bca4836260e8ee8ba954690f2 (patch)
tree97b15bbbb0ca9415fb17acc11f3592bc40e942f6 /modules/profile
parent97103ded8390d10ea3468615c654e89d07c0a921 (diff)
downloadPuppet-82caf31189f11a9bca4836260e8ee8ba954690f2.tar.gz
Puppet-82caf31189f11a9bca4836260e8ee8ba954690f2.tar.zst
Puppet-82caf31189f11a9bca4836260e8ee8ba954690f2.zip
Add mail profile
Diffstat (limited to 'modules/profile')
-rw-r--r--modules/profile/manifests/mail.pp14
-rw-r--r--modules/profile/templates/mail/ssmtp.conf.erb14
2 files changed, 28 insertions, 0 deletions
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 @@
1class profile::mail (
2 String $mailhub,
3 Optional[Integer] $mailhub_port = 25,
4) {
5 ensure_packages(["s-nail", "ssmtp"])
6
7 $hostname = lookup("base_installation::real_hostname")
8
9 file { "/etc/ssmtp/ssmtp.conf":
10 ensure => "present",
11 content => template("profile/mail/ssmtp.conf.erb"),
12 }
13}
14
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 @@
1#
2# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
3#
4# The person who gets all mail for userids < 1000
5# Make this empty to disable rewriting.
6root=postmaster
7# The place where the mail goes. The actual machine name is required
8# no MX records are consulted. Commonly mailhosts are named mail.domain.com
9# The example will fit if you are in domain.com and you mailhub is so named.
10mailhub=<%= @mailhub %>:<%= @mailhub_port %>
11# Where will the mail seem to come from?
12#rewriteDomain=y
13# The full hostname
14hostname=<%= @hostname %>