Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. exec { 'checkforuser':
  2. command => "grep -q $user /etc/passwd",
  3. path => "/bin:/usr/bin:/sbin:/usr/sbin:",
  4. notify => Exec['setpass'],
  5. }
  6.  
  7. $hashedpasswd='hash_here'
  8. exec { 'setpass':
  9. command => "usermod -p \"$hashedpasswd\" $user",
  10. path => "/bin:/usr/bin:/sbin:/usr/sbin",
  11. unless => "egrep -q "$user.*$hashedpasswd" /etc/shadow",
  12. refreshonly => true,
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement