puppetlabs/facter — pull request #680 by wdoekes (2014-05-19 14:05:22+00:00)
Title: Use `hostname -f` for `fqdn` if available.

Some systems have a hostname other than the concatenation of `hostname`
and `dnsdomainname`. Or put differently, the `hostname -s` is not equal
to `hostname`:

$ hostname -f
systemX.locationY.domain.tld
$ hostname
domain-systemX

This keeps the local hostname short yet detailed enough.

In that case, the right FQDN would be obtained by concatenating the
(short!) `hostname -s` with `dnsdomanname`:

$ hostname -s
systemX
$ dnsdomainname
locationY.domain.tld

However, `facter fqdn` returns this:

$ facter fqdn
domain-systemX.locationY.domain.tld
^-- wrong, should be: systemX.locationY.domain.tld

This patch changes things so that on systems with `hostname -f`, that
value is used instead.