From 139fddd195d2f17225a40b2ebd422c84ff3fe4a4 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Fri, 22 Dec 2017 17:40:23 +0000 Subject: [PATCH] Make /etc/aliases extensible In an effort to support customizing E-mail aliases per server, allow a hash of aliases to be passed into the /etc/aliases template. While we're here, remove the custom gerrit2 and jenkins aliases since those can now be set individually on servers where they actually matter rather than unnecessarily setting them everywhere. Change-Id: I2911f157812c127a514196ae58b7609378d7d4e4 --- manifests/init.pp | 1 + templates/aliases.erb | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 17e3d9e..e7ce692 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -32,6 +32,7 @@ class exim( $transports = [], $smtp_accept_max = undef, $smtp_accept_max_per_host = undef, + $extra_aliases = {}, ) { include ::exim::params diff --git a/templates/aliases.erb b/templates/aliases.erb index bf224dd..8b7e4a4 100644 --- a/templates/aliases.erb +++ b/templates/aliases.erb @@ -1,4 +1,8 @@ # /etc/aliases +<% @extra_aliases.each do |key,value| -%> +<%= key %>: <%= value %> +<% end -%> + mailer-daemon: postmaster postmaster: root nobody: root @@ -12,8 +16,6 @@ abuse: root noc: root security: root -gerrit2: root -jenkins: root <% if @sysadmins.length > 0 -%> root: <%= @sysadmins.join(",") %> <% end -%>