Ansible Python Not Found Error

#ansible #sysadmin
$ ansible --version
ansible 2.0.1.0

Using Ubuntu 15.10 on a remote server, I was getting a ‘python: not found’ error on when running an Ansible task. It turns out this is because Ansible requires python 2 to be installed on the remote machine, not just your local instance. [1]

To fix this, you can add a pre_task that installs a different version of python.

tasks:
  - name: 'install python2'
  raw: apt-get -y install python-simplejson

[1]http://stackoverflow.com/questions/32429259/ansible-fails-with-bin-sh-1-usr-bin-python-not-found