How to set/change host name using Chef?

Gaurav Borole picture Gaurav Borole · Aug 28, 2013 · Viewed 11.7k times · Source

I have few nodes in running mode, I have to set hostname to those nodes.

Is there any Cookbook, in that we can set attribute host_name and run that recipe on respective nodes?

Answer

Mark O'Connor picture Mark O'Connor · Aug 29, 2013

Author's note

This answer is over 6 years old.

As @lamont points out chef now supports a hostname resources


Original answer

There is a community hostname cookbook.