Rework for apt/yum packages

I've also taken the liberty of cleaning this up so it should be able to be posted to https://galaxy.ansible.com/ for distribution and easy installation by others.