Wednesday, 4 January 2017

Ansible Error: /bin/sh: 1: /usr/bin/python: not found

Unable to SSH on Ubuntu Server Greater than 14.04

You may encountered following error while doing ssh on Ubuntu server through Ansible


XX.XXX.XX.XXX | FAILED! => {
    "changed": false, 
    "failed": true, 
    "module_stderr": "Connection to XX.XXX.XX.XXX closed.\r\n", 
    "module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n", 
    "msg": "MODULE FAILURE"
}
It happens since newer version of Ubuntu comes with Python3 by default. And Ansible internally looks for python2. Hence to SSH, you need to install python2 on server manually. For this run following command on server:

sudo apt-get -y install python-simplejson
Now, you can ssh via Ansible on Ubuntu server greater than 14.04.

0 comments:

Post a Comment

 

Copyright @ 2013 Appychip.

Designed by Appychip & YouTube Channel