From 45e6fe347ba8391008511474f52b2f69a86903ba Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 18 Jan 2019 11:44:22 -0200 Subject: Ensure only a single apache module is enabled for 7.x --- manifests/params.pp | 5 +++-- manifests/series7.pp | 14 ++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'manifests') diff --git a/manifests/params.pp b/manifests/params.pp index ab6616c..affd1ee 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,6 +1,7 @@ class php::params { - $version7 = '7.2' - $version5 = $::lsbdistcodename ? { + $version7 = '7.2' + $version7_previous = [ '7.0' ] + $version5 = $::lsbdistcodename ? { 'bionic' => '5.6', 'xenial' => '5.6', 'trusty' => '5.6', diff --git a/manifests/series7.pp b/manifests/series7.pp index d6af596..35b1636 100644 --- a/manifests/series7.pp +++ b/manifests/series7.pp @@ -25,19 +25,25 @@ class php::series7( include php::series7::hardened } - # The needed apache modules + # The right apache module if $manage_mod_php == '7' { $version5 = $::php::params::version5 - apache::module { "php${version}": - ensure => present, - require => Package["libapache2-mod-php${version}"], + $::php::params::version7_previous.each |$item| { + apache::module { "php${item}": + ensure => absent, + } } apache::module { "php${version5}": ensure => absent, require => Package["libapache2-mod-php${version}"], } + + apache::module { "php${version}": + ensure => present, + require => Package["libapache2-mod-php${version}"], + } } file { [ "${folder}", "${folder}/cli", "${folder}/apache2", "${folder}/cli/conf.d", "${folder}/apache2/conf.d" ]: -- cgit v1.2.3