DevOps Classroom Series – Ansible Installation – 06/Nov/2019
Ansible Installation
Lab Setup
Create two ec2 machines with t2.micro in AWS
Tag one machine as ACS and other as Node-1
Login into ACS and become root user user
Enable Password Based Authentication
vi /etc/ssh/sshd_config
change the contents
# PasswordAuthentication no => PasswordAuthentication yes
service sshd restart
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
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