Commit 348571a7 authored by Angel L. Mateo's avatar Angel L. Mateo
Browse files

Fix link in absent modules

The link in mods-enabled directory should not be present is module has
`ensure => absent`
parent f0ef6cc0
...@@ -11,10 +11,15 @@ define freeradius::module ( ...@@ -11,10 +11,15 @@ define freeradius::module (
$fr_basepath = $::freeradius::params::fr_basepath $fr_basepath = $::freeradius::params::fr_basepath
$fr_group = $::freeradius::params::fr_group $fr_group = $::freeradius::params::fr_group
$ensure_link = $ensure ? {
'absent' => 'absent',
default => 'link'
}
if ($preserve) { if ($preserve) {
# Symlink to mods-available for stock modules # Symlink to mods-available for stock modules
file { "${fr_modulepath}/${name}": file { "${fr_modulepath}/${name}":
ensure => link, ensure => $ensure_link,
target => "../mods-available/${name}", target => "../mods-available/${name}",
} }
} else { } else {
...@@ -30,7 +35,7 @@ define freeradius::module ( ...@@ -30,7 +35,7 @@ define freeradius::module (
notify => Service[$fr_service], notify => Service[$fr_service],
} }
file { "${fr_modulepath}/${name}": file { "${fr_modulepath}/${name}":
ensure => link, ensure => $ensure_link,
target => "../mods-available/${name}", target => "../mods-available/${name}",
} }
} }
......
Supports Markdown
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