summaryrefslogtreecommitdiff
path: root/manifests/debian
diff options
context:
space:
mode:
authorJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2010-05-12 17:01:28 -0400
committerGabriel Filion <lelutin@gmail.com>2011-12-09 09:53:22 -0500
commitc6bc93cdbb6d6bf27931f61c88a50eb11d0ff9bb (patch)
tree684d8b92468caadd203f39b62784df597f17f413 /manifests/debian
parent3cbef5768267cdef9b0beaf100083d30fd945f88 (diff)
make apache::debian::module work with a version-specific ensure
Currently, the code expects $ensure to be either 'present' or 'absent' when enabling/disabling the concerned module. It does not take into account that other values could be set. Those other values could be 'purged' and any specific version tag. 'purged' must behave similarly to 'absent' (e.g. disable the module) and all other cases ('present' and a version tag) must enable the module.
Diffstat (limited to 'manifests/debian')
-rw-r--r--manifests/debian/module.pp20
1 files changed, 10 insertions, 10 deletions
diff --git a/manifests/debian/module.pp b/manifests/debian/module.pp
index 19ac7b6..55500ad 100644
--- a/manifests/debian/module.pp
+++ b/manifests/debian/module.pp
@@ -2,7 +2,7 @@ define apache::debian::module(
$ensure = present,
$package_name = 'absent'
){
- $modules_dir = "$apache::debian::config_dir/mods"
+ $modules_dir = "${apache::debian::config_dir}/mods"
if ($package_name != 'absent') {
package { "${package_name}":
@@ -13,7 +13,15 @@ define apache::debian::module(
}
case $ensure {
- 'present' : {
+ 'absent','purged': {
+ exec { "/usr/sbin/a2dismod ${name}":
+ onlyif => "/bin/sh -c '[ -L ${modules_dir}-enabled/${name}.load ] \\
+ && [ ${modules_dir}-enabled/${name}.load -ef ${modules_dir}-available/${name}.load ]'",
+ notify => Service['apache'],
+ require => Package['apache'],
+ }
+ }
+ default : {
exec { "/usr/sbin/a2enmod ${name}":
unless => "/bin/sh -c '[ -L ${modules_dir}-enabled/${name}.load ] \\
&& [ ${modules_dir}-enabled/${name}.load -ef ${modules_dir}-available/${name}.load ]'",
@@ -24,14 +32,6 @@ define apache::debian::module(
},
}
}
- 'absent': {
- exec { "/usr/sbin/a2dismod ${name}":
- onlyif => "/bin/sh -c '[ -L ${modules_dir}-enabled/${name}.load ] \\
- && [ ${modules_dir}-enabled/${name}.load -ef ${modules_dir}-available/${name}.load ]'",
- notify => Service['apache'],
- require => Package['apache'],
- }
- }
}
}