summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/init.pp19
-rw-r--r--templates/aliases.erb (renamed from files/aliases)2
2 files changed, 15 insertions, 6 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index a79a524..c877805 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -30,6 +30,8 @@ class exim(
$hide_mailname = '',
$mailname_in_oh = 'true',
$localdelivery = 'mail_spool',
+ $root_mail_recipient = 'root',
+ $aliases = 'template',
) {
package { "exim4":
ensure => present,
@@ -41,11 +43,18 @@ class exim(
}
file { "/etc/aliases":
- source => [ "puppet:///modules/site_mail/${::domain}/aliases",
- "puppet:///modules/site_mail/${::hostname}/aliases",
- "puppet:///modules/site_mail/aliases",
- "puppet:///modules/mail/aliases",
- "puppet:///modules/exim/aliases" ],
+ source => $aliases ? {
+ 'source' => [ "puppet:///modules/site_mail/${::domain}/aliases",
+ "puppet:///modules/site_mail/${::hostname}/aliases",
+ "puppet:///modules/site_mail/aliases",
+ "puppet:///modules/mail/aliases",
+ "puppet:///modules/exim/aliases" ],
+ default => undef,
+ },
+ content => $aliases ? {
+ 'template' => template('exim/aliases.erb'),
+ default => undef,
+ },
owner => "root",
group => "root",
mode => 0644,
diff --git a/files/aliases b/templates/aliases.erb
index 08a0723..9fdf782 100644
--- a/files/aliases
+++ b/templates/aliases.erb
@@ -11,4 +11,4 @@ ftp: root
abuse: root
noc: root
security: root
-reprepro: root
+<% if @root_mail_recipient != 'root' -%>root: <%= @root_mail_recipient %><% end %>