hashansiblewinrm

How can I use my password hash for Winrm in ansible?


I'm trying to use a winrm connection with Ansible but it doesn't work with the hash of my admin's password.

My file with my variables for winrm connection :

ansible_user: administrator

ansible_password: $5$3Q6y9t99hrJhXisv$CnNhma8CjVLJr5Noz9066v3YFsx3lGVqiGyMSZ0CP73

ansible_connection: winrm

ansible_winrm_server_cert_validation: ignore

ansible_winrm_transport: ntlm

ansible_winrm_port: 5985

I would like to know what I need to do for resolve it.


Solution

  • I replace my hash by my plain-text password and after I use ansible-vault for encrypt my file with the following command

    ansible-vault encrypt group_vars/win.yaml
    

    Vault ask me a new password for use this file and after I just need to add --ask-vault-pass at the end of my playbook command