Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: localhost
- remote_user: root
- become: yes
- become_method: sudo
- vars_prompt:
- - name: "root_password"
- prompt: "Enter your new root password"
- private: no
- when: root_password is not defined
- pre_tasks:
- - name: fail the play if the user missed out root_password
- fail: msg="root password should not be empty"
- when: root_password is not defined
- tasks:
- - name: Change root password
- user: name=root update_password=always password={{ root_password }}
- when: root_password == ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement