Commit 75b4ef0c authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

add parameter to su_apache::module to suppress apache service restart

parent af768b58
......@@ -7,9 +7,13 @@
# su_apache::module { "rewrite": ensure => present }
#
# This infrastructure, and therefore this define, is only available on Debian.
#
# $restart_apache: restart the Apache service. Defaults to true; set to
# false for Docker container builds.
define su_apache::module(
Enum['present', 'absent'] $ensure = undef,
Enum['present', 'absent'] $ensure = undef,
Boolean $restart_apache = true,
) {
if ($::operatingsystem != 'debian') and ($::operatingsystem != 'ubuntu') {
fail("Unsupported su_apache::module operating system ${::operatingsystem}")
......@@ -30,11 +34,21 @@ define su_apache::module(
}
# Enable or disable the module using a2enmod or a2dismod.
exec { $cmd:
command => $cmd,
path => '/usr/sbin:/usr/bin',
require => Package['apache'],
unless => "[ $condition ]",
notify => Exec['su_apache_reload'];
if ($restart_apache) {
# DO an Apache service restart.
exec { $cmd:
command => $cmd,
path => '/usr/sbin:/usr/bin',
require => Package['apache'],
unless => "[ $condition ]",
notify => Exec['su_apache_reload'],
}
} else {
# DON'T do an Apache service restart.
exec { $cmd:
command => $cmd,
path => '/usr/sbin:/usr/bin',
require => Package['apache'],
unless => "[ $condition ]",
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment