github.com/hobbeswalsh/terraform@v0.3.7-0.20150619183303-ad17cf55a0fa/website/source/docs/provisioners/chef.html.markdown (about) 1 --- 2 layout: "docs" 3 page_title: "Provisioner: chef" 4 sidebar_current: "docs-provisioners-chef" 5 description: |- 6 The `chef` provisioner invokes a Chef Client run on a remote resource after first installing and configuring Chef Client on the remote resource. The `chef` provisioner supports both `ssh` and `winrm` type connections. 7 --- 8 9 # Chef Provisioner 10 11 The `chef` provisioner invokes a Chef Client run on a remote resource after first installing 12 and configuring Chef Client on the remote resource. The `chef` provisioner supports both `ssh` 13 and `winrm` type [connections](/docs/provisioners/connection.html). 14 15 ## Requirements 16 17 In order for the `chef` provisioner to work properly, you need either `cURL` (when using 18 a `ssh` type connection) or `PowerShell 2.0` (when using a `winrm` type connection) to be 19 available on the target machine. 20 21 ## Example usage 22 23 ``` 24 # Start a initial chef run on a resource 25 resource "aws_instance" "web" { 26 ... 27 provisioner "chef" { 28 attributes { 29 "key" = "value" 30 "app" { 31 "cluster1" { 32 "nodes" = ["webserver1", "webserver2"] 33 } 34 } 35 } 36 environment = "_default" 37 run_list = ["cookbook::recipe"] 38 node_name = "webserver1" 39 server_url = "https://chef.company.com/organizations/org1" 40 validation_client_name = "chef-validator" 41 validation_key_path = "../chef-validator.pem" 42 version = "11.18.6" 43 } 44 } 45 ``` 46 47 ## Argument Reference 48 49 The following arguments are supported: 50 51 * `attributes (map)` - (Optional) A map with initial node attributes for the new node. 52 See example. 53 54 * `environment (string)` - (Optional) The Chef environment the new node will be joining 55 (defaults `_default`). 56 57 * `log_to_file (boolean)` - (Optional) If true, the output of the initial Chef Client run 58 will be logged to a local file instead of the console. The file will be created in a 59 subdirectory called `logfiles` created in your current directory. The filename will be 60 the `node_name` of the new node. 61 62 * `http_proxy (string)` - (Optional) The proxy server for Chef Client HTTP connections. 63 64 * `https_proxy (string)` - (Optional) The proxy server for Chef Client HTTPS connections. 65 66 * `no_proxy (array)` - (Optional) A list of URLs that should bypass the proxy. 67 68 * `node_name (string)` - (Required) The name of the node to register with the Chef Server. 69 70 * `prevent_sudo (boolean)` - (Optional) Prevent the use of sudo while installing, configuring 71 and running the initial Chef Client run. This option is only used with `ssh` type 72 [connections](/docs/provisioners/connection.html). 73 74 * `run_list (array)` - (Required) A list with recipes that will be invoked during the initial 75 Chef Client run. The run-list will also be saved to the Chef Server after a successful 76 initial run. 77 78 * `server_url (string)` - (Required) The URL to the Chef server. This includes the path to 79 the organization. See the example. 80 81 * `skip_install (boolean)` - (Optional) Skip the installation of Chef Client on the remote 82 machine. This assumes Chef Client is already installed when you run the `chef` 83 provisioner. 84 85 * `ssl_verify_mode (string)` - (Optional) Use to set the verify mode for Chef Client HTTPS 86 requests. 87 88 * `validation_client_name (string)` - (Required) The name of the validation client to use 89 for the initial communication with the Chef Server. 90 91 * `validation_key_path (string)` - (Required) The path to the validation key that is needed 92 by the node to register itself with the Chef Server. The key will be uploaded to the remote 93 machine. 94 95 * `version (string)` - (Optional) The Chef Client version to install on the remote machine. 96 If not set the latest available version will be installed.