How is fqdn generated?
On my system it is set to it011064.uib.no, but it really should be set
to it011064.klientdrift.uib.no. Reverse dns and hostname is correct:
root@it011064:~# facter --puppet | grep ^fqdn
fqdn => it011064.uib.no
root@it011064:~# hostname
it011064
root@it011064:~# host $(hostname)
it011064.klientdrift.uib.no has address 129.177.11.64
root@it011064:~# host $(host $(hostname)|awk ''{ print $4 }'')
64.11.177.129.in-addr.arpa domain name pointer it011064.klientdrift.uib.no.
Bjørge
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Hi, what says "hostname -f"? What about your /etc/hosts and /etc/ hostname ? Regards, Michael On 8 Sep., 13:36, Bjorge Solli <bjo...@solli.priv.no> wrote:> How is fqdn generated? > > On my system it is set to it011064.uib.no, but it really should be set > to it011064.klientdrift.uib.no. Reverse dns and hostname is correct: > > root@it011064:~# facter --puppet | grep ^fqdn > fqdn => it011064.uib.no > root@it011064:~# hostname > it011064 > root@it011064:~# host $(hostname) > it011064.klientdrift.uib.no has address 129.177.11.64 > root@it011064:~# host $(host $(hostname)|awk ''{ print $4 }'') > 64.11.177.129.in-addr.arpa domain name pointer it011064.klientdrift.uib.no. > > Bj rge-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi Bjørge,
The clue is in looking at the code for the ''fqdn'' fact:
<snippet>
host = Facter.value(:hostname)
domain = Facter.value(:domain)
if host and domain
[host, domain].join(".")
</snippet>
And drilling into the ''domain'' fact:
<snippet>
if name = Facter::Util::Resolution.exec(''hostname'')
if name =~ /.*?\.(.+$)/
$1
end
elsif domain =
Facter::Util::Resolution.exec(''dnsdomainname'')
domain if domain =~ /.+\..+/
elsif FileTest.exists?("/etc/resolv.conf")
domain = nil
search = nil
File.open("/etc/resolv.conf") { |file|
file.each { |line|
if line =~ /domain\s+(\S+)/
domain = $1
elsif line =~ /search\s+(\S+)/
search = $1
end
}
}
next domain if domain
next search if search
end
</snippet>
So the ''domain'' part is worked out by:
* Stripping the domain part from the ''hostname'' command OR
* Extracting it from the ''dnsdomainname'' command OR
* Grabbing it from /etc/resolv.conf by looking at domain and then search
ken.
On Thu, Sep 8, 2011 at 12:36 PM, Bjorge Solli <bjorge@solli.priv.no>
wrote:> How is fqdn generated?
>
> On my system it is set to it011064.uib.no, but it really should be set
> to it011064.klientdrift.uib.no. Reverse dns and hostname is correct:
>
> root@it011064:~# facter --puppet | grep ^fqdn
> fqdn => it011064.uib.no
> root@it011064:~# hostname
> it011064
> root@it011064:~# host $(hostname)
> it011064.klientdrift.uib.no has address 129.177.11.64
> root@it011064:~# host $(host $(hostname)|awk ''{ print $4
}'')
> 64.11.177.129.in-addr.arpa domain name pointer it011064.klientdrift.uib.no.
>
> Bjørge
>
> --
> You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
puppet-users+unsubscribe@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"
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Hi Ken! Thanks for the reply! The first two could be solved as one using ''hostname --fqdn'', meybe even the third one. I decided we should solve this the proper way and update dhcp to specify option domain-name klientdrift.uib.no uib.no But since our clients will wander around the globe we want to specify the certname in the puppet.conf. Is there any other caveates when it comes to naming we should know about? Bjørge On 08/09/11 13:45, Ken Barber wrote:> Hi Bjørge, > > The clue is in looking at the code for the ''fqdn'' fact: > > <snippet> > host = Facter.value(:hostname) > domain = Facter.value(:domain) > if host and domain > [host, domain].join(".") > </snippet> > > And drilling into the ''domain'' fact: > > <snippet> > if name = Facter::Util::Resolution.exec(''hostname'') > if name =~ /.*?\.(.+$)/ > $1 > end > elsif domain = Facter::Util::Resolution.exec(''dnsdomainname'') > domain if domain =~ /.+\..+/ > elsif FileTest.exists?("/etc/resolv.conf") > domain = nil > search = nil > File.open("/etc/resolv.conf") { |file| > file.each { |line| > if line =~ /domain\s+(\S+)/ > domain = $1 > elsif line =~ /search\s+(\S+)/ > search = $1 > end > } > } > next domain if domain > next search if search > end > </snippet> > > So the ''domain'' part is worked out by: > > * Stripping the domain part from the ''hostname'' command OR > * Extracting it from the ''dnsdomainname'' command OR > * Grabbing it from /etc/resolv.conf by looking at domain and then search > > ken. > > On Thu, Sep 8, 2011 at 12:36 PM, Bjorge Solli <bjorge@solli.priv.no> wrote: >> How is fqdn generated? >> >> On my system it is set to it011064.uib.no, but it really should be set >> to it011064.klientdrift.uib.no. Reverse dns and hostname is correct: >> >> root@it011064:~# facter --puppet | grep ^fqdn >> fqdn => it011064.uib.no >> root@it011064:~# hostname >> it011064 >> root@it011064:~# host $(hostname) >> it011064.klientdrift.uib.no has address 129.177.11.64 >> root@it011064:~# host $(host $(hostname)|awk ''{ print $4 }'') >> 64.11.177.129.in-addr.arpa domain name pointer it011064.klientdrift.uib.no. >> >> Bjørge >> >> -- >> You received this message because you are subscribed to the Google Groups "Puppet Users" group. >> To post to this group, send email to puppet-users@googlegroups.com. >> To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. >> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. >> >> > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
> The first two could be solved as one using ''hostname --fqdn'', meybe even > the third one.Perhaps the methodology chosen was more compatible with multiple UNIX operating systems. For example hostname --fqdn doesn''t seem to work on Mac OS X. A lot of facter code may appear quirky on the surface for this exact reason.> I decided we should solve this the proper way and update dhcp to specify > option domain-name klientdrift.uib.no uib.no > > But since our clients will wander around the globe we want to specify > the certname in the puppet.conf. Is there any other caveates when it > comes to naming we should know about?Not off the top of my head ... perhaps someone else may provide input as I haven''t really experimented with this kind of setup. ken. -- "Join us for PuppetConf, September 22nd and 23rd in Portland, OR: http://bit.ly/puppetconfsig" -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Indeed it was wrong in /etc/hosts, but this whould be ok when DHCP is set up differently. Thanks Bjørge On 08/09/11 13:40, michaelkrieg wrote:> Hi, > > what says "hostname -f"? What about your /etc/hosts and /etc/ > hostname ? > > Regards, > Michael > > On 8 Sep., 13:36, Bjorge Solli <bjo...@solli.priv.no> wrote: >> How is fqdn generated? >> >> On my system it is set to it011064.uib.no, but it really should be set >> to it011064.klientdrift.uib.no. Reverse dns and hostname is correct: >> >> root@it011064:~# facter --puppet | grep ^fqdn >> fqdn => it011064.uib.no >> root@it011064:~# hostname >> it011064 >> root@it011064:~# host $(hostname) >> it011064.klientdrift.uib.no has address 129.177.11.64 >> root@it011064:~# host $(host $(hostname)|awk ''{ print $4 }'') >> 64.11.177.129.in-addr.arpa domain name pointer it011064.klientdrift.uib.no. >> >> Bj rge-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.