module-sudo/manifests/access.pp
Gabriel Filion 9c4d6fc6ec lint manifests
respect style from best practices. this makes the code a lot easier to
read.

also change groups from "root" to "0" to make them more portable (e.g.
in freebsd, the admin group is "wheel" but has gid "0")
2013-04-25 18:58:04 -04:00

17 lines
415 B
Puppet

define sudo::access (
$ensure = 'present',
$user = undef,
$access = 'ALL=(ALL) ALL'
) {
if $user == undef {
$user = $name
}
# there shouldn't be a dot in those filenames!
file { "/etc/sudoers.d/01-user_access-${title}":
ensure => 'present',
owner => 'root',
group => 0,
mode => '0440',
content => "# THIS FILE IS MANAGED BY PUPPET !\n${user} ${access}\n",
}
}