[chef] Re: Re: How can I set the hostname of a node via a recipe?


Chronological Thread 
  • From: Joshua Miller < >
  • To:
  • Subject: [chef] Re: Re: How can I set the hostname of a node via a recipe?
  • Date: Tue, 16 Nov 2010 23:24:18 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; b=f4igeh1tfPOFWTBCK+TP1tz3iKxb4am+RiNEzUdRFNyMAmyDb0/SB4enEy9c92xAVc ZU01Gu80/4GgSmuRZt46dPibiUcGiTZoRs9hfo2OU4Sn6+9XOSicauNMV8nOhaUGlf14 eb1xOa6XLXEdWgitUCArjZcl1XShdlF1G1yyg=

Given that Chef uses the host name as its primary identifier you better be careful.  You should set the name during build or if you must then use a different primary key

    -N, --node-name NODE_NAME        The node name for this client

http://wiki.opscode.com/display/chef/Chef+Client

or node_name in the client.rb

http://wiki.opscode.com/display/chef/Chef+Configuration+Settings

I have always thought the mac address would make a much better uniq id, and then use node[:fqdn] for gui / knife output. 


Joshua



AJ Christensen wrote:
" type="cite">Some combination of the dynect (opscode) reboot (dreamcat4) and a couple of execute resources would probably do the trick.

Regards,

AJ

On 17 November 2010 19:46, < "> > wrote:

Is it possible to set the hostname via a recipe? If so does a cookbook exist
already, I couldnt find one before.

Cheers
Jono




Archive powered by MHonArc 2.6.16.

§