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


hostsfile (22) Versions 0.1.1

Provides an resource for managing the /etc/hosts file

cookbook 'hostsfile', '= 0.1.1', :supermarket
cookbook 'hostsfile', '= 0.1.1'
knife supermarket install hostsfile
knife supermarket download hostsfile
Quality -%

hostsfile LWRP

hostsfile provides an LWRP for managing your hosts file using Chef.


At this time, you must have a Unix-based machine. This could easily be adapted for Windows machines. Please submit a Pull Request if you wish to add Windows support.


<td>(name attribute) the IP address for the entry</td>
<td>(required) the hostname associated with the entry</td>
<td>array of aliases for the entry</td>
<td>a comment to append to the end of the entry</td>
<td><tt>'interal DNS server'</tt></td>


This LWRP comes equipped with 4 actions:


Creates a new hosts file entry. If an entry already exists, it will be overwritten by this one.

hostsfile_entry '' do
  hostname ''
  action :create

This will create an entry like this:


Create a new hosts file entry, only if one does not already exist for the given IP address. If one exists, this does nothing.

hostsfile_entry '' do
  hostname ''
  action :create_if_missing


Updates the given hosts file entry. Does nothing if the entry does not exist.

hostsfile_entry '' do
  hostname ''
  comment 'Update by Chef'
  action :update

This will create an entry like this:           example # Updated by Chef


Removes an entry from the hosts file. Does nothing if the entry does not

hostsfile_entry '' do
  action :remove

This will remove the entry for


Download or install this cookbook from the community site:

$ knife cookbook site install hostsfile

Then, simply include this recipe and you'll be granted access to this LWPR:

# your_recipe.rb
include_recipe 'hostsfile'


  1. Fork the project
  2. Create a feature branch corresponding to you change
  3. Commit and test thoroughly
  4. Create a Pull Request on github
    • ensure you add a detailed description of your changes

License and Authors

Authors: Seth Vargo (@sethvargo)

Copyright 2012, CustomInk, LLC

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

arcgis-enterprise Applicable Versions
archlinux Applicable Versions
baseserver Applicable Versions
chef_dnsmasq Applicable Versions
cloudbees-cjp-ha Applicable Versions
common_linux Applicable Versions
corosync Applicable Versions
corosync-cookbook Applicable Versions
dirsrv Applicable Versions
foreman Applicable Versions
fqdn Applicable Versions
ganeti Applicable Versions
gemirro Applicable Versions
gotcms Applicable Versions
hostname Applicable Versions
hostname-chef13 Applicable Versions
hostnames Applicable Versions
kagent Applicable Versions
letsencrypt-boulder-server Applicable Versions
lxmx_hostname Applicable Versions
opennms Applicable Versions
pacemaker Applicable Versions
paramount Applicable Versions
postgresql-cluster Applicable Versions
riak-cluster Applicable Versions
server_utils Applicable Versions
singularity Applicable Versions
stackstorm Applicable Versions
supermarket-omnibus-cookbook Applicable Versions
system Applicable Versions
wazuh Applicable Versions
wazuh_agent Applicable Versions
wazuh_manager Applicable Versions
websrv Applicable Versions

No quality metric results found