Advertisement
Guest User

Untitled

a guest
Feb 14th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. - name: "Add your user"
  2.  
  3. user: name=deploy shell=/bin/bash group=sudo
  4.  
  5. - authorized_key: user=deploy key="SSH_KEY" exclusive=yes
  6.  
  7. - shell: /usr/bin/pwgen -s 40 1
  8.  
  9. register: deploy_password
  10.  
  11. - shell: "/usr/bin/mkpasswd{% raw %} {{ deploy_password.stdout }}{% endraw %} --method=SHA-512"
  12.  
  13. register: deploy_crypted_password
  14.  
  15. - user: name=deploy password={% raw %}{{ deploy_crypted_password.stdout }}{% endraw %}
  16.  
  17. - debug: msg="Password for user 'deploy' has been set to{% raw %} {{ deploy_password.stdout }}{% endraw %}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement