From 76f8b31a4756332c4f2668b68f351f078370a322 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 6 Apr 2016 21:24:53 -0300 Subject: Parametrize --- manifests/init.pp | 17 +++++++++++++++-- templates/update-exim4.conf.conf.erb | 26 +++++++++++++------------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 087d586..7a011ae 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -16,7 +16,21 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -class exim { +class exim( + $eximconfig_configtype = 'internet', + $other_hostnames = $::fqdn, + $local_interfaces = '127.0.0.1', + $readhost = '', + $relay_domains = '', + $minimaldns = 'false', + $relay_nets = '', + $smarthost = '', + $cfilemode = '644', + $use_split_config = 'false', + $hide_mailname = '', + $mailname_in_oh = 'true', + $localdelivery = 'mail_spool', +) { package { "exim4": ensure => present, } @@ -68,5 +82,4 @@ class exim { refreshonly => true, notify => Service["exim4"], } - } diff --git a/templates/update-exim4.conf.conf.erb b/templates/update-exim4.conf.conf.erb index e25ec1f..57a10f3 100644 --- a/templates/update-exim4.conf.conf.erb +++ b/templates/update-exim4.conf.conf.erb @@ -11,16 +11,16 @@ # Most settings found in here do have corresponding questions in the # Debconf configuration, but not all of them. # -dc_eximconfig_configtype='internet' -dc_other_hostnames='<%= scope.lookupvar('::fqdn') %>' -dc_local_interfaces='127.0.0.1' -dc_readhost='' -dc_relay_domains='' -dc_minimaldns='false' -dc_relay_nets='' -dc_smarthost='' -CFILEMODE='644' -dc_use_split_config='false' -dc_hide_mailname='' -dc_mailname_in_oh='true' -dc_localdelivery='mail_spool' +dc_eximconfig_configtype='<%= @eximconfig_configtype %>' +dc_other_hostnames='<%= @other_hostnames %>' +dc_local_interfaces='<%= @local_interfaces %>' +dc_readhost='<%= @readhost %>' +dc_relay_domains='<%= @relay_domains %>' +dc_minimaldns='<%= @minimaldns %>' +dc_relay_nets='<%= @relay_nets %>' +dc_smarthost='<%= @smarthost %>' +CFILEMODE='<%= @cfilemode %>' +dc_use_split_config='<%= @use_split_config %>' +dc_hide_mailname='<%= @hide_mailname %>' +dc_mailname_in_oh='<%= @mailname_in_oh %>' +dc_localdelivery='<%= @localdelivery %>' -- cgit v1.2.3