9c4d6fc6ec
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")
17 lines
415 B
Puppet
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",
|
|
}
|
|
}
|