cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
154
Views
0
Helpful
1
Replies
Highlighted
Beginner

to use the 'ssh' connection type with passwords, you must install the sshpass program

Hello All,

I am planning to use "ansible" on sandbox in Cisco Modeling lab. I have configure inventory file and ansible.cfg as well.  After running below command sandbox ask me to install "sshpass". I don't have sudo credential. what should I do? Any help? How can I solve problem?

 

(py3venv) [developer@devbox ~]$ ansible routers -i hosts -m ping
10.10.20.175 | FAILED! => {
    "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"
}
10.10.20.176 | FAILED! => {
    "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"
}

inventor host file:

[routers]
10.10.20.175
10.10.20.176

[routers:vars]
ansible_user=XXXX
ansible_password=YYYY
ansible_connections=network_cli
ansible_network_os=iosxe
ansible_port=22

[switches]
10.10.20.177
10.10.20.178

[switches:vars]
ansible_user=cisco
ansible_password=cisco
ansible_connections=network_cli
ansible_network_os=nxos
ansible_port=22

ansible.cfg

[default]
gathering = explicit
inventory = /home/developer/hosts
retry_files_enable = False
# uncomment this to disable SSH key host checking
host_key_checking = False

 

1 REPLY 1
Highlighted
Cisco Employee

It looks like you are trying to build/run the playbook from the sandbox devbox? You will encounter some issues here, there is no access to root for sandbox user on the devbox's and also no internet access from the devbox. I run all code from my local machine to the network devices.

 

Hope this helps.

Content for Community-Ad