🔰 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.

(Note: No need to use when keyword here.)

Let’s Start……

1. Update the configuration file of Ansible :

2. Update the inventory files :

3. Create a Variable files :

4. Now let check the connectivity :

5. Ansible playbook for automation :

6. Now run the playbook :

7. Check with the IP of RedHat OS :

8. Check with the IP of UbuntuOS :

Task Completed !!!