how to run ansible on Ubuntu 16.04?

If you visit my blog frequently, I always use Vagrant with Ansible for setting up my local development or provisioning a staging server.

This command

ansible-playbook -i inventories/staging playbook.yml

always working well for me but today I met this error

FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "\r\n/bin/sh: 1: /usr/bin/python: not found\r\n", "msg": "MODULE FAILURE", "parsed": false}

After spending time for checking, Python 2.7 was not yet installed on the Ubuntu 16.04 as it should be so Ansible could not run well.

It is quite easy to fix by just install python 2.7 with this command:

sudo apt-get install python-minimal
#checking ansible version
python --version
Python 2.7.12

After that, I could provision LAMP Stack successfully to deploy my new magento website on AWS Ubuntu 16.04 EC2 instance.

ansibleonubuntu1604_runagain

I hope this post can help you quickly resolve your issue.

Save

Save