From d20d424cac28a44c2b7603d67fa68991056c7f95 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 30 Jul 2013 15:06:24 -0700 Subject: [PATCH] Add queue runner interval option to exim Set it to default to 30m (the Debian default). Set it to 5m on lists.o.o. Change-Id: Iab817ae93a9e9655abf41713f70048870652a635 --- modules/exim/manifests/init.pp | 25 +++++++++++++++++++- modules/exim/manifests/params.pp | 2 ++ modules/exim/templates/exim.sysconfig.erb | 2 ++ modules/exim/templates/exim4.default.erb | 22 +++++++++++++++++ modules/openstack_project/manifests/lists.pp | 1 + 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 modules/exim/templates/exim.sysconfig.erb create mode 100644 modules/exim/templates/exim4.default.erb diff --git a/modules/exim/manifests/init.pp b/modules/exim/manifests/init.pp index d7fb271cb0..d927411790 100644 --- a/modules/exim/manifests/init.pp +++ b/modules/exim/manifests/init.pp @@ -1,5 +1,6 @@ class exim( $mailman_domains = [], + $queue_interval = '30m', $sysadmin = [] ) { @@ -13,13 +14,35 @@ class exim( service { 'postfix': ensure => stopped } + file { $::exim::params::sysdefault_file: + ensure => present, + content => template("${module_name}/exim.sysconfig.erb"), + group => 'root', + mode => '0444', + owner => 'root', + replace => true, + require => Package[$::exim::params::package], + } + } + + if ($::osfamily == 'Debian') { + file { $::exim::params::sysdefault_file: + ensure => present, + content => template("${module_name}/exim4.default.erb"), + group => 'root', + mode => '0444', + owner => 'root', + replace => true, + require => Package[$::exim::params::package], + } } service { 'exim': ensure => running, name => $::exim::params::service_name, hasrestart => true, - subscribe => File[$::exim::params::config_file], + subscribe => [File[$::exim::params::config_file], + File[$::exim::params::sysdefault_file]], require => Package[$::exim::params::package], } diff --git a/modules/exim/manifests/params.pp b/modules/exim/manifests/params.pp index 516209d8ba..311ab39d12 100644 --- a/modules/exim/manifests/params.pp +++ b/modules/exim/manifests/params.pp @@ -9,12 +9,14 @@ class exim::params { $service_name = 'exim' $config_file = '/etc/exim/exim.conf' $conf_dir = '/etc/exim/' + $sysdefault_file = '/etc/sysconfig/exim' } 'Debian': { $package = 'exim4-daemon-light' $service_name = 'exim4' $config_file = '/etc/exim4/exim4.conf' $conf_dir = '/etc/exim4' + $sysdefault_file = '/etc/default/exim4' } default: { fail("Unsupported osfamily: ${::osfamily} The 'exim' module only supports osfamily Debian or RedHat (slaves only).") diff --git a/modules/exim/templates/exim.sysconfig.erb b/modules/exim/templates/exim.sysconfig.erb new file mode 100644 index 0000000000..1f0df561b3 --- /dev/null +++ b/modules/exim/templates/exim.sysconfig.erb @@ -0,0 +1,2 @@ +DAEMON=yes +QUEUE=<%= queue_interval %> diff --git a/modules/exim/templates/exim4.default.erb b/modules/exim/templates/exim4.default.erb new file mode 100644 index 0000000000..c167bdf5a2 --- /dev/null +++ b/modules/exim/templates/exim4.default.erb @@ -0,0 +1,22 @@ +# /etc/default/exim4 +EX4DEF_VERSION='' + +# 'combined' - one daemon running queue and listening on SMTP port +# 'no' - no daemon running the queue +# 'separate' - two separate daemons +# 'ppp' - only run queue with /etc/ppp/ip-up.d/exim4. +# 'nodaemon' - no daemon is started at all. +# 'queueonly' - only a queue running daemon is started, no SMTP listener. +# setting this to 'no' will also disable queueruns from /etc/ppp/ip-up.d/exim4 +QUEUERUNNER='combined' +# how often should we run the queue +QUEUEINTERVAL='<%= queue_interval %>' +# options common to quez-runner and listening daemon +COMMONOPTIONS='' +# more options for the daemon/process running the queue (applies to the one +# started in /etc/ppp/ip-up.d/exim4, too. +QUEUERUNNEROPTIONS='' +# special flags given to exim directly after the -q. See exim(8) +QFLAGS='' +# options for daemon listening on port 25 +SMTPLISTENEROPTIONS='' diff --git a/modules/openstack_project/manifests/lists.pp b/modules/openstack_project/manifests/lists.pp index 068915aabb..23dfc45fbf 100644 --- a/modules/openstack_project/manifests/lists.pp +++ b/modules/openstack_project/manifests/lists.pp @@ -15,6 +15,7 @@ class openstack_project::lists( class { 'exim': sysadmin => $listadmins, + queue_interval => '5m', mailman_domains => [$listdomain], }