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


consul-platform (2) Versions 1.1.0

Install and Configure a Consul cluster

cookbook 'consul-platform', '~> 1.1.0'
cookbook 'consul-platform', '~> 1.1.0', :supermarket
knife cookbook site install consul-platform
knife cookbook site download consul-platform
Quality 56%

Consul Platform


Consul is a completely distributed, highly available, and datacenter aware solution for service discovery.


Cookbooks and gems

Declared in metadata.rb and in Gemfile.


A systemd managed distribution: - RHEL Family 7, tested on Centos


Easy Setup

Set node['consul-platform']['hosts'] to an array containing the hostnames of the server nodes of the consul cluster and add the default recipe to all nodes.

The recommended way to use this cookbook is through the creation of a role per consul cluster. This enables the search by role feature, allowing a simple service discovery.

In fact, there are two ways to configure the search:

  1. With a static configuration through a list of hostnames (attributes hosts that is node['consul-platform']['hosts']) for servers belonging to consul cluster.
  2. With a real search, performed on a role (attributes role and size like in node['consul-platform']['role']). The role should be in the run-list of all servers of the cluster. The size is a safety and should be the number of nodes of this role.

If hosts is configured, role and size are ignored

See roles for some examples and Cluster Search documentation for more information.


This cookbook is fully tested through the installation of a working 4-nodes cluster in docker hosts. This uses kitchen, docker and some monkey-patching.

For more information, see .kitchen.yml and test directory.


Configuration is done by overriding default attributes. All configuration keys have a default defined in attributes/default.rb. Please read it to have a comprehensive view of what and how you can configure this cookbook behavior.



Include search, user, install, config and systemd recipes.

Search the node (initiator) that will initialize first the consul cluster using Cluster Search.

Other nodes will join the consul cluster after the initiator using its address.


Create user/group used by consul.


Install consul using ark.


Generate configuration files for the consul node. They are generated through the following attribute: node['consul-platform']['config']. Read attributes/default.rb for more information.


Create systemd service file for consul.


Available in


Please read carefully before making a merge request.

License and Author

Copyright (c) 2016-2017 Sam4Mobile, 2017

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.




  • Set default version to 0.8.3
  • Use config file instead of cli options for configuration
  • Handover maintainance to
  • Fix package_retries utilisation (for Chef 13)


  • Use latest template for .gitlab-ci.yml 20170529
  • Fix destroy in CI tests, remove suite order constraint
  • Set build_pull to true (always pull latest images)
  • Add a client with its tests, remame nodes, move config from role
  • Reduce max wait in tests


  • Fix foodcritic offenses in metadata
  • Fix misc rubocop offenses (mostly %i stuff)
  • Simplify tests and adapt them to 0.8.3, remove deprecated RPC service


  • Initial version working with consul 0.7.2.

Collaborator Number Metric

1.1.0 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric

1.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

1.1.0 passed this metric

License Metric

1.1.0 passed this metric

No Binaries Metric

1.1.0 passed this metric

Publish Metric

1.1.0 passed this metric

Supported Platforms Metric

1.1.0 passed this metric

Testing File Metric

1.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

1.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must include a tag that matches this cookbook version number