aboutsummaryrefslogtreecommitdiff
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
parent97103ded8390d10ea3468615c654e89d07c0a921 (diff)
downloadPuppet-82caf31189f11a9bca4836260e8ee8ba954690f2.tar.gz
Puppet-82caf31189f11a9bca4836260e8ee8ba954690f2.tar.zst
Puppet-82caf31189f11a9bca4836260e8ee8ba954690f2.zip
Add mail profile
-rw-r--r--environments/global/common.yaml1
-rw-r--r--modules/profile/manifests/mail.pp14
-rw-r--r--modules/profile/templates/mail/ssmtp.conf.erb14
3 files changed, 29 insertions, 0 deletions
diff --git a/environments/global/common.yaml b/environments/global/common.yaml
index 5911194..e7c70d4 100644
--- a/environments/global/common.yaml
+++ b/environments/global/common.yaml
@@ -30,5 +30,6 @@ base_installation::system_timezone: "Europe/Paris"
30base_installation::system_users: [] # Fetched via ldap 30base_installation::system_users: [] # Fetched via ldap
31profile::xmr_stak::mining_pool: "" # Fetched via ldap 31profile::xmr_stak::mining_pool: "" # Fetched via ldap
32profile::xmr_stak::wallet: "" # Fetched via ldap 32profile::xmr_stak::wallet: "" # Fetched via ldap
33profile::mail::mailhub: "" # Fetched via ldap
33letsencrypt::email: ~ # Fetched via ldap 34letsencrypt::email: ~ # Fetched via ldap
34letsencrypt::try_for_real_hostname: true 35letsencrypt::try_for_real_hostname: true
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 %>