Defined Type: apache::mod_conf
- Defined in:
- puppet/modules/apache/manifests/mod_conf.pp
Overview
Define: apache::mod_conf
Custom resource for managing the configuration of Apache modules.
Parameters
- mod
-
Module name. Defaults to the resource title.
- loadfile
-
The .load config file that Puppet should manage. Defaults to the resource title plus a '.load' suffix.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'puppet/modules/apache/manifests/mod_conf.pp', line 14
define apache::mod_conf(
$ensure = present,
$mod = $title,
$loadfile = "${title}.load",
) {
include ::apache
if $ensure == present {
exec { "ensure_${ensure}_mod_${mod}":
command => "a2enmod ${mod}",
creates => "/etc/apache2/mods-enabled/${loadfile}",
require => Package['apache2'],
notify => Service['apache2'],
}
} elsif $ensure == absent {
exec { "ensure_${ensure}_mod_${mod}":
command => "a2dismod ${mod}",
onlyif => "/usr/bin/test -L /etc/apache2/mods-enabled/${loadfile}",
require => Package['apache2'],
notify => Service['apache2'],
}
} else {
fail("'${ensure}' is not a valid value for ensure.")
}
}
|