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.

I have 3 instances launched one is our control node, one RedHat OS and one Ubuntu OS

Inventory:

vim ip.txt

Ansible Configuration File:

vim ansible.cfg

We are going to use ansible facts to satisfy the requirements..

Main Task:

— Create a variable file named as RedHat.yml

— Create a variable file named as Ubuntu.yml

Create a playbook to configure webserver in our instances and will dynamically load the variable file named same as OS_name and just by using the variable names we can Configure our target node.

vim task14.3.yml

My /root/index.html file

Now run the playbook to configure our webserver…

Checking our website…

Task Completed successfully!!!

Thank You!!

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

4 ways to launch a Mini Program from an Official Account

An interesting breakthrough for your Slack to Teams migration manual!

The beauty of Docker for local Laravel development

Cloning of Dermstore Website

Product Report Card, 12/2021

How Can Laravel Be Used for Big Enterprise Apps?

Announcing GameFinance: Binance Smart Chain !!

Simple IoT Dashboard with Azure SignalR

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sangeeth Sahana D

Sangeeth Sahana D

More from Medium

GitLab Container/Docker Registry

Setting Up Docker on Ubuntu 20.04 Focal (Arm64) Oracle Cloud

Give Me Some (macOS) Context…

Lab: Create a Virtual Machine using ARM