cookbook 'terraform', '= 1.0.2'
terraform
(24) Versions
1.0.2
-
Follow6
Installs Terraform (terraform.io)
cookbook 'terraform', '= 1.0.2', :supermarket
knife supermarket install terraform
knife supermarket download terraform
terraform Cookbook
Installs Terraform by Mitchell Hashimoto
(@mitchellh).
Terraform is an open source tool that allows you to
configure entire infrastructure stack as code.
Requirements
Cookbooks
This cookbook depends on the ark cookbook
and build-essential.
Platforms
The following platforms are supported and have been tested under
Test Kitchen:
- CentOS 6.7
- CentOS 7.2
- Debian 8.6
- Fedora 25
- Ubuntu 14.04
- Ubuntu 15.10
- Ubuntu 16.10
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.
Usage
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.
Recipes
default
Installs Terraform from official pre-compiled binaries.
gpgme
Installs ruby-gpgme gem
Attributes
node['terraform']['url_base']
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.
Default: https://releases.hashicorp.com/terraform
node['terraform']['version']
The version of Terraform that will be installed (Default: 0.8.2)
node['terraform']['checksum']
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": "https://nexus.internal.com/nexus", "version": "0.8.2" } }, "override_attributes": {}, "run_list": [ "recipe[terraform]" ] }
Development
- Source hosted at GitHub
- Report issues/questions/feature requests on GitHub Issues
Contributing
Pull requests are very welcome! Ideally create a topic branch for every
separate change you make.
This cookbook uses ChefSpec for unit tests. I also use Food
Critic and RuboCop to check for style issues.
When contributing it would be very helpful if you could run these via
bundle exec spec
and bundle exec style
.
Lastly, there are Serverspec integration tests for
use with Test Kitchen. To see all of the available
integration test suites just check bundle exec rake T
or bundle exec
. It would be great if you could run these tests too, you
kitchen list
may however leave out the Amazon Linux test suite if you do not have
an AWS account as it runs on an EC2 instance (you will be billed for
running this).
Credit
This cookbook, especially the checksum stuff in
attributes file has been influenced by the Packer
cookbook by
@sit.
License and Author
Author:: Ross Timson
<ross@rosstimson.com>
Contributor:: Dang Nguyen
<haidangwa@gmail.com>
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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Dependent cookbooks
ark ~> 2.0 |
build-essential ~> 8.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
terraform Cookbook CHANGELOG
1.0.2
- (Grasshopper): updated build-essential version dependency
1.0.1
- 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)
1.0.0
- 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.
0.5.3
redeploy to supermarket with --extended-metadata option
0.5.2
- no code changes: merged https://github.com/rosstimson/chef-terraform/pull/22
0.5.1
- Documentation update
0.5.0
- Update terraform to 0.6.16
- Update ark dependency to '~> 1.1.0'
0.4.4
- added chefspec tests
- added more test platforms in Test Kitchen
- Merged PR #16 that resolves derived attribute issue
0.4.3
- 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"
0.4.2
- Remove extraneous slashes from Terraform's SHA256SUMS URL that give 403 Forbidden
0.4.1
- cleaned up the fetch_checksums helper method
- set the default['terraform']['checksums'] and default['terraform']['checksum'] attributes in the default recipe
0.4.0
- Add helper methods: raw_checksums_to_hash, fetch_checksums, terraform_url
- Fixed Issue #10(https://github.com/rosstimson/chef-terraform/issues/10)
0.3.0
- Fixed rubocop offenses
- updated serverspec to test against Terraform 0.6.11 install paths
- Added minitest handler dependency for Test Kitchen runs
- Added minitest test suites
- Fixed Issue #11(https://github.com/rosstimson/chef-terraform/issues/11)
0.2.1
- Buump Terraform to latest version (0.6.11) (@thegreenrobot)
0.2.0
- Fixed Issue #6(https://github.com/rosstimson/chef-terraform/issues/6) set the terraform zip file name in a node attribute (@haidangwa)
- Updated the default version to 0.6.8
- Fixed the download link as no longer using Bintray
- Windows support (@ridiculousness)
0.1.3
- Fixed Issue #6(https://github.com/rosstimson/chef-terraform/issues/6) set the terraform zip file name in a node attribute
- updated the default version to 0.6.7
0.1.2
- Update to Terraform 0.5.1 (@wilb)
- Fixing rsync trailing slash issue. (@dquiles)
0.1.1
- Update to Terraform 0.3.1 (@cantenesse)
- Kills hard dependency on Ark cookbook (@cantenesse)
0.1.0
- Initial release.
Collaborator Number Metric
1.0.2 failed this metric
Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.0.2 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 https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.0.2 failed this metric
FC122: Use the build_essential resource instead of the recipe: terraform/recipes/gpgme.rb:23
Run with Foodcritic Version 13.1.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.2 failed this metric
Failure: Cookbook should not contain binaries. Found:
terraform/files/default/hashicorp.asc
Testing File Metric
1.0.2 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.2 passed this metric
1.0.2 failed this metric
1.0.2 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 https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.0.2 failed this metric
FC122: Use the build_essential resource instead of the recipe: terraform/recipes/gpgme.rb:23
Run with Foodcritic Version 13.1.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.2 failed this metric
Failure: Cookbook should not contain binaries. Found:
terraform/files/default/hashicorp.asc
Testing File Metric
1.0.2 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.2 passed this metric
1.0.2 failed this metric
Run with Foodcritic Version 13.1.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
1.0.2 failed this metric
Failure: Cookbook should not contain binaries. Found:
terraform/files/default/hashicorp.asc
Testing File Metric
1.0.2 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.2 passed this metric
1.0.2 failed this metric
1.0.2 passed this metric