Ansible - How to setup Ansible Environment
In my example, I will should you how to setup your ansible environment and run the ping module.
1) I have created 3 Ubuntu servers with the names:-
Server1 - Installed Ansible
Server2 - Client Node1
Server3- Client Node2
Note:- I installed ansible on Server1 by running the below commands on ubuntu:-
sudo apt-add-repository ppa:ansible/ansible
sudo apt update
sudo apt install ansible
Once ansible is installed on the server1, we can check it by running the command:- ansible --version
2) Then I generated ssh-keys on the server1 by running the command:= ssh-keygen -t rsa
This is to make sure, we can run the ansible playbooks from the ansible server. I will be using root user to execute the playbooks.
5) Then I created my inventory file in the same folder as inv