Commit f02dcffe authored by Antoine Beaupré's avatar Antoine Beaupré

make the sudoers directory parametrized

parent b6cd3ed6
......@@ -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
......@@ -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,
......
......@@ -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;
}
}
}
class sudo::freebsd inherits sudo::base {
class { 'sudo': sudoersdir => '/usr/local/etc/sudoers.d' }
package{'sudo':
ensure => installed,
}
......
......@@ -3,7 +3,8 @@
# GPLv3
class sudo(
$deploy_sudoers = false
$deploy_sudoers = false,
$sudoersdir = '/etc/sudoers.d',
) {
case $::kernel {
linux: { include sudo::linux }
......
......@@ -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,
......
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