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 (
$fr_basepath = $::freeradius::params::fr_basepath
$fr_group = $::freeradius::params::fr_group
$ensure_link = $ensure ? {
'absent' => 'absent',
default => 'link'
}
if ($preserve) {
# Symlink to mods-available for stock modules
file { "${fr_modulepath}/${name}":
ensure => link,
ensure => $ensure_link,
target => "../mods-available/${name}",
}
} else {
......@@ -30,7 +35,7 @@ define freeradius::module (
notify => Service[$fr_service],
}
file { "${fr_modulepath}/${name}":
ensure => link,
ensure => $ensure_link,
target => "../mods-available/${name}",
}
}
......
......@@ -26,6 +26,11 @@ define freeradius::site (
default => undef,
}
$ensure_link = $ensure ? {
'absent' => 'absent',
default => 'link'
}
file { "${fr_basepath}/sites-available/${name}":
ensure => $ensure,
mode => '0640',
......@@ -37,7 +42,7 @@ define freeradius::site (
notify => Service[$fr_service],
}
file { "${fr_basepath}/sites-enabled/${name}":
ensure => link,
ensure => $ensure_link,
target => "${fr_basepath}/sites-available/${name}",
}
}
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