unable tp ping esx hosts

24 views
Skip to first unread message

Tony Wong

unread,
Oct 23, 2020, 11:55:18 AM10/23/20
to Ansible Project

I am trying simple ping command to esx host but keep getting this


ansible esx -m ping

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

Tony Wong

unread,
Oct 23, 2020, 11:57:35 AM10/23/20
to Ansible Project
ansible esx -u root -m ping -vvvv
ansible 2.10.2
  config file = /Users/twong/virtualenv/ansible/vmware/ansible.cfg
  configured module search path = ['/Users/twong/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.8.6 (default, Oct  8 2020, 14:06:32) [Clang 12.0.0 (clang-1200.0.32.2)]
Using /Users/twong/virtualenv/ansible/vmware/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /Users/twong/virtualenv/ansible/vmware/hosts as it did not pass its verify_file() method
script declined parsing /Users/twong/virtualenv/ansible/vmware/hosts as it did not pass its verify_file() method
auto declined parsing /Users/twong/virtualenv/ansible/vmware/hosts as it did not pass its verify_file() method
Parsed /Users/twong/virtualenv/ansible/vmware/hosts inventory source with ini plugin
Loading callback plugin minimal of type stdout, v2.0 from /usr/local/lib/python3.8/site-packages/ansible/plugins/callback/minimal.py
META: ran handlers
<myesxhost> ESTABLISH SSH CONNECTION FOR USER: root
myesxhost | FAILED! => {

    "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"
}

Sobhan Anavarapu

unread,
Oct 23, 2020, 12:09:00 PM10/23/20
to Ansible Project
Please install SSHpass on your controller node.
yum install sshpass -y

Tony Wong

unread,
Oct 23, 2020, 1:45:12 PM10/23/20
to Ansible Project
but I am on osX in virtualenv

Tony Wong

unread,
Oct 23, 2020, 2:18:12 PM10/23/20
to Ansible Project
ok got it installed with this

brew install esolitos/ipa/sshpass


but when i ping my host, I get this


(ansible) xxx@xxxx vmware % ansible esx -m ping -u root --ask-pass
SSH password:
[WARNING]: No python interpreters found for host myesx (tried ['/usr/bin/python', 'python3.7', 'python3.6', 'python3.5',
'python2.7', 'python2.6', '/usr/libexec/platform-python', '/usr/bin/python3', 'python'])
myesx | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
Reply all
Reply to author
Forward
0 new messages