diff --git a/website/source/assets/stylesheets/_docs.scss b/website/source/assets/stylesheets/_docs.scss index ed1a598d31..017ea474a0 100755 --- a/website/source/assets/stylesheets/_docs.scss +++ b/website/source/assets/stylesheets/_docs.scss @@ -9,6 +9,7 @@ body.page-sub{ body.layout-atlas, body.layout-aws, body.layout-azure, +body.layout-chef, body.layout-cloudflare, body.layout-cloudstack, body.layout-consul, diff --git a/website/source/docs/providers/chef/index.html.markdown b/website/source/docs/providers/chef/index.html.markdown new file mode 100644 index 0000000000..91bcf99826 --- /dev/null +++ b/website/source/docs/providers/chef/index.html.markdown @@ -0,0 +1,60 @@ +--- +layout: "chef" +page_title: "Provider: Chef" +sidebar_current: "docs-chef-index" +description: |- + Chef is a systems and cloud infrastructure automation framework. +--- + +# Chef Provider + +[Chef](https://www.chef.io/) is a systems and cloud infrastructure automation +framework. The Chef provider allows Terraform to manage various resources +that exist within [Chef Server](http://docs.chef.io/chef_server.html). + +Use the navigation to the left to read about the available resources. + +## Example Usage + +``` +# Configure the Chef provider +provider "chef" { + "server_url" = "https://api.opscode.com/organizations/example/" + + // You can set up a "Client" within the Chef Server management console. + "client_name" = "terraform" + "private_key_pem" = "${file(\"chef-terraform.pem\")}" +} + +# Create a Chef Environment +resource "chef_environment" "production" { + name = "production" +} + +# Create a Chef Role +resource "chef_role" "app_server" { + name = "app_server" + run_list = [ + "recipe[terraform]" + ] +} +``` + +## Argument Reference + +The following arguments are supported: + +* `server_url` - (Required) The HTTP(S) API URL of the Chef server to use. If + the target Chef server supports organizations, use the full URL of the + organization you wish to configure. May be provided instead via the + ``CHEF_SERVER_URL`` environment variable. +* `client_name` - (Required) The name of the client account to use when making + requests. This must have been already configured on the Chef server. + May be provided instead via the ``CHEF_CLIENT_NAME`` environment variable. +* `private_key_pem` - (Required) The PEM-formatted private key belonging to + the configured client. This is issued by the server when a new client object + is created. May be provided instead in a file whose path is in the + ``CHEF_PRIVATE_KEY_FILE`` environment variable. +* `allow_unverified_ssl` - (Optional) Boolean indicating whether to make + requests to a Chef server whose SSL certicate cannot be verified. Defaults + to ``false``. diff --git a/website/source/docs/providers/chef/r/data_bag.html.markdown b/website/source/docs/providers/chef/r/data_bag.html.markdown new file mode 100644 index 0000000000..6df60d84f5 --- /dev/null +++ b/website/source/docs/providers/chef/r/data_bag.html.markdown @@ -0,0 +1,38 @@ +--- +layout: "chef" +page_title: "Chef: chef_data_bag" +sidebar_current: "docs-chef-resource-data-bag" +description: |- + Creates and manages a data bag in Chef Server. +--- + +# chef\_data\_bag + +A [data bag](http://docs.chef.io/data_bags.html) is a collection of +configuration objects that are stored as JSON in Chef Server and can be +retrieved and used in Chef recipes. + +This resource creates the data bag itself. Inside each data bag is a collection +of items which can be created using the ``chef_data_bag_item`` resource. + +## Example Usage + +``` +resource "chef_data_bag" "example" { + name = "example-data-bag" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) The unique name to assign to the data bag. This is the + name that other server clients will use to find and retrieve data from the + data bag. + +## Attributes Reference + +The following attributes are exported: + +* `api_url` - The URL representing this data bag in the Chef server API. diff --git a/website/source/docs/providers/chef/r/data_bag_item.html.markdown b/website/source/docs/providers/chef/r/data_bag_item.html.markdown new file mode 100644 index 0000000000..2265c16e4f --- /dev/null +++ b/website/source/docs/providers/chef/r/data_bag_item.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "chef" +page_title: "Chef: chef_data_bag_item" +sidebar_current: "docs-chef-resource-data-bag-item" +description: |- + Creates and manages an object within a data bag in Chef Server. +--- + +# chef\_data\_bag\_item + +A [data bag](http://docs.chef.io/data_bags.html) is a collection of +configuration objects that are stored as JSON in Chef Server and can be +retrieved and used in Chef recipes. + +This resource creates objects within an existing data bag. To create the +data bag itself, use the ``chef_data_bag`` resource. + +## Example Usage + +``` +resource "chef_data_bag_item" "example" { + data_bag_name = "example-data-bag" + content_json = < + <% content_for :sidebar do %> + + <% end %> + + <%= yield %> + <% end %> diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index ff088e8e8c..3deb5be98f 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -133,6 +133,10 @@ Azure + > + Chef + + > CloudFlare