aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-01-18 11:44:22 -0200
committerSilvio Rhatto <rhatto@riseup.net>2019-01-18 11:44:22 -0200
commit45e6fe347ba8391008511474f52b2f69a86903ba (patch)
tree5cbd048d24c82fd434a56531e2bdcff12789e069 /manifests
parent741ce4aa8ff8a1e411f7fa3e5fa8052fee9c1e73 (diff)
downloadpuppet-php-45e6fe347ba8391008511474f52b2f69a86903ba.tar.gz
puppet-php-45e6fe347ba8391008511474f52b2f69a86903ba.tar.bz2
Ensure only a single apache module is enabled for 7.x
Diffstat (limited to 'manifests')
-rw-r--r--manifests/params.pp5
-rw-r--r--manifests/series7.pp14
2 files changed, 13 insertions, 6 deletions
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" ]: