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

The habitat cookbook has been deprecated

Author provided reason for deprecation:

The habitat cookbook has been deprecated and is no longer being maintained by its authors. Use of the habitat cookbook is no longer recommended.


habitat (74) Versions 0.74.0

Habitat related resources for chef-client

cookbook 'habitat', '= 0.74.0', :supermarket
cookbook 'habitat', '= 0.74.0'
knife supermarket install habitat
knife supermarket download habitat
Quality 100%

Habitat Cookbook

Build Status Cookbook Version

This cookbook provides resources for working with Habitat. It is intended that these resources will be included in core Chef at some point in the future, so it is important to note:

  • APIs are subject to change
  • Habitat is a rapidly changing product, and this cookbook may change rapidly as well

(this is a pre-1.0 version, after all)



  • RHEL 6+
  • Ubuntu 14.04+
  • Debian 7+
  • Windows 2016


  • Habitat version: 0.73.0

This cookbook is developed lockstep with the latest release of Habitat to ensure compatibility, going forward from 0.33.0 of the cookbook and 0.33.2 of Habitat itself. When new versions of Habitat are released, the version should be updated in these files:

  • note required version in this file
  • resources/install.rb: set the default to the new version
  • test/integration/install/default_spec.rb: to match the version from the resource

Additionally, new versions must be tested that all behavior in the cookbook still works, otherwise the cookbook must be updated to match the behavior in the new version of Habitat.

Users who wish to install a specific version of Habitat should use an older (0.28 or earlier) release of this cookbook, but note that is unsupported and they are advised to upgrade ASAP.


  • Chef 12.20.3+


  • None



Installs Habitat on the system using the install script.


  • install: Installs Habitat. Does nothing if the hab binary is found in the default location for the system (/bin/hab on Linux, /usr/local/bin/hab on macOS, C:/habitat/hab.exe on Windows)
  • upgrade: Installs the latest version of Habitat, does not check if the binary exists


  • install_url: URL to the install script, default is from the habitat repo
  • bldr_url: Optional URL to an alternate Builder (defaults to the public Builder)
  • create_user: Creates the hab system user (defaults to true)
  • tmp_dir: Sets TMPDIR environment variable for location to place temp files. (required if /tmp and /var/tmp are mounted noexec)


Nameless installation


Instalaltion specifying a bldr URL

hab_install 'install habitat' do
  bldr_url 'http://localhost'


Install the specified Habitat package from builder. Requires that Habitat is installed


  • install: installs the specified package
  • upgrade: installs the specified package. If a newer version is available in the configured channel, upgrades to that version


  • package_name: A Habitat package name, must include the origin and package name separated by /, for example, core/redis
  • version: A Habitat version which contains the version and optionally a release separated by /, for example, 3.2.3 or 3.2.3/20160920131015
  • bldr_url: The habitat builder url where packages will be downloaded from (defaults to public habitat builder)
  • channel: The release channel to install from (defaults to stable)
  • auth_token: Auth token for installing a package from a private organization on builder
  • binlink: If habitat should attempt to binlink the package. Acceptable values: true, false, :force. Will faill on binlinking if set to true and binary or binlink exists.
  • options: Pass any additional parameters to the habitat install command.

While it is valid to pass the version and release with a Habitat package as a fully qualified package identifier when using the hab CLI, they must be specified using the version property when using this resource. See the examples below.


hab_package 'core/redis'

hab_package 'core/redis' do
  version '3.2.3'
  channel 'unstable'

hab_package 'core/redis' do
  version '3.2.3/20160920131015'

hab_package 'core/nginx' do
  binlink :force

hab_package 'core/nginx' do
  options '--binlink'


Manages a Habitat application service using hab sup/hab service. This requires that core/hab-sup be running as a service. See the hab_sup resource documentation below for more information about how to set that up with this cookbook.

Note: Applications may run as a specific user. Often with Habitat, the default is hab, or root. If the application requires another user, then it should be created with Chef's user resource.


  • :load: (default action) runs hab service load to load and start the specified application service
  • :unload: runs hab service unload to unload and stop the specified application service
  • :reload: runs the :unload and then :load actions
  • :start: runs hab service start to start the specified application service
  • :stop: runs hab service stop to stop the specified application service
  • :restart: runs the :stop and then :start actions


The remote_sup property is valid for all actions.

  • remote_sup: Address to a remote Supervisor's Control Gateway [default:]
  • remote_sup_http: Address for remote supervisor http port. Used to pull existing configuration data. If this is invalid, config will be applied on every Chef run.

The follow properties are valid for the load action.

  • service_name: name property, the name of the service, must be in the form of origin/name
  • loaded: state property indicating whether the service is loaded in the supervisor
  • running: state property indicating whether the service is running in the supervisor
  • strategy: Passes --strategy with the specified update strategy to the hab command
  • topology: Passes --topology with the specified service topology to the hab command
  • bldr_url: Passes --url with the specified Builder URL to the hab command.
  • channel: Passes --channel with the specified channel to the hab command
  • bind: Passes --bind with the specified services to bind to the hab command. If an array of multiple service binds are specified then a --bind flag is added for each.
  • binding_mode: Passes --binding-mode with the specified binding mode. Defaults to :strict. Options are :strict or :relaxed
  • service_group: Passes --group with the specified service group to the hab command


# install and load nginx
hab_package 'core/nginx'
hab_service 'core/nginx'

hab_service 'core/nginx unload' do
  service_name 'core/nginx'
  action :unload

# pass the strategy and topology options to hab service commands (load by default)
hab_service 'core/redis' do
  strategy 'rolling'
  topology 'standalone'

If the service has it's own user specified that is not the hab user, don't create the hab user on install, and instead create the application user with Chef's user resource

hab_install 'install habitat' do
  create_user false

user 'acme-apps' do
  system true

hab_service 'acme/apps'


Runs a Habitat Supervisor for one or more Habitat Services. It is used in conjunction with hab_service which will manage the services loaded and started within the supervisor.

The run action handles installing Habitat using the hab_install resource, ensures that the appropriate versions of the core/hab-sup and core/hab-launcher packages are installed using hab_package, and then drops off the appropriate init system definitions and manages the service.


  • run: starts the hab-sup service


  • bldr_url: The Builder URL for the hab_package resource, if needed
  • permanent_peer: Only valid for :run action, passes --permanent-peer to the hab command
  • listen_ctl: Only valid for :run action, passes --listen-ctl with the specified address and port, e.g.,, to the hab command
  • listen_gossip: Only valid for :run action, passes --listen-gossip with the specified address and port, e.g.,, to the hab command
  • listen_http: Only valid for :run action, passes --listen-http with the specified address and port, e.g.,, to the hab command
  • org: Only valid for :run action, passes --org with the specified org name to the hab command
  • peer: Only valid for :run action, passes --peer with the specified initial peer to the hab command
  • ring: Only valid for :run action, passes --ring with the specified ring key name to the hab command
  • hab_channel: The channel to install Habitat from. Defaults to stable
  • auth_token: Auth token for accessing a private organization on bldr. This value is templated into the appropriate service file.


# set up with just the defaults
hab_sup 'default'

hab_sup 'test-options' do
  listen_http ''
  listen_gossip ''
# Use with an on-prem Builder
# Access to public builder may not be available
hab_sup 'default' do
  bldr_url ''


Applies a given configuration to a habitat service using hab config apply.


  • apply: (default action) apply the given configuration


  • service_group: The service group to apply the configuration to, for example, nginx.default
  • config: The configuration to apply as a ruby hash, for example, { worker_count: 2, http: { keepalive_timeout: 120 } }
  • remote_sup: Address to a remote Supervisor's Control Gateway [default:]
  • remote_sup_http: Address for remote supervisor http port. Used to pull existing configuration data. If this is invalid, config will be applied on every Chef run.
  • user: Name of user key to use for encryption. Passes --user to hab config apply


The version number of the configuration is automatically generated and will be the current timestamp in seconds since 1970-01-01 00:00:00 UTC.


hab_config 'nginx.default' do
    worker_count: 2,
    http: {
      keepalive_timeout: 120


Templates a user.toml for the specified service. This is written to /hab/user/<service_name>/config/user.toml. User.toml can be used to set configuration overriding the default.toml for a given package as an alternative to applying service group level configuration.


  • create: (default action) Create the user.toml from the specified config.
  • delete: Delete the user.toml


  • service_name: The service group to apply the configuration to, for example, nginx.default
  • config: Only valid for :create action. The configuration to apply as a ruby hash, for example, { worker_count: 2, http: { keepalive_timeout: 120 } }


hab_user_toml 'nginx' do
    worker_count: 2,
    http: {
      keepalive_timeout: 120


This cookbook is maintained by the following maintainers:

The goal of the Community Cookbook Engineering team is to improve cookbook quality and to aid the community in contributing to cookbooks. To learn more about our team, process, and design goals see our team documentation. To learn more about contributing to cookbooks like this see our contributing documentation, or if you have general questions about this cookbook come chat with us in #cookbok-engineering on the Chef Community Slack


Copyright: 2016-2018, Chef Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.


This file is used to list changes made in each version of the habitat cookbook.


Merged Pull Requests

  • Fix expeditor automation and bump to 0.74.0 #160 (jonlives)

    0.74.0 (2019-02-14)

  • Update to habitat 0.74.0

0.73.1 (2019-01-30)

  • remove duplicate windows query param

Merged Pull Requests

0.73.0 (2019-01-25)

  • Update Hab to 0.73.0 and launcher to 9167
  • Add binlinking support to hab_package resource
  • Support target architectures correctly in API queries
  • Improved Windows support

Merged Pull Requests

0.67.0 (2018-11-01)

  • Update README with accurate maintainer info
  • bug fixes for windows on newer chef versions and path seperators
  • Update to habitat 0.67.0 (#146)

0.63.0 (2018-09-18)

  • Update to habitat 0.63.0

0.62.1 (2018-09-07)

  • Update hab version to 0.62.1 and pin supervisor version to 8380
  • Refactor cookbook resources for 0.62.1 compatibility
  • Add user_toml resource
  • Add remote supervisor support
  • Add multiple peer support
  • Add auth token support to package resource
  • Add basic support for Windows

Merged Pull Requests

0.59.0 (2018-07-17)

  • Update README to reflect new version of Hab
  • address chef 14.3.x shell_out deprecations
  • fix shell_out_compact deprecation
  • move to after tempfile creation
  • Update with details from pull request #111
  • Use the new kitchen config file names
  • Cookstyle fixes

Merged Pull Requests

0.57.0 (2018-06-19)

  • Fix #103
  • Add @jonlives as a maintainer
  • Source helper functions script

Merged Pull Requests

0.56.1 (2018-06-06)

  • Support passing TMPDIR attribute to Habitat script. Addresses Issue #90
  • Add: bldr_url property for hab_sup
  • Fix hab_svc when using custom ip:port for supervisor
  • Include toml in the bundle
  • Update with details from pull request #96

Merged Pull Requests

0.56.0 (2018-06-05)

  • Update for 0.56.0
  • Cookstyle fix
  • Disable FC113 for now
  • Update the platforms we test
  • Update with details from pull request #97

0.55.0 (2018-03-22)

  • Adding ability to use local repos
  • Add expeditor configuration
  • update for 0.55.0

0.54.0 (2018-02-22)

  • Add auto_update property to hab_sup resource.
  • update for 0.54.0 release

0.53.0 (2018-02-07)

  • Set supervisor service to enable
  • Remove the legacy version property
  • Update copyrights and format
  • Test on the latest Fedora
  • Remove the suite from dokken.
  • Move installation into config and package
  • Use a non-deprecated Fauxhai mock
  • Remove author info from the test recipe
  • Remove the install test recipe
  • Remove the ChefSpec matchers
  • Make sure package and curl are installed in the install resource
  • Add Debian 7+ to the readme as supported
  • Allow nameless hab_install resource
  • Turns out we don't even need to install before installing the sup
  • Update the hab_install readme examples
  • update to habitat 0.53.0

0.52.0 (2018-01-23)

  • Remove Debian 7 testing
  • Remove stove gem that's in ChefDK now
  • Align Chef in readme with Chef in metadata
  • Format readme markdown
  • Remove implementation detail
  • Actions are symbols so document them that way
  • Remove reference to old Hab since we require the latest now
  • update to habitat 0.52.0

0.51.0 (2018-01-08)

  • Update for Habitat version 0.51.0

0.50.3 (2017-12-04)

  • Update for Habitat version 0.50.3

0.40.0 (2017-11-30)

  • Update for Habitat version 0.40.0

0.39.2 (2017-11-28)

  • Add Supervisor service support for non-Systemd platforms

Development environment/CI changes:

  • need to install toml gem for travis
  • Ignore failure when installing from acceptance

0.39.1 (2017-11-27)

  • update for 0.39.1
  • fix rubocop findings too

0.39.0 (2017-11-17)

  • Install version 0.39.0
  • Defer running check to a predicate method in service resource

0.38.0 (2017-10-30)

  • update version to install for habitat 0.38.0

0.37.1 (2017-10-26)

  • create user in hab_install

0.37.0 (2017-10-19)

  • update for habitat 0.37.0 release

0.36.0 (2017-10-09)

  • Simplify Chef::Provider::Package::Hart#current_versions.
  • honor options from package provider
  • update for habitat 0.36.0

0.34.3 (2017-10-06)

  • Clarify in the README about action-specific properties

0.34.2 (2017-10-06)

  • Add hab_config resource
  • Add toml gem to metadata for older versions of Chef that don't have it
  • Require Chef 12.20.3 or higher to make use of helper methods and classes in newer versions of Chef

0.34.1 (2017-10-04)

  • Add version_compare method to work with latest Chef

0.34.0 (2017-10-03)

  • Update hab_install to Habitat version 0.34.1

0.33.0 (2017-09-25)

Breaking change

This version is a compatibility change. All users of this cookbook must upgrade the cookbook to use current versions of Habitat.

  • Fix to account for habitat-sh/habitat#3239 - do not provide /v1/depot to Depot URL.
  • Pin the version of this cookbook along with the version of Habitat we install. This should match minor, but not necessarily patch versions.

0.28.0 (2017-09-19)

  • Add channel support to sup load/start

0.27.0 (2017-09-11)

  • Add hab_version and hab_channel to the sup service
  • Support multiple binds with hab_service

0.26.1 (2017-07-21)

  • hab_package now properly selects latest version from the specified channel.

0.26.0 (2017-07-17)

Breaking Changes

This cookbook was updated to be compatible with the changes made in Habitat 0.26. With these updates the cookbook now requires Habitat 0.26 or later. The version has been updated to match that of habitat. In the event of future breaking habitat changes the version of this cookbook will be updated to reflect the new minimum habitat release.
- The cookbook now correctly parses the process status returned by the hab sup services endpoint
- Packages now pull from the 'stable' channel by default. If you need to pull from another channel there is a new 'channel' property in the package resource that accepts a string.

Other Changes

  • Resolves deprecation warnings introduced in Chef 13.2
  • Removed references in the readme to Chefstyle and simplified some of the requirements information
  • Added maintainer information to the readme and removed the maintainers file

v0.4.0 (2017-04-26)

  • Backwards incompatible version, requires habitat 0.20 or higher
  • Add hab_sup resource for managing Habitat supervisor. See readme for usage.
  • Rewrite hab_service resource to manage services in Habitat supervisor

v0.3.0 (2017-02-21)

  • Add property for ExecStart options. See readme for usage
  • Add property for depot_url. See readme for usage
  • Added restart action to the resource

v0.2.0 (2016-11-30)

  • Added version and channel properties to install resource
  • Added depot_url property to hab_package resource

v0.1.1 (2016-11-10)

  • Removed Chef 11 compatibility in the metadata
  • Resolved Chefstyle warnings
  • Resolved foodcritic warnings
  • Added a chefignore file
  • Updated the gitignore file
  • Improve the readme format and add badges
  • Update all test deps to current
  • Remove the apt testing dependency
  • Add integration testing in Travis using kitchen-dokken

v0.1.0 (2016-11-08)

  • add hab_service resource
  • make the hab_package resource convergent
  • add chefspec and inspec tests
  • better documentation through README updates

v0.0.3 (2016-07-14)

  • Initial release, includes hab_package and hab_install resources

Collaborator Number Metric

0.74.0 passed this metric

Contributing File Metric

0.74.0 passed this metric

Foodcritic Metric

0.74.0 passed this metric

No Binaries Metric

0.74.0 passed this metric

Testing File Metric

0.74.0 passed this metric

Version Tag Metric

0.74.0 passed this metric