Commit 6df937e3 authored by Antoine Beaupré's avatar Antoine Beaupré

use Smart Parameter Defaults pattern to fix freebsd path

parent 1f777fc5
class sudo::freebsd inherits sudo::base {
class { 'sudo': dir => '/usr/local/etc/sudoers.d' }
package{'sudo':
ensure => installed,
}
......
......@@ -3,9 +3,9 @@
# GPLv3
class sudo(
$deploy_sudoers = false,
$dir = '/etc/sudoers.d'
) {
$deploy_sudoers = $sudo::deploy_sudoers,
$dir = $sudo::params::dir
) inherits sudo::params {
case $::kernel {
linux: { include sudo::linux }
freebsd: { include sudo::freebsd }
......
class sudo::params {
$dir = $::kernel ? {
/freebsd/ => '/usr/local/etc/sudoers.d',
default => '/etc/sudoers.d',
}
$path = $::kernel ? {
/freebsd/ => '/usr/local/etc/sudoers',
default => '/etc/sudoers',
}
$deploy_sudoers = false
}
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