Lab Setup
- We need 2 Linux VMs to Start, Lets create two free tier eligible linux vms on AWS/Azure
-
Creating a VM in AWS
- Create Account Refer Here
- Creating EC2 instance in AWS Refer Here
-
Creating a VM in Azure
- Create Account Refer Here
- Creating a VM in Azure Refer Here
- Login into the Ansible Control Node and install Ansible Refer Here. Since we are installing on ubuntu Refer Here
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
ansible --version
- Now lets try to configure the node. On the node python should be present if not install. SSH should be enabled. Ansible control node should be able to reach the node
- Now we need to ensure that the Ansible Control Node can login into the Node1
- Lets create a user on the Ansible control node and node1
username => devops
password => devops
- In some Linux Machines password authentication will be disabled by default (AWS).
- open /etc/ssh/sshd_config and search for PasswordAuthentication (if the value is no change it to yes and restart sshd
sudo service sshd restart
)
- open /etc/ssh/sshd_config and search for PasswordAuthentication (if the value is no change it to yes and restart sshd
- Now lets create user devops
- We need to add devops to sudoers group
sudo visudo