I have some windows hosts are configured with WinRM in order to let Ansible connect them. Not like Linux hosts can do ssh-copy-id to avoid entering the credentials, I have to put my admin password in the /etc/ansible/host in order to connect these windows machines:
cat /etc/ansible/hosts
[win]
192.168.1.1
192.168.1.2
192.168.1.3
192.168.1.4
[win:vars]
ansible_user= administrator
ansible_password=mypasswd
ansible_port=5986
ansible_connection=winrm
ansible_winrm_server_cert_validation=ignore
Is there any way to avoid having the plain-text password in the hosts file?
I am very new to Ansible, any help is appreciated!