Recently I have been watching some ansible conference recordings and reading about best practices and I have a question.
How do you write your playbooks/roles to for cross platform use and be able to not to turn your specification to code with frequent "if"s and to not write too much boilerplate for each OS?
Ok I can abstract out package managers for example and just use package module, but still package naming sometimes will occur, or system will not be compatible with some module.
Is this even possible to write such roles? Or is there any guidelines that help avoid code overhead?
Sadly I didn't found any material on that matter.
Or the only way is writing separate tasks for OS-dependent "native" stuff and adding "if"s on top role level?