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


terraform (24) Versions 2.1.0

Installs Terraform (

cookbook 'terraform', '= 2.1.0', :supermarket
cookbook 'terraform', '= 2.1.0'
knife supermarket install terraform
knife supermarket download terraform
Quality 67%

terraform Cookbook

Installs Terraform by HashiCorp.

Terraform is an open source tool that allows you to
configure entire infrastructure stack as code.


Chef Client

As of version 2.0.0, this cookbook will require minimum chef-client 13


This cookbook depends on the ark cookbook
to unpackage and install terraform.

** GPG **
As of this writing (5/24/18), the community gpg cookbook that is released in Supermarket was transferred to the sous-chef group for ownership. However, the features that this cookbook relies on is not yet published. Therefore, if you run this cookbook, be sure to use berkshelf to ensure that the correct cookbook dependencies are uploaded to your chef org.

If you see the error below, it is a result of using the published 0.3.0 version of gpg from and not the github referenced commit.

Recipe Compile Error in /tmp/kitchen/cache/cookbooks/terraform/recipes/default.rb

undefined method `gpg_install' for cookbook: terraform, recipe: gpgme :Chef::Recipe

Cookbook Trace:
  /tmp/kitchen/cache/cookbooks/terraform/recipes/gpgme.rb:34:in `from_file'
  /tmp/kitchen/cache/cookbooks/terraform/recipes/default.rb:23:in `from_file'

Relevant File Content:

 34>> gpg_install 'gnupg2 and haveged'

This cookbook's Berksfile contains this reference to the current version of gpg in github:

cookbook 'gpg', git: '',
ref: '2f682a1406047e99351d184fe18fff035a0c856c'


The following platforms are supported and have been tested under
Test Kitchen:

  • CentOS 6.9
  • CentOS 7.4
  • Debian 8.6
  • Fedora 27
  • Ubuntu 16.04
  • Ubuntu 18.04

Other versions of these OSs should work. Alternative Debian and RHEL
family distributions are also assumed to work. Please report
any additional platforms you have tested so they can be added.

** Note for Debian:
dayne has found that this cookbook may not converge on Debian platforms. This can be fixed by doing running apt update, and then it will converge. This workaround has been applied to Test Kitchen by invoking the terraform_test::ubuntu recipe.


Simply include recipe[terraform] in your run_list to have
Terraform installed. If you are using an artifact repository, like Nexus, hosted behind your corporate firewall, you must set the default attribute or override attributes in your roles or environments. The attributes are detailed velow.



Installs Terraform from official pre-compiled binaries and gnupg with the gpgme recipe, below.


Installs gnupg2 and haveged to ensure the checksums file from HashiCorp can be trusted. This recipe is included when the default recipe is added to your node's run list.



If you are using an artifact repository, like Nexus, hosted behind your corporate firewall, you must set the default attribute or override attributes in your roles or environments.



The version of Terraform that will be installed (Default: 0.11.7)


As of v0.4.1, checksums are processed dynamically. There is no longer a need to specify the sha256 checksums of each terraform package in a cookbook attribute manually

_As of v1.0.0, the checksum file will have its gpg signature verified. If the gpg signature is rejected, the chef run will fail.

NOTE: All other attributes are considered internal and shouldn't
normally need to be changed.

Example setting default_attributes in a role (JSON file):

  "name": "terraform_workstation",
  "description": "Role to apply onto a terraform workstation",
  "json_class": "Chef::Role",
  "default_attributes": {
    "terraform": {
      "url_base": "",
      "version": "0.11.7"
  "override_attributes": {},
  "run_list": [



This cookbook, especially the checksum stuff in
attributes file has been influenced by the Packer

License and Author

Author:: Ross Timson

Contributor:: Dang Nguyen

Copyright 2014, Ross Timson

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.

Dependent cookbooks

ark ~> 3.1
gpg ~> 0.3

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

terraform Cookbook CHANGELOG


  • Added
  • Added
  • Removed helper methods obsoleted by gpg cookbook:
    • #import_gpg_key
    • #key_imported?
  • #sig_verified? aliased to #signature_trustworthy
  • raises an exception if the checksums file signature is invalid
  • ensure gnupg2 is installed using the gpg_install resource from the gpg cookbook
  • Removed gpgme gem dependency
  • Removed explicit build-essential cookbook dependency from metadta
    • ark lists build-essential as a dependency
  • Expanded chefspec coverage to 100% and added shared_examples


  • Fixed Debian and centos 7 vagrant test images
  • Fixed #28 bumped ark dependency to ~> 3.1
  • Fixed #29 run GPG-related procedures at converge time instead of compile time


  • Now requires Chef 13 or newer
  • Use vagrant images hosted at
  • Added testing with Chef 13 and 14
  • Ported minitests to Inspec
  • Changed default terraform version to 0.11.7


  • (Grasshopper): updated build-essential version dependency


  • update to handle new host folder structure at terraform
  • updated to use fedora-25 image during testing
  • updated to use debian 8.6 image during testing
  • replaced ubuntu 16.04 vagrant image with ubuntu 16.10 image
  • added ubuntu 15.10 vagrant image
  • use chef_gem assertion of gpgme gem in minitest instead of gem_package
  • removed windows config from Test Kitchen
  • official testing of Windows platform removed (never worked before, anyway)


  • update ark dependency: ~> 2.0 (Now requires Chef 12.5+)
  • update bundler gems
  • added winrm transport gems: requires vagrant-winrm Vagrant plugin. Please install this plugin with: `vagrant plugin install vagrant-winrm'
  • Set default terraform version to 0.8.2
  • Added recipe: terraform::gpgme to install gpgme
  • Added helper method, #sig_verified? that will verify the gpg signature of the checksum file and abort if the signature is rejected.


redeploy to supermarket with --extended-metadata option



  • Documentation update


  • Update terraform to 0.6.16
  • Update ark dependency to '~> 1.1.0'


  • added chefspec tests
  • added more test platforms in Test Kitchen
  • Merged PR #16 that resolves derived attribute issue


  • Patch a bug introduced by v0.4.2 where the URI.join truncated any path from the URI base. This resulted in GET requests that were missing whatever path was included in the URL base, such as "/terraform"


  • Remove extraneous slashes from Terraform's SHA256SUMS URL that give 403 Forbidden


  • cleaned up the fetch_checksums helper method
  • set the default['terraform']['checksums'] and default['terraform']['checksum'] attributes in the default recipe




  • Buump Terraform to latest version (0.6.11) (@thegreenrobot)




  • Update to Terraform 0.5.1 (@wilb)
  • Fixing rsync trailing slash issue. (@dquiles)


  • Update to Terraform 0.3.1 (@cantenesse)
  • Kills hard dependency on Ark cookbook (@cantenesse)


  • Initial release.

Collaborator Number Metric

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

2.1.0 passed this metric

Foodcritic Metric

2.1.0 passed this metric

No Binaries Metric

2.1.0 failed this metric

Failure: Cookbook should not contain binaries. Found:

Testing File Metric

2.1.0 passed this metric

Version Tag Metric

2.1.0 passed this metric