Best practice to change root pass

hi peole thanks so much for your kindly help. Im mew here and i hope to help so much. Im just learning ansible and im new to this but im going to learn fast. My question is, do you what is the best method for changing root password in linux redhat env. Thanks a lot dear people.

Sorry my bad english, regards.

Probably the user module.

http://docs.ansible.com/ansible/latest/user_module.html

But the problem with the user module is, that it is quite hard the debug.

You can try this:

  • name: Update Root password
    user:
    name: root
    uid: 0
    gid: 0
    shell: /bin/bash
    password: “{{root_password_hash}}”
    home: /root
    update_password: always
    state: present

Set the variable root_passoword_hash in a vault file.
http://docs.ansible.com/ansible/latest/playbooks_vault.html

Hello my dear friend. I really appreciate what you did. I’m so glad and I hope could help in this group as soon as learn… Thanks you so much for your kindly help.

Please let me know if I can help with anything.

Regards