Install and get started with Ansible in Ubuntu 14.04

This post will show you how to install Ansible and use Ansible to create a instance EC2 in AWS.

There are several way to install Ansible. In this post, I choose the way that uses PIP to install Ansible.

ac723946-269b-11e4-ae5f-22000a9780da-medium

If people are not laughing at your goals, your goals are too small

Install PIP, Python Boto:

We need python-boto to make Ansible is able to work AWS

Install Ansible:

 

Now, we need to add AWS Access Key to make Boto can access to your AWS account:

In the next step, you need create a folder for your project:

Create hosts file with the content below:

And create a provision file name ec2_launch.yml with the content:

Please custom the source code above for your case with the guide:

Finally, just run a command to create EC2 instance:

If you what to run a series of commands in all the instances you created. You should create a run_test.yml file with content:

And run the test by Ansible Playbook: