Step-1)Retreive the distro.
- First, we need to retrieve the distribution from ansible facts after use it.
- After we retrieve the distro, now we need to make the files respective to the distro, like — RedHat-8.yml, Ubuntu-16.yml, etc.
- First, we need to make the playbook for the distro.
- Here we need to give a package according to the distro.
- After that, we use this var at the time of installing the webserver from a playbook.
- Now include the ansible facts with the yml file, it automatically detects the file name with the distro name from the ansible facts.
Step-3)Run the Playbook.
- After this, run the playbook