Skip to content

Commit

Permalink
(MODULES-6677) make sure event mpm is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
zivis committed Nov 9, 2018
1 parent 8b231bb commit eceba27
Showing 1 changed file with 31 additions and 20 deletions.
51 changes: 31 additions & 20 deletions manifests/mpm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -71,35 +71,46 @@
before => Class['apache::service'],
}
}
} else {
package { "apache2-mpm-${mpm}":
ensure => present,
before => [
Class['apache::service'],
File[$::apache::mod_enable_dir],
],
}
}

if $mpm == 'itk' and $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease == '14.04' {
# workaround https://bugs.launchpad.net/ubuntu/+source/mpm-itk/+bug/1286882
exec {
'/usr/sbin/a2dismod mpm_event':
onlyif => '/usr/bin/test -e /etc/apache2/mods-enabled/mpm_event.load',
require => Package['httpd'],
before => Package['apache2-mpm-itk'],
if $mpm == 'itk' {
package { 'libapache2-mpm-itk':
ensure => present,
before => [
Class['apache::service'],
File[$::apache::mod_enable_dir],
],
}
}

if $mpm == 'itk' and ( ( $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease == '16.04' ) or ( $::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '9.0.0') >= 0 ) ) {
$packagename = 'libapache2-mpm-itk'
} else {
$packagename = "apache2-mpm-${mpm}"
if ( ( $::operatingsystem == 'Ubuntu' ) or ( ($::operatingsystem == 'Debian') and ( versioncmp($::operatingsystemrelease, '8.0.0') >= 0 ) ) ) {
ensure_resource('exec', '/usr/sbin/a2dismod mpm_event', {
onlyif => "/usr/bin/test -e ${apache::mod_enable_dir}/mpm_event.load",
require => Package['httpd'],
before => Class['apache::service'],
})
}
}

if versioncmp($apache_version, '2.4') < 0 or $mpm == 'itk' {
package { $packagename:
ensure => present,
}
if $::apache::mod_enable_dir {
Package[$packagename] {
before => File[$::apache::mod_enable_dir],
}
if $mpm == 'prefork' {
if ( ( $::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease,'18.04') >= 0 ) or ( $::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '9.0.0') >= 0 ) ) {
ensure_resource('exec', '/usr/sbin/a2dismod mpm_event', {
onlyif => "/usr/bin/test -e ${apache::mod_enable_dir}/mpm_event.load",
require => Package['httpd'],
before => Class['apache::service'],
})
}
}

}

'freebsd': {
class { '::apache::package':
mpm_module => $mpm,
Expand Down

0 comments on commit eceba27

Please sign in to comment.