Created
February 14, 2017 10:00
-
-
Save NetguruGist/193b4a3300f8171e3f39cd83335ea327 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: "Add your user" | |
user: name=deploy shell=/bin/bash group=sudo | |
- authorized_key: user=deploy key="SSH_KEY" exclusive=yes | |
- shell: /usr/bin/pwgen -s 40 1 | |
register: deploy_password | |
- shell: "/usr/bin/mkpasswd{% raw %} {{ deploy_password.stdout }}{% endraw %} --method=SHA-512" | |
register: deploy_crypted_password | |
- user: name=deploy password={% raw %}{{ deploy_crypted_password.stdout }}{% endraw %} | |
- debug: msg="Password for user 'deploy' has been set to{% raw %} {{ deploy_password.stdout }}{% endraw %}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment