Installing Ansible Using AWS

In this tutorial, we will learn about Installing Ansible Using AWS EC2 Instance in AWS Cloud and we will also cover the following steps through which we can install Ansible on any system.

What is Ansible?

The Ansible is an open-source community project which is sponsored by the Red hat. It is a strong automation tool that is used to make tasks simple and easier. It is a powerful automation tool for cross-platform computer support.

Installing Ansible on AWS

Here we will learn about the steps to install the Ansible on AWS. Before installing an ansible we need to have 3 machines where one machine is the ansible controller or the other two machines are the remote server on which we can perform the task using the ansible controller machine.

Ansible Servers
Ansible Servers

After filling in all the requirements we need to run the following command:

Command:

pip install ansible

After running the following command we can see some processing is here and after that to verify the installation we need to run the following command.

Command:

ansible --version
Verify Ansible Version
Verify Ansible Version

In the below output we can see the cfg file of the ansible and also about the inventory details.

Installing Ansible
Installing Ansible

Configuring the Ansible Controller

To configure the files we add the two files with the name of ansible.cfg and inventory and also we added a file with the name of key under which I added my ssh connection key which is generated while creating the EC instances.

Below are the configuration of my hosts which I used to make it perform I make one host active and another inactive which we can verify into the below output.

ansible.cfg

[default]
inventory=inventory
inventory
172.31.80.208 ansible_ssh_user=ec2-user ansible_ssh_private_key_file=./key
172.31.95.70 ansible_ssh_user=ec2-user ansible_ssh_private_key_file=./key

Output:

Configuring Ansible
Configuring Ansible

We can have a look at some of the python and HTML projects and are also available to fork the repos.

Github User Name: PythonT-Point

So, in this tutorial, we discussed Installing Ansible on AWS and we have also covered different examples related to its implementation. Here is the list of examples that we have covered.

  • What is Ansible?
  • Installing Ansible on AWS
  • Configuring the Ansible Controller

3 thoughts on “Installing Ansible Using AWS”

Leave a Comment