utilize ${::osfamily} and ensured vars are ${} scoped

Make use of ${::osfamily} instead of ${::operatingsystem} for the case switch. This makes the code more portable across similar operating systems. Also scoped vars with ${} in all cases for consistency.