This is going to set $apache::osfamily and not $::osfamily.  It should really be added to the site.pp or somewhere more appropriate global scope.