ubuntuchef-infraknife

How to set/change host name using Chef?


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?


Solution

  • 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.