Create An Ansible Playbook In Such a Way Which Dynamically Retrieve Change the Package On Fly According To Distribution & Ver !! 🤔
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 !
Hope You Like This Blog !!