Ansible Setup
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository - yes - update ppa:ansible/ansible
sudo apt install ansibleAfter installing the Ansible,
Set up the hostnames in both machines.
For master machine: hostnamectl set-hostname masternode
For node machine: hostnamectl set-hostname node101
Get Muhammad Rafay’s stories in your inbox
Join Medium for free to get updates from this writer.
set SSH so Ansible can access the node machine
// write this in master machine so node will be accessible
ssh-keygen
ssh-copy-id <username>@ip
//check
ssh <username>@ipAfter setting this you have to ping through this command
ansible all -m pingAfter doing this if you are facing an error then go to
cat /etc/ssh/sshd_configand uncomment this line if you want the sudo priviliges and set it to yes
#PermitRootLogin yesSetup done!
I hope It will help you install ansible tool!
#Ansible








