refactor to make ansible script run better on unknown operating systems.