Created
February 14, 2017 09:56
-
-
Save NetguruGist/ed98457707b5f30010f5eed1c1585908 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: "First things first - install latest patches" | |
apt: update_cache=yes upgrade=full | |
- name: "First things first - create random root password" | |
apt: name={{ item }} state=present | |
with_items: | |
- pwgen | |
- whois | |
- shell: /usr/bin/pwgen -s 40 1 | |
register: root_password | |
- shell: "/usr/bin/mkpasswd {{ root_password.stdout }} --method=SHA-512" | |
register: root_crypted_password | |
- user: name=root password={{ root_crypted_password.stdout }} | |
- debug: msg="Password for user 'root' has been set to {{ root_password.stdout }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment