ansible ping failure

22 views
Skip to first unread message

0x4e6f43 676573

unread,
Feb 15, 2018, 5:04:01 PM2/15/18
to Ansible Project
*** New to ansible & linux ***

I've installed ansible on a ZorinOS vm and am attempting (with no luck) to ping a host in the /etc/ansible/hosts file.  I can ssh to the host and can also scp files from ansible to the host.  Got to be a simple fix...

ZorinOS version: 12
Ansible version: 2.4.3.0
Python version: 2.7.12

zorinOs:~$  ansible all -m ping
192.168.146.129 | FAILED! => {
    "changed": false, 
    "module_stderr": "Shared connection to 192.168.146.129 closed.\r\n", 
    "module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n", 
    "msg": "MODULE FAILURE", 
    "rc": 0
}


I also have the verbose output that I can share, if necessary.





Matt Martz

unread,
Feb 15, 2018, 5:27:10 PM2/15/18
to ansible...@googlegroups.com
The ping module is a full round trip test for ansible (not ICMP).  It attempts to ssh to the host, invoke python on the remote host, use the python JSON module to return data.

Looking at the error, your remote host is missing python at `/usr/bin/python`.  You may either need to install python on the remote host, which can be accomplished with the `raw` module (potentially).  Or if python is already installed, but in a different location, you will need to set the `ansible_python_interpreter` variable for that host, pointing to the correct python binary.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e6cad62a-fff6-4632-8f60-c423e3eae086%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net

0x4e6f43 676573

unread,
Feb 15, 2018, 5:50:13 PM2/15/18
to Ansible Project
Matt,
You're correct.  I was looking at the error message and had the same realization that i probably needed to install python on the remote host.  After checking the python version on the remote host i found that python2 wasnt installed.  installed, tested and passed.


On Thursday, February 15, 2018 at 4:27:10 PM UTC-6, Matt Martz wrote:
The ping module is a full round trip test for ansible (not ICMP).  It attempts to ssh to the host, invoke python on the remote host, use the python JSON module to return data.

Looking at the error, your remote host is missing python at `/usr/bin/python`.  You may either need to install python on the remote host, which can be accomplished with the `raw` module (potentially).  Or if python is already installed, but in a different location, you will need to set the `ansible_python_interpreter` variable for that host, pointing to the correct python binary.
On Thu, Feb 15, 2018 at 4:04 PM, 0x4e6f43 676573 <wpatt...@gmail.com> wrote:
*** New to ansible & linux ***

I've installed ansible on a ZorinOS vm and am attempting (with no luck) to ping a host in the /etc/ansible/hosts file.  I can ssh to the host and can also scp files from ansible to the host.  Got to be a simple fix...

ZorinOS version: 12
Ansible version: 2.4.3.0
Python version: 2.7.12

zorinOs:~$  ansible all -m ping
192.168.146.129 | FAILED! => {
    "changed": false, 
    "module_stderr": "Shared connection to 192.168.146.129 closed.\r\n", 
    "module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n", 
    "msg": "MODULE FAILURE", 
    "rc": 0
}


I also have the verbose output that I can share, if necessary.





--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages