Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


hostnames (9) Versions 0.3.6

Configures hostname and FQDN

cookbook 'hostnames', '= 0.3.6', :supermarket
cookbook 'hostnames', '= 0.3.6'
knife supermarket install hostnames
knife supermarket download hostnames
Quality 0%

hostnames cookbook

Easy hostname, FQDN and /etc/hosts file updates. Less broken than the hostname recipe.

Works with custom /etc/hosts files and fixes aws dns slowness (use use_node_ip: true)

Install it

With berkshelf - Berskfile

source ''
cookbook 'hostnames'


Run via a role - roles/base.rb

name 'base'
description 'Standard Sequoia setup'
  set_fqdn: '*',
  hostname_cookbook: {
    use_node_ip: true


  • node['set_fqdn'] - FQDN to set.

The asterisk character will be replaced with This way,
you can add this to base role:

default_attributes :set_fqdn => '*'

and have node set its FQDN and hostname based on its chef node name
(which is provided on chef-client first run's command line).

  • node['hostname_cookbook']['use_node_ip'] -- when true
    sets the hostname to node["ipaddress"] in /etc/hosts (default: false)

  • node['hostname_cookbook']['hostsfile_ip'] -- IP used in
    /etc/hosts to correctly set FQDN (default:


  • hostnames::default -- will set node's FQDN to value of set_fqdn attribute,
    and hostname to its host part (up to first dot).

  • hostnames::vmware -- sets hostname automatically using vmtoolsd.
    You do not need to set node["set_fqdn"].


  • Fork.

  • Make more awesome.

  • Pull request.

  • I will bump version and run: knife cookbook site share hostnames "Networking" -o ../


(original) Maciej Pasternacki

(current) Nathan

Dependent cookbooks

hostsfile >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Change History


  • #27: Update default recipe to reload only the hostname plugin instead of ohai (Jonathan Serafini)
  • Fixed (and tested) FreeBSD support
  • #17: added support for RedHat & CentOS (Damien Roche, Marta Paciorkowska)
  • added instructions on manual testing with reboot (Marta Paciorkowska)


  • Refresh and fix tests, add Rubocop style checks (Marta Paciorkowska)
  • #16: do not remove existing /etc/hosts entries on, use configurable IP for hostname entry we need to have for ourselves (Jean Mertz, Marta Paciorkowska)


  • Tests: chefspec, test-kitchen
  • Substitute * in set_fqdn with to allow fully automatic FQDN setup.


  • Clean up backup files from release


  • Added change log
  • metadata.rb explicitly states cookbook name (Chulki Lee)
  • New recipe hostname::vmware (tily)
  • Use hostsfile cookbook to manipulate /etc/hosts, use instead of trying to figure out own IP (Guilhem Lettron)


  • Use attribute levels when setting for Chef 11 compatibility (Alan Wilhelm)


  • Syntax fix for compatibility with Ruby 1.9.2

0.0.2 and before

This is prehistory.

Foodcritic Metric

0.3.6 failed this metric

FC007: Ensure recipe dependencies are reflected in cookbook metadata: /tmp/cook/2bb46e2fe57cb4a87ad3c744/hostnames/recipes/vmware.rb:36