Hi all,
This, to me, is really bizarre. Here's my code:
Facter.add("hostname_app") do
setcode do
hostname_app = Facter.value(:hostname)
hostname_app[5] = 'a'
hostname_app
end
end
Basically, our servers have 2 network cards, and we need to set up DNS for both of its IP addresses. eth0 & the server's hostname is its 'management' name, and eth1 is the server's 'application'/business network.
The management hostname and application hostname only differ by one letter, which is what the above code is changing.
Now, when this runs, the hostname_app fact is set correctly, but the default hostname fact is also changed similarly! How on earth is that happening?
I've confirmed that a normal 'facter' run has the correct hostname set, and removing this custom fact also keeps the hostname fact correct under a 'facter -p' run. However, with this fact in place a 'facter -p' run shows the incorrect hostname fact!
Thanks,
Matt.