diff --git a/manifests/extra-access.pp b/manifests/extra-access.pp index 05c7d26..a8062e3 100644 --- a/manifests/extra-access.pp +++ b/manifests/extra-access.pp @@ -1,9 +1,12 @@ -define sudo::extra-access($ensure = 'present', $access = 'ALL=(ALL) ALL') { - file { "/etc/sudoers.d/01-user_access-$title": +define sudo::extra-access($ensure = 'present', $user = undef, $access = 'ALL=(ALL) ALL') { + if $user == undef { + $user = $name + } + file { "/etc/sudoers.d/01-user_access-${name}": ensure => 'present', owner => root, group => admin, mode => 640, - content => "# THIS FILE IS MANAGED BY PUPPET !\n\n$name $access\n", + content => "# THIS FILE IS MANAGED BY PUPPET !\n\n${user} ${access}\n", } }