项目作者: andreykaipov

项目描述 :
A Chef Solo provisioner for Terraform, inspired by the Packer one
高级语言: Go
项目地址: git://github.com/andreykaipov/terraform-provisioner-chef-solo.git
创建时间: 2018-09-09T02:04:27Z
项目社区:https://github.com/andreykaipov/terraform-provisioner-chef-solo

开源协议:Mozilla Public License 2.0

下载


terraform-provisioner-chef-solo

This is a Terraform provisioner plugin for Chef Solo. It lets us
provision instances with Chef Solo in our Terraform scripts:

  1. resource "aws_instance" "web" {
  2. # ...
  3. provisioner "chef-solo" {
  4. cookbook_paths = ["cookbooks"]
  5. run_list = ["book::recipe"]
  6. json = <<-EOF
  7. {
  8. "a": "b",
  9. "c": "d"
  10. }
  11. EOF
  12. }
  13. }

It’s inspired by the similar Packer provisioner for
Chef Solo
, so if you’re
familiar with that one, then you’ll be familiar with this one!

Usage

To use this provisioner, first download the zipped binary for your system from
the releases
page and unzip it. Alternatively, you can build it yourself (see below).

Terraform searches for plugins within the same directory as itself, so
you’ll have to move this binary into that directory. If you’re using an older
version of Terraform, you’ll also have to rename the plugin to not include the
version information at the end of the name.

Documentation for the plugin is here.

Building

However you put Go projects into your GOPATH (whether it’s with go get or
just manually cloning and moving it), do that for this project.

Since this is a plugin for Terraform, you need to have the Terraform source in
your GOPATH too. If you don’t, run a go get -v ./... from the root of this repo.

Here’s an example:

  1. $ go get github.com/andreykaipov/terraform-provisioner-chef-solo
  2. $ cd $GOPATH/src/github.com/andreykaipov/terraform-provisioner-chef-solo
  3. $ make build

You should now have the plugin in the bin/ directory.