4 ms·
I would take a different approach when describing the distribution choice, and consequently, the modules. Well-written tasks (and eventually roles) aim to use
by bravetraveler 5y ago
I would take a different approach when describing the distribution choice, and consequently, the modules.
Well-written tasks (and eventually roles) aim to use the generic modules when available. Skip 'apt' unless you truly need to target that platform for some reason. Use 'package' instead.
The 'package' module will figure out the appropriate package manager. This way the only real cross-distribution work you have to do tends to be:
- config file location overrides
- package names
... in limited cases. This is where roles, group_vars, and facts all get really useful.
Principles like this let me support a base of ~5 distributions spanning a few families/roots without too much trouble at all!
In the sense that K8s doesn't really care about the OS underneath, I try to recreate it in my Ansible playbooks