Create An Ansible Playbook In Such a Way Which Dynamically Retrieve Change the Package On Fly According To Distribution & Ver !! 🤔

Shashwat Singh
Mar 28, 2021

--

I think Now , You got the Problem Statement !!
👉Lets Start :

Here We Can Take the Help Of Facts !!
Now, We will make the Variable files with same name as Distribution and its Version.
→ RedHat-8.yml or Ubuntu-8.yml
In these files we will give the software name with the help of Variable so that we can capture those software name on the Fly.

How we can capture the Distribution and Version ? 🤔

ansible_facts['distribution']  -->  Distributor Name
ansible_facts['distribution_major_version'] --> Version

Write the PlayBook !

Ansible Playbook

Hope You Like This Blog !!

--

--

Shashwat Singh
Shashwat Singh

Written by Shashwat Singh

Cyber Security Enthusiasm || DevOps || Backend Development || Linkedin -https://www.linkedin.com/in/shashwatsing/ || Github - https://github.com/Shashwatsingh22

No responses yet