module-sudo/manifests/access.pp
2015-08-20 11:07:11 -04:00

21 righe
485 B
Puppet

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