summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-10-14 17:50:04 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-10-14 17:50:04 -0300
commit0426f5e47f64c2c502815836a6a734f7c2e299de (patch)
tree331fe4420dbd7195cf22efe09b853a91be044ef9
parent201807bf576afd286d7c0d7d31796b00ae9706b3 (diff)
downloadpuppet-exim-0426f5e47f64c2c502815836a6a734f7c2e299de.tar.gz
puppet-exim-0426f5e47f64c2c502815836a6a734f7c2e299de.tar.bz2
Aliases: support for templates and custom root recipient
-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 %>