Ansible Playbook which will dynamically load the variable file.
This blog is about how we can Configure a Ansible Playbook which will dynamically load the variable file named same as OS_name and just by using the variable names we can Configure our target node.(without the use of when keyword).
🔹First we have to update the Ip addresses in Inventory file(#vim /root/ip.txt) of controller node on which we want to configure something.
🔹Ansible Configuration file
In this file have to update both , Inventory file location and also our key to login into AWS Instance(key should be present in controller node). The path of file is #vim /etc/ansible/ansible.cfg.
Now check the connectivity of Managed Nodes with Controller Node.
#ansible all -m ping all command is used to check the connectivity.
Now we see our Ansible Playbook
🔹 Running Playbook
Now we are done with the Controller node configuration..!!
Lets check it manually on managed node.
Lets have a look of what we configured actually.
🔹checking on browser
So, we finally we Configure a Ansible Playbook which will dynamically load the variable file.
For Furthur Queries, Suggestion’s Feel Free to Connect with me On Linkedin.