make the sudoers directory parametrized

This commit is contained in:
Antoine Beaupré 2013-06-22 12:38:41 -04:00
parent b6cd3ed6ce
commit f02dcffe22
6 changed files with 11 additions and 4 deletions

View file

@ -36,4 +36,4 @@ root ALL=(ALL) ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
#includedir /etc/sudoers.d
#includedir /usr/local/etc/sudoers.d

View file

@ -7,7 +7,7 @@ define sudo::access (
$user = $name
}
# there shouldn't be a dot in those filenames!
file { "/etc/sudoers.d/01-user_access-${title}":
file { "${sudo::sudoersdir}/01-user_access-${title}":
ensure => 'present',
owner => 'root',
group => 0,

View file

@ -7,5 +7,9 @@ class sudo::base {
"puppet:///modules/sudo/sudoers/sudoers" ],
owner => root, group => 0, mode => 0440;
}
file { ${sudo::sudoersdir}:
ensure => directory,
owner => root, group => 0, mode => 0550;
}
}
}

View file

@ -1,4 +1,6 @@
class sudo::freebsd inherits sudo::base {
class { 'sudo': sudoersdir => '/usr/local/etc/sudoers.d' }
package{'sudo':
ensure => installed,
}

View file

@ -3,7 +3,8 @@
# GPLv3
class sudo(
$deploy_sudoers = false
$deploy_sudoers = false,
$sudoersdir = '/etc/sudoers.d',
) {
case $::kernel {
linux: { include sudo::linux }

View file

@ -3,7 +3,7 @@ define sudo::user_alias (
$ensure = 'present'
) {
# this is 00-prefixed so that it's defined before the other definitions
file { "/etc/sudoers.d/00-user_alias-${title}":
file { "${sudo::sudoersdir}/etc/sudoers.d/00-user_alias-${title}":
ensure => $ensure,
owner => 'root',
group => 0,