diff --git a/manifests/freebsd.pp b/manifests/freebsd.pp index dc09a75..c115874 100644 --- a/manifests/freebsd.pp +++ b/manifests/freebsd.pp @@ -1,6 +1,4 @@ class sudo::freebsd inherits sudo::base { - - class { 'sudo': dir => '/usr/local/etc/sudoers.d' } package{'sudo': ensure => installed, } diff --git a/manifests/init.pp b/manifests/init.pp index 0cf5b1d..4e6a50f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 } diff --git a/manifests/params.pp b/manifests/params.pp new file mode 100644 index 0000000..afe6be0 --- /dev/null +++ b/manifests/params.pp @@ -0,0 +1,11 @@ +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 +}