Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible : Must install the sshpass program

Ansible command:

ansible all -m module-name -o  -e "ansible_user=username ansible_password=password"  

Giving following error :

host-ip | FAILED! => {"msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"}

like image 322
ross Avatar asked Sep 21 '25 03:09

ross


1 Answers

  • Install sshpass: apt-get update apt-get- install sshpass

  • if not This error can solved by exporting environment variable. export ANSIBLE_HOST_KEY_CHECKING=False

  • If not try to create a file ansible.cfg in your current folder with the following contents: [defaults] host_key_checking = false

like image 84
ross Avatar answered Sep 22 '25 19:09

ross