How to change the python path of the target machine when running ansible?

Hi,

I am testing ansible in CoreOS. I kind of set it up with pypy and it works. When I run a ping of a remote machine “ansible all -m ping” - I am getting the below error.

msg": “/bin/sh: /usr/bin/python: No such file or directory\r\nOpenSSH_6.9p1, OpenSSL 1.0.2e 3 Dec 2015\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: mux_client_request_session: master session id: 2\r\nShared connection to 17.1.1.1 closed.\r\n”

The python path is in /opt/bin/python( this is pypy link ). Is there any way I can specify python path while running ansible?

Thanks,
./Siva.

You will need to set the ansible_python_interpreter for those hosts pointing to the correct python binary. See the following FAQ for more info:

http://docs.ansible.com/ansible/faq.html#how-do-i-handle-python-pathing-not-having-a-python-2-x-in-usr-bin-python-on-a-remote-machine