Facter & IPv6 & fqdn issues
Please note this is a direct copy from the forum post here - https://groups.google.com/forum/#!top...
I'm having issues with facter-2.2.0-1.el6.x86_64 and hostname resolution. Previously we were on facter-1.6.18-1.el6 and we are looking to update all of our hosts to 2.2.0x+
We have a mix of hosts in our environment with IPv4& IPv6 addresses. The hosts which have an IPv4 address don't have any issues, the hosts which are IPv6 only do!
# rpm -q facter; facter hostname fqdn ipaddress facter-1.6.18-1.el6.x86_64 fqdn => host.location.example.com hostname => host ipaddress => aaaa:bbbb:ccc:d:eeee:ff:gggg:hhhh
What I do notice is that /usr/lib/ruby/site_ruby/1.8/facter/domain.rb is using hostname to resolve name.
When we update to facter 2.2 the fqdn changes due to domain.rb using hostname -f
# rpm -q facter; facter hostname fqdn ipaddress facter-2.2.0-1.el6.x86_64 fqdn => host.example.com (location is now missing) hostname => host ipaddress => aaaa:bbbb:ccc:d:eeee:ff:gggg:hhhh # hostname -f hostname: No address associated with name
Should we be using hostname -A and using the first result if hostname -f fails?
This issue is not present in net-tools 2.x which is part of the Linux 7.x range.
Note: if we add in a work around of "127.0.0.2 host.location.example.com host" into /etc/hosts it works as expected, but then facter ipaddress returns the private address and this is unwanted behavior.
Any feedback is welcomed on this as i'm keen to move forward and get facter 2.2.0x installed.