aboutsummaryrefslogtreecommitdiff
path: root/modules/profile
diff options
context:
space:
mode:
Diffstat (limited to 'modules/profile')
-rw-r--r--modules/profile/manifests/known_hosts.pp11
-rw-r--r--modules/profile/manifests/mail.pp14
-rw-r--r--modules/profile/templates/mail/ssmtp.conf.erb14
3 files changed, 39 insertions, 0 deletions
diff --git a/modules/profile/manifests/known_hosts.pp b/modules/profile/manifests/known_hosts.pp
new file mode 100644
index 0000000..ed9ec8e
--- /dev/null
+++ b/modules/profile/manifests/known_hosts.pp
@@ -0,0 +1,11 @@
1class profile::known_hosts (
2 Optional[Array] $hosts = []
3) {
4 $hosts.each |$host| {
5 sshkey { $host["name"]:
6 ensure => "present",
7 key => $host["key"],
8 type => $host["type"],
9 }
10 }
11}
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 %>