DevOps Classroom Series – Ansible Installation – 06/Nov/2019

Ansible Installation

Lab Setup


  1. Create two ec2 machines with t2.micro in AWS
  2. Tag one machine as ACS and other as Node-1
  3. Login into ACS and become root user user
  4. Enable Password Based Authentication
vi /etc/ssh/sshd_config
change the contents
# PasswordAuthentication no  => PasswordAuthentication yes
service sshd restart
  1. Create a user devops and give sudo permissions
adduser devops
 # in the file opened

# To test this
su devops
sudo apt-get update
# It should not ask for password and it should complete the command execution
  1. If python is not installed on ACS, install python
    • To install ansible on Ubuntu Refer Here
    • On the node execute the following lines
sudo apt update
sudo apt install software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt-get install python -y
  1. Install Ansible on ACS
  2. Repeat the steps from 3 to 6 on node-1
  3. Login into ACS as devops and configure password less login into node-1
ssh devops@<acspublicip>
ssh-copy-id devops@<node1privateip>

  1. Do the following to test connectivity
sudo mv /etc/ansible/hosts /etc/ansible/hosts.orig
sudo vi /etc/ansible/hosts

# add node1-private ip and save the file
# check by executing
ansible -m ping all

Refer the following

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner