Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
suitpuppet
su_apache
Commits
75b4ef0c
Commit
75b4ef0c
authored
Nov 12, 2020
by
Adam Lewenberg
Browse files
add parameter to su_apache::module to suppress apache service restart
parent
af768b58
Changes
1
Hide whitespace changes
Inline
Side-by-side
manifests/module.pp
View file @
75b4ef0c
...
...
@@ -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
]"
,
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment