🔰Ansible Playbook which will dynamically load the variable file named same as OS_name🔰

rishabhsharma
2 min readJan 6, 2021

ARTH — Task 14 👨🏻‍💻

Task Description📄

🔰 14.3 Create an 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. )

👉🏻Lets get started…😃

🌟Controller Node🌟

My Controller Node IP 172.31.43.34 on which ansible is installed.

🔹Inventory file :

Configuration file of ansible :

# vim /etc/ansible/ansible.cfg

🔹Now let’s check the connectivity :

🌟 Ansible Playbook : task.yml

html files: In path /task14.3/files :

Variables : In path /task14.3/vars :

🔹Now let’s run our playbook :

# ansible-playbook task.yml

Done!!

🌟Managed/Target Nodes🌟

Now checking our managed nodes

🔶RedHat OS IP 172.31.35.97🔶

🔶Ubuntu OS IP 172.31.36.158🔶

🔹Let’s check our webpage from the browser :

TASK COMPLETED Successfully✌🏻👨🏻‍💻

Thanks for reading !!!😊✨

🔰Keep Learning ❗❗🔰Keep Sharing ❗❗

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

rishabhsharma
rishabhsharma

Written by rishabhsharma

Data Engineer | Azure Databricks | AWS | PySpark | DevOps | Machine Learning 🧠 | Kubernetes ☸️ | SQL 🛢

No responses yet

Write a response