I have a cookbook to set /etc/hosts, not sure if it's been pulled on the main cookbooks repo-> works with rackspace or no cloud provider. Feel free to update or modify--GillesOn Wed, Nov 17, 2010 at 9:04 AM, Daniel DeLeo < " target="_blank"> > wrote:
As mentioned earlier, changing the hostname is as simple as managing whatever files your distro/OS uses to set the hostname, but if you're planning to do this, set the node name in the client.rb when you first register the node.On Tue, Nov 16, 2010 at 11:24 PM, Joshua Miller < " target="_blank"> > wrote:
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.I think the best ID to use really depends on your infrastructure. Using the hostname works really well when you have a small-ish number of semantically (or whimsically) named boxes (like app1.example.com or centaur.example.com) where everyone knows the boxes by name. If you're on EC2, then instance ids are a good choice (same with other cloud providers and their unique ids). In a large setup with tons of physical boxes that PXE boot, you might do something different or roll your own guid service (and you couldn't use MAC addresses either).So it's really all about the tradeoffs for your environment.
JoshuaOn 17 November 2010 19:46, < " target="_blank"> > 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
Dan DeLeo
Archive powered by MHonArc 2.6.16.