[chef] Re: Re: Re: Re: Setting Hostname on EC2 Instance Spinup


Chronological Thread 
  • From: Rob Guttman < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Setting Hostname on EC2 Instance Spinup
  • Date: Tue, 5 Apr 2011 08:04:57 -0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=pVb20pLqsQFP4aF3xzePULmL+pD1FfNQ9QgQygbunqj5YQPZhZMTvifMcaFQXcJEjo eI4dRG5yeOv05EBZWepKO9CoKunGgvjYQHTcCtoVm6+xeMfV/Db5w0FSXzEaToeLEQen K74X30Gu57sjuWb7Dh2mX3Fk0hJB3KWG0iUmI=

> This is what we do for our EC2 nodes, except we use the instance ID for the node name and generate the hostnames from the roles.

Dan, where can I find how to do something like this for ec2 nodes?  Is the recipe available somewhere?

Thanks.
- Rob


On Tue, Apr 5, 2011 at 12:58 AM, Daniel DeLeo < "> > wrote:

On Monday, April 4, 2011 at 9:53 PM, Chris Streeter wrote:

I ran knife with the -N option with the parameter set to 'www'. However, the
hostname of the box (set on the box and in the opscode console) is set to an
AWS internal IP (ip-10-XXX-XX-XX) while the nodename is set to www. So this
doesn't quite do what I want it to do. I want the actual hostname of the box to
be www.

Otherwise, in a template, how do I get the node's name (for populating
/etc/hosts on all machines)?
By setting the node name via -N, you should create the node and it's client with the given id, and configure it to use those values instead of the hostname. Then you're free to change the hostname without changing the ID the node uses to identify itself with the server. So you could create a cookbook to configure the hostname according to the node name. This is what we do for our EC2 nodes, except we use the instance ID for the node name and generate the hostnames from the roles. But the basic idea is the same.

-- 
Dan DeLeo





Archive powered by MHonArc 2.6.16.

§