From 5efcdcda4a71f69dbe80ca8326dfdc2d13ab8829 Mon Sep 17 00:00:00 2001 From: valeriominetti Date: Wed, 26 Nov 2014 14:58:52 +0100 Subject: [PATCH] MODULES-825: apache 2.4 mod_itk needs mod_prefork in apache 2.4 mod_prefork can be installed along with mod_itk On ubuntu 14.04 mod_itk library name is "mpm_itk.so" instead of "mod_mpm_itk.so". Added an if statement that creates a symlink in case of a debian distro. this preserve old manifest behaviour in library loading while fixing ubuntu bug. --- manifests/mod/itk.pp | 6 ++++-- manifests/mod/prefork.pp | 6 ++++-- manifests/mpm.pp | 7 +++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/manifests/mod/itk.pp b/manifests/mod/itk.pp index 1083e5ed2..dc020b810 100644 --- a/manifests/mod/itk.pp +++ b/manifests/mod/itk.pp @@ -13,8 +13,10 @@ if defined(Class['apache::mod::peruser']) { fail('May not include both apache::mod::itk and apache::mod::peruser on the same node') } - if defined(Class['apache::mod::prefork']) { - fail('May not include both apache::mod::itk and apache::mod::prefork on the same node') + if versioncmp($apache_version, '2.4') < 0 { + if defined(Class['apache::mod::prefork']) { + fail('May not include both apache::mod::itk and apache::mod::prefork on the same node') + } } if defined(Class['apache::mod::worker']) { fail('May not include both apache::mod::itk and apache::mod::worker on the same node') diff --git a/manifests/mod/prefork.pp b/manifests/mod/prefork.pp index b3adeae8c..6a66ef1c9 100644 --- a/manifests/mod/prefork.pp +++ b/manifests/mod/prefork.pp @@ -10,8 +10,10 @@ if defined(Class['apache::mod::event']) { fail('May not include both apache::mod::prefork and apache::mod::event on the same node') } - if defined(Class['apache::mod::itk']) { - fail('May not include both apache::mod::prefork and apache::mod::itk on the same node') + if versioncmp($apache_version, '2.4') < 0 { + if defined(Class['apache::mod::itk']) { + fail('May not include both apache::mod::prefork and apache::mod::itk on the same node') + } } if defined(Class['apache::mod::peruser']) { fail('May not include both apache::mod::prefork and apache::mod::peruser on the same node') diff --git a/manifests/mpm.pp b/manifests/mpm.pp index 6437016ba..ca976a41b 100644 --- a/manifests/mpm.pp +++ b/manifests/mpm.pp @@ -45,6 +45,13 @@ before => File[$::apache::mod_enable_dir], notify => Service['httpd'], } + + if $mpm == 'itk' { + file { "${lib_path}/mod_mpm_itk.so": + ensure => link, + target => "${lib_path}/mpm_itk.so" + } + } } if versioncmp($apache_version, '2.4') < 0 {