summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/debian/module.pp20
1 files changed, 16 insertions, 4 deletions
diff --git a/manifests/debian/module.pp b/manifests/debian/module.pp
index 31eb508..19ac7b6 100644
--- a/manifests/debian/module.pp
+++ b/manifests/debian/module.pp
@@ -1,19 +1,31 @@
define apache::debian::module(
- $ensure = present
+ $ensure = present,
+ $package_name = 'absent'
){
$modules_dir = "$apache::debian::config_dir/mods"
+ if ($package_name != 'absent') {
+ package { "${package_name}":
+ ensure => $ensure,
+ notify => Service['apache'],
+ require => Package['apache'],
+ }
+ }
+
case $ensure {
'present' : {
- exec { "/usr/sbin/a2enmod $name":
+ 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 ]'",
notify => Service['apache'],
- require => Package['apache'],
+ require => $package_name ? {
+ 'absent' => Package['apache'],
+ default => Package[['apache',$package_name]],
+ },
}
}
'absent': {
- exec { "/usr/sbin/a2dismod $name":
+ 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'],