puppet ignoring /etc/hosts?

3,394 views
Skip to first unread message

Steve Wray

unread,
Aug 6, 2009, 9:42:00 PM8/6/09
to puppet...@googlegroups.com
Hi there,

I have a small isolated group of servers. I don't want to set up DNS
infrastructure for this.

I have an /etc/hosts file that looks like:

<snip>
127.0.0.1 localhost.localdomain localhost
192.168.50.70 tec-puppet.tec.cwa.co.nz tec-puppet
</snip>

I can ping tec-puppet fine:

root@tec-lb1:/etc# ping tec-puppet
PING tec-puppet.tec.cwa.co.nz (192.168.50.70) 56(84) bytes of data.
64 bytes from tec-puppet.tec.cwa.co.nz (192.168.50.70): icmp_seq=1 ttl=64
time=0.077 ms

I can ping the FQDN just fine:

root@tec-lb1:/etc# ping tec-puppet.tec.cwa.co.nz
PING tec-puppet.tec.cwa.co.nz (192.168.50.70) 56(84) bytes of data.
64 bytes from tec-puppet.tec.cwa.co.nz (192.168.50.70): icmp_seq=1 ttl=64
time=0.068 ms

I have this in /etc/puppet/puppet.conf:

<snip>
[puppetd]
server=tec-puppet.tec.cwa.co.nz
runinterval=300
</snip>

I have this in /etc/nsswitch.conf:

<snip>
hosts: files
networks: files
</snip>

and this in /etc/host.conf:

<snip>
order hosts
</snip>

They do have an /etc/resolv.conf file and they should (and normally do) use
DNS for queries outside their little world; I just made these nsswitch.conf
and host.conf refer exclusively to /etc/hosts files in order to prove that
something seems to be ignoring the resolver library configuration.


When I run puppetd -vt I get:

<quote>
dnsdomainname: Unknown host
</quote>

something seems wrong...

This is all running under Debian Lenny.

root@tec-lb1:/etc# puppetd --version
dnsdomainname: Unknown host
0.24.5

So.. from the 'dnsdomainname' ref there, it would seem to my untrained eye
that despite my best efforts in nsswitch.conf and host.conf, puppet is
trying DNS anyway...?

--
Please remember that an email is just like a postcard; it is not
confidential nor private nor secure and can be read by many other people
than the intended recipient. A postcard can be read by anyone at the mail
sorting office and expecting what is written on it to be private and secret
is not realistic. Please hold no higher expectation of email.

If you need to send confidential information in an email you need to use
encryption. PGP is Pretty good for this.

Steve Wray

unread,
Aug 6, 2009, 10:03:57 PM8/6/09
to puppet...@googlegroups.com

I just got the lenny-backport package.

Same problem:

root@tec-lb1:/etc/apt# puppetd --version
dnsdomainname: Unknown host
0.24.8

Len Rugen

unread,
Aug 6, 2009, 10:46:39 PM8/6/09
to puppet...@googlegroups.com
OH!  I'm pretty new at this and I think I know the answer :-)
 
I don't think puppetd reads /etc/sysconfig/puppet (speaking redhat), I think the /etc/init.d/puppet script is what really reads the confiig file.
 
Change hosts to:
192.168.50.70   tec-puppet.tec.cwa.co.nz        tec-puppet puppet
 
The "trash" dns is probably comming from /etc/resolv.conf.
 


 

jcbollinger

unread,
Aug 7, 2009, 9:38:49 AM8/7/09
to Puppet Users


On Aug 6, 9:03 pm, Steve Wray <steve.w...@cwa.co.nz> wrote:
> Steve Wray wrote:

[...]

> > something seems wrong...
>
> > This is all running under Debian Lenny.
>
> > root@tec-lb1:/etc# puppetd --version
> > dnsdomainname: Unknown host
> > 0.24.5
>
> I just got the lenny-backport package.
>
> Same problem:
>
> root@tec-lb1:/etc/apt# puppetd --version
> dnsdomainname: Unknown host
> 0.24.8
>
>
>
> > So.. from the 'dnsdomainname' ref there, it would seem to my untrained eye
> > that despite my best efforts in nsswitch.conf and host.conf, puppet is
> > trying DNS anyway...?

Try running the dnsdomainname program (or hostname --fqdn) from a
shell. I'd bet dollars to donuts that it gives you the same message.
If it does, then this is not a Puppet issue: it means that the system
resolver cannot resolve the system's own host name. I get similar
behavior with my puppet clients that acquire their hostname and IP
address via DHCP.

The diagnostic message is issued by facter (which you can test by
running facter directly from a shell prompt), and it is non-fatal, at
least for me. The effect on Puppet is simply that the 'dnsdomainname'
fact will not be available for the node.

jcbollinger

unread,
Aug 7, 2009, 9:48:21 AM8/7/09
to Puppet Users

On Aug 6, 9:46 pm, Len Rugen <lenru...@gmail.com> wrote:
> OH!  I'm pretty new at this and I think I know the answer :-)
>
> I don't think puppetd reads /etc/sysconfig/puppet (speaking redhat), I think
> the /etc/init.d/puppet script is what really reads the confiig file.

That's correct for the RedHat family of distros, but I think it's
irrelevant. The OP is setting the server name in his puppet.conf,
which puppetd DOES read.

Note that if you configure the RedHat way, you can start puppetd
successfully from the command line by specifying the options that the
init script gets from /etc/sysconfig/puppet. In my case, that means
providing a --server=<foo> option.

Steve Wray

unread,
Aug 10, 2009, 7:15:26 PM8/10/09
to puppet...@googlegroups.com

Ah well

It turned out that although the message was displaying on the *client* it
was coming from the *server*.

The server had a slightly incorrect /etc/hosts file.

jcbollinger

unread,
Aug 11, 2009, 8:46:41 AM8/11/09
to Puppet Users


On Aug 10, 6:15 pm, Steve Wray <steve.w...@cwa.co.nz> wrote:
> jcbollinger wrote:

[...]

> > Try running the dnsdomainname program (or hostname --fqdn) from a
> > shell.  I'd bet dollars to donuts that it gives you the same message.
>
> It turned out that although the message was displaying on the *client* it
> was coming from the *server*.
>
> The server had a slightly incorrect /etc/hosts file.

Weird, but I'm glad you got it resolved. I'm also glad you didn't put
up any donuts :-)

John
Reply all
Reply to author
Forward
0 new messages