[chef] Re: Re: Problem setting fqdn on a node


Chronological Thread 
  • From: Jacobo García < >
  • To:
  • Subject: [chef] Re: Re: Problem setting fqdn on a node
  • Date: Thu, 5 Aug 2010 19:47:23 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=IXCxXQdFWMiBEH39cQaRkfOtk117t/G25wOFBXoKfX9vZzZFDq0z3NVKpHF0fj5n8o KBjjeGpI41xP+45LLKVZyuN5wvy7h1RNAkt+LWOY6daeIpJT0rbBzXzXO+nqhz9vguSm hCYuRcw2KQehFDRSxXjeJrG7XjOXaRf7JLh14=

Machines are slicehost vms. How they get their fqdn goes like this:

1. A new machine is added through slicehost panel, I give it a simple name like app01.
2. The machine is based on a image that has a chef-bootstrap script on init. This script runs only on first boot, installs ruby, rubygems, chef, sets the fqdn and then registers the node on the opscode platform. This is the relevant part of the code

HOSTNAME=`hostname`
DOMAIN=foo.com

echo " - setting hostname to $HOSTNAME.$DOMAIN."
echo $HOSTNAME.$DOMAIN > /etc/hostname
sed -i s/$HOSTNAME/$HOSTNAME.$DOMAIN/ /etc/hosts
hostname $HOSTNAME.$DOMAIN

At this moment the machine does not have dns entries associated with it, but if I this is a requisite I can work it out.
Also its ip address not assigned via dhcp (see above).

Thanks.





Jacobo García López de Araujo
blog: http://robotplaysguitar.com
http://workingwithrails.com/person/13395-jacobo-garc-a



On Thu, Aug 5, 2010 at 7:10 PM, Leinartas, Michael < " target="_blank"> > wrote:
How do you get your IP and domain?  Are the machines assigned via dhcp? Do the ip addresses have reverse entries with the proper fqdn?
Hi chefs,

I'm having lots of problems when setting fqdn on ubuntu 10.04 nodes so chef gets the fqdn right. 

If I run 'hostname fqdn' hostname returns fqdn but hostname -f does not, and the node gets registered with just the machine name.

The only way I found to make chef get the fqdn is adding an entry to /etc/hosts with the ip address and the fqdn on the machine. I haven't had this problem on ubuntu 8.04 nodes. 

I'd like to find another way to make this work than editing /etc/hosts before chef register nodes. 

Has anyone had this problems? 

Greetings.

Jacobo García López de Araujo
blog: http://robotplaysguitar.com
http://workingwithrails.com/person/13395-jacobo-garc-a






Archive powered by MHonArc 2.6.16.

§