Commit 087d4b95 authored by Jonathan's avatar Jonathan Committed by GitHub
Browse files

Merge pull request #86 from amateo/feature/module_link

Fix link in absent modules
parents f0ef6cc0 111812a6
...@@ -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}",
} }
} }
......
...@@ -26,6 +26,11 @@ define freeradius::site ( ...@@ -26,6 +26,11 @@ define freeradius::site (
default => undef, default => undef,
} }
$ensure_link = $ensure ? {
'absent' => 'absent',
default => 'link'
}
file { "${fr_basepath}/sites-available/${name}": file { "${fr_basepath}/sites-available/${name}":
ensure => $ensure, ensure => $ensure,
mode => '0640', mode => '0640',
...@@ -37,7 +42,7 @@ define freeradius::site ( ...@@ -37,7 +42,7 @@ define freeradius::site (
notify => Service[$fr_service], notify => Service[$fr_service],
} }
file { "${fr_basepath}/sites-enabled/${name}": file { "${fr_basepath}/sites-enabled/${name}":
ensure => link, ensure => $ensure_link,
target => "${fr_basepath}/sites-available/${name}", target => "${fr_basepath}/sites-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