Overwrite facter 'osfamily' value
I extended a module by calling it from my module. The base module prefers to identify Amazon Linux OSfamily as 'Redhat' but the facter installed by puppet on the Amazon Linux OS reports the os as 'Linux'.
I want to correct this bug by overwriting the facter value of osfamily from Linux to Redhat before calling the base module.
my osfamily.rb inside mymodule/lib/facter is
Facter.add('osfamily') do setcode do case Facter.value(:operatingsystem) when "Amazon" "RedHat" else Facter.value("kernel") end end end
But the problem is, I am unable to overwrite the osfamily value. Even after loading facts from osfamily.rb, osfamily is still being reported as 'Linux' instead of 'Redhat'.
my code is working correctly for new values like 'osfamilytest' or ''operatingsystemreleasetest' but not for existing values like 'osfamily' or 'operatingsystemrelease'.
Puppet Version: 2.7.25 Facter Version: 1.6.18 Operating System: Amazon Linux 2015.03 Puppet installation steps: yum install puppet