Update exim module to work on RHEL.
Parameterizes the exim module so that it can support multiple distributions. As part of this patch I also removed the explicit install of exim4-base and exim4-config on Ubuntu. Just installing exim4-daemon-light should be fine. Change-Id: Ie09c5fa01509ebfadc92b8540f04181a2b13b667 Reviewed-on: https://review.openstack.org/23289 Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Reviewed-by: James E. Blair <corvus@inaugust.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: Monty Taylor <mordred@inaugust.com> Approved: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
e52c8739ce
commit
22fb5e6da0
@ -2,31 +2,29 @@ class exim(
|
|||||||
$mailman_domains = [],
|
$mailman_domains = [],
|
||||||
$sysadmin = []
|
$sysadmin = []
|
||||||
) {
|
) {
|
||||||
package { 'exim4-base':
|
|
||||||
|
include exim::params
|
||||||
|
|
||||||
|
package { $::exim::params::package:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
}
|
}
|
||||||
|
|
||||||
package { 'exim4-config':
|
if ($::operatingsystem == 'Redhat') {
|
||||||
ensure => present,
|
service { 'postfix':
|
||||||
|
ensure => stopped
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
package { 'exim4-daemon-light':
|
service { 'exim':
|
||||||
ensure => present,
|
|
||||||
require => [
|
|
||||||
Package[exim4-base],
|
|
||||||
Package[exim4-config]
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
service { 'exim4':
|
|
||||||
ensure => running,
|
ensure => running,
|
||||||
|
name => $::exim::params::service_name,
|
||||||
hasrestart => true,
|
hasrestart => true,
|
||||||
subscribe => File['/etc/exim4/exim4.conf'],
|
subscribe => File[$::exim::params::config_file],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/etc/exim4/exim4.conf':
|
file { $::exim::params::config_file:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
content => template('exim/exim4.conf.erb'),
|
content => template("${module_name}/exim4.conf.erb"),
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => '0444',
|
mode => '0444',
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
@ -35,7 +33,7 @@ class exim(
|
|||||||
|
|
||||||
file { '/etc/aliases':
|
file { '/etc/aliases':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
content => template('exim/aliases.erb'),
|
content => template("${module_name}/aliases.erb"),
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => '0444',
|
mode => '0444',
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
|
23
modules/exim/manifests/params.pp
Normal file
23
modules/exim/manifests/params.pp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Class: exim::params
|
||||||
|
#
|
||||||
|
# This class holds parameters that need to be
|
||||||
|
# accessed by other classes.
|
||||||
|
class exim::params {
|
||||||
|
case $::osfamily {
|
||||||
|
'Redhat': {
|
||||||
|
$package = 'exim'
|
||||||
|
$service_name = 'exim'
|
||||||
|
$config_file = '/etc/exim/exim.conf'
|
||||||
|
$conf_dir = '/etc/exim/'
|
||||||
|
}
|
||||||
|
'Debian', 'Ubuntu': {
|
||||||
|
$package = 'exim4-daemon-light'
|
||||||
|
$service_name = 'exim4'
|
||||||
|
$config_file = '/etc/exim4/exim4.conf'
|
||||||
|
$conf_dir = '/etc/exim4'
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
fail("Unsupported osfamily: ${::osfamily} The 'exim' module only supports osfamily Ubuntu or Redhat(slaves only).")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -37,7 +37,8 @@
|
|||||||
# #
|
# #
|
||||||
########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ###########
|
########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ###########
|
||||||
|
|
||||||
CONFDIR = /etc/exim4
|
CONFDIR = <%= scope.lookupvar('exim::params::conf_dir') %>
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# MAIN CONFIGURATION SETTINGS #
|
# MAIN CONFIGURATION SETTINGS #
|
||||||
|
Loading…
x
Reference in New Issue
Block a user