access.pp 472 B

1234567891011121314151617181920
  1. define sudo::access (
  2. $ensure = 'present',
  3. $user = undef,
  4. $access = 'ALL=(ALL) ALL'
  5. ) {
  6. include sudo
  7. if $user == undef {
  8. $real_user = $name
  9. } else {
  10. $real_user = $user
  11. }
  12. # there shouldn't be a dot in those filenames!
  13. file { "${sudo::dir}/01-user_access-${title}":
  14. ensure => 'present',
  15. owner => 'root',
  16. group => 0,
  17. mode => '0440',
  18. content => "# THIS FILE IS MANAGED BY PUPPET !\n${real_user} ${access}\n",
  19. }
  20. }