Guest User

Untitled

a guest
Aug 10th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. ---
  2. # this is a demo of how the user commands work and how to reference salted passwords
  3. # in vars sections. You could also use vars_files if you like (see other examples)
  4.  
  5. - hosts: "193"
  6. remote_user: username
  7. gather_facts: no
  8. vars:
  9. # created with:
  10. # python -c 'import crypt; print crypt.crypt("This is my Password", "$1$SomeSalt$")'
  11. password: $1$sgi$1bXqJPs5dm6o
  12.  
  13. tasks:
  14.  
  15. # Walk through account creation, modification, and deletion
  16. - name: test basic user account creation
  17. user: name=tset comment=TsetUser group=users shell=/sbin/nologin createhome=no
  18.  
  19. # the following is just a simple example of how you don't have to include
  20. # the 'name' element for each task
  21.  
  22. - user: name=tset comment=NyetUser
  23. - user: name=tset password={{password}}
  24.  
  25. # The following will add the user to supplementary groups.
  26.  
  27. # Add the user to the groups dialout and uucp.
  28. - user: name=tset groups=dialout,uucp
  29. - group: name=wheel state=present
  30. # Add the user to the groups dialout and wheel,
  31. # This will remove tset from the group uucp.
  32. - user: name=tset groups=dialout,wheel
  33.  
  34. # Add the user to the group uucp. Because append=yes, the user
  35. # will not be removed from the groups dialout and wheel.
  36. - user: name=tset groups=uucp append=yes
  37.  
  38. # Finally, remove the user.
  39. - user: name=tset state=absent
Add Comment
Please, Sign In to add comment