Go to AWS account → Create 3 EC2 instances in same AZ
take access of all machines via putty
Now go inside ansible server and download ansible package
now do ls
Now we have to install all the packages one by one
Now go to hosts file inside ansible server and paste private-ip of node1 & node2
Now this hosts file is only working after updating ansible.cfg file
vi etc/ansible/ansible.cfg
uncommented
inventory = /etc/ansible/hosts
sudo-user = root
Now create one user, in all the three instances
Now sett password for this user
Now switch as ansible user
this ansible user dont have sudo priviledges right now if you want to give sudo priviledge to ansible user
vi sudo
Now go inside this file,
# # Allow root to run any commands anywhere
root ALL=(ALL) ALL
ansible ALL=(ALL) NOPASSWD: ALL
Now do this thing in other nodes also
Now go to ansible server and try to install httpd package as a ansible user
Now, establish connection between server and node , go to ansible server
ssh 172.31.41.240
o/p: permission denied
Now we have to do some changes in sshd-config file go to ansible server
Do some changes & saved the file
Do this work in Node1 & Node2 also