Advertisement
Guest User

Untitled

a guest
Jan 26th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. ---
  2. - hosts: localhost
  3. remote_user: root
  4. become: yes
  5. become_method: sudo
  6.  
  7.  
  8. vars_prompt:
  9.  
  10. - name: "root_password"
  11. prompt: "Enter your new root password"
  12. private: no
  13. when: root_password is not defined
  14.  
  15. pre_tasks:
  16.  
  17. - name: fail the play if the user missed out root_password
  18. fail: msg="root password should not be empty"
  19. when: root_password is not defined
  20.  
  21. tasks:
  22.  
  23. - name: Change root password
  24. user: name=root update_password=always password={{ root_password }}
  25.  
  26. when: root_password == ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement