facter not returning 'fqdn' any more

1,106 views
Skip to first unread message

Sans

unread,
Sep 13, 2011, 8:33:38 AM9/13/11
to Puppet Users
I know it's not directly related to Puppet but I didn't find any
better place to ask about this either.

Since sometimes, there is no value for 'fqdn' in facter on the puppet
agents.

[root@disk10 ~]# facter hostname
disk10
#
[root@disk10 ~]# facter fqdn && date
Tue Sep 13 13:26:54 BST 2011
#
[root@disk10 ~]# rpm -qa | grep facter
facter-1.6.1-0.1.rc2.el5

another thing, which is strange: the certificate request from the
agents used to go by the full-name (i.e. fqdn) and now it's only
taking the first-part i.e. the hostname. Does anyone know what am I
missing? Cheers!!

Ken Barber

unread,
Sep 13, 2011, 9:34:43 AM9/13/11
to puppet...@googlegroups.com
> What version of facter are you running btw?

You already answered that - never-mind :-).

ken.

Ken Barber

unread,
Sep 13, 2011, 9:32:51 AM9/13/11
to puppet...@googlegroups.com
I'm guessing you get nothing when you try:

facter domain

?

What version of facter are you running btw?

Can you show the results of the following commands:

hostname
dnsdomainname
cat /etc/resolv.conf

Cheers.

ken.

> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>
>

--
"Join us for PuppetConf, September 22nd and 23rd in Portland, OR:
http://bit.ly/puppetconfsig"

Sans

unread,
Sep 13, 2011, 9:50:24 AM9/13/11
to Puppet Users
Nope, "facter domain" doesn't return anything either.

[root@disk10 ~]# facter domain && date
Tue Sep 13 14:44:21 BST 2011

"hostname", "dnsdomainname" and "resolv.conf" are just fine, like
this:


[root@disk10 ~]# hostname
disk10
[root@disk10 ~]# dnsdomainname
hep.xxx.xxx.ac.uk
[root@disk10 ~]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search hep.xxx.xxx.ac.uk
nameserver 172.xx.xx.136
nameserver 172.xx.xx.137

Incidentally, my puppet master runs "facter-1.6.0-2.el5" and here
"facter fqdn" returns the correct value.
Cheers!!

Ken Barber

unread,
Sep 13, 2011, 10:29:57 AM9/13/11
to puppet...@googlegroups.com
Yep - that looks like a bug. The change was here:

https://github.com/puppetlabs/facter/commit/f7daae300d5c993052dd6c49b1b5e1f3501eaa10

Basically the domain =~ part is _not_ returning true even though
dnsdomainname is returning something, and not falling through as it
used to to find the answer from resolv.conf I think. I'm not sure why
this logic was changed to not be a fall-through logic - its really a
question for the patch author.

Can you raise a ticket Sans and post it to this thread?

http://projects.puppetlabs.com/projects/facter/issues/new

ken.

Ken Barber

unread,
Sep 13, 2011, 10:36:05 AM9/13/11
to puppet...@googlegroups.com
I could be wrong about the cause actually ... I think its still a bug
though :-).

Let me take a closer look at the code and see if I can work it out.

ken.

Ken Barber

unread,
Sep 13, 2011, 10:43:59 AM9/13/11
to puppet...@googlegroups.com
Yeah okay I was close though :-).

if name = Facter::Util::Resolution.exec('hostname')
...
elsif domain = Facter::Util::Resolution.exec('dnsdomainname')

The first bit will pretty much always be true ... and if your
'hostname' command doesn't contain your full domain - it won't fall
back to checking dnsdomainnname or resolv.conf.

ken.

Ken Barber

unread,
Sep 13, 2011, 12:38:17 PM9/13/11
to puppet...@googlegroups.com
Since this is urgent and we are in RC, I've raised a bug for you Sans:

http://projects.puppetlabs.com/issues/9457

ken.

Sans

unread,
Sep 13, 2011, 4:21:00 PM9/13/11
to Puppet Users
Thanks Ken!
Back home an hr. or so ago and saw you reply. Is it the "/usr/lib/ruby/
site_ruby/1.8/facter/domain.rb" file that you were talking about?

Cheers,
San

Ken Barber

unread,
Sep 13, 2011, 4:25:19 PM9/13/11
to puppet...@googlegroups.com
Yeah - try this copy instead if you can:

https://raw.github.com/puppetlabs/facter/master/lib/facter/domain.rb

ken.

Sans

unread,
Sep 13, 2011, 5:46:19 PM9/13/11
to Puppet Users
Done!!
Work like a charm. thanks.

-Santanu

Ken Barber

unread,
Sep 13, 2011, 6:09:07 PM9/13/11
to puppet...@googlegroups.com
Good to hear. That fix should be in the next rc.

ken.

Reply all
Reply to author
Forward
0 new messages