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

Ansible Installation

Lab Setup

Preview

  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
visudo
 # in the file opened
 devops  ALL=(ALL:ALL) NOPASSWD:ALL

# 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-keygen
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

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

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

Please turn AdBlock off
Social Network Widget by Acurax Small Business Website Designers

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube