Advertisement
Guest User

Untitled

a guest
Jul 4th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. python -c "from passlib.hash import sha512_crypt; print sha512_crypt.encrypt('somepassword')"
  2.  
  3. ---
  4. vault_appadmin_password: $6$rounds=656000$jx.GAgbpfoUS2Iry$apQoWdHFrDujWeEA5I9iHDR5hiVzfDsa2.FtwD8YKNRhzmc8Gc0BTrscyncqW5B2FSsx1ebTpmvV3JrC3vcEs1
  5.  
  6. ---
  7. # User that will run sudo commands
  8. - name: Add Admin User
  9. user:
  10. name: "{{ admin_username }}"
  11. groups: sudo
  12. password: "{{ admin_password }}"
  13. shell: /bin/bash
  14.  
  15. # User that will be using our application
  16. - name: Add Application User
  17. user:
  18. name: "{{ appuser_username }}"
  19. password: "{{ appuser_password }}"
  20. groups: sudo
  21. shell: /bin/bash
  22. generate_ssh_key: yes
  23. ssh_key_bits: 4096
  24.  
  25. - name: Enable Remote (person) Access to Admin
  26. authorized_key:
  27. user: "{{ admin_username }}"
  28. key: "{{ local_authorized_key }}"
  29. path: "/home/{{ admin_username }}/.ssh/authorized_keys"
  30.  
  31. - name: Enable Remote (Person) Access to Appuser
  32. authorized_key:
  33. user: "{{ appuser_username }}"
  34. key: "{{ local_authorized_key }}"
  35. path: "/home/{{ appuser_username }}/.ssh/authorized_keys"
  36.  
  37. ansible-playbook --private-key=~/.ssh/id_rsa -i hosts playbook.yml --limit=staging
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement