Ansible Python Not Found Error

#ansible #sysadmin
$ ansible --version

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.

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