github.com/leeprovoost/terraform@v0.6.10-0.20160119085442-96f3f76118e7/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          secret_key = "${file("../encrypted_data_bag_secret")}"
    40          server_url = "https://chef.company.com/organizations/org1"
    41          validation_client_name = "chef-validator"
    42          validation_key = "${file("../chef-validator.pem")}"
    43          version = "12.4.1"
    44      }
    45  }
    46  ```
    47  
    48  ## Argument Reference
    49  
    50  The following arguments are supported:
    51  
    52  * `attributes (map)` - (Optional) A map with initial node attributes for the new node.
    53    See example.
    54  
    55  * `client_options (array)` - (Optional) A list of optional Chef Client configuration
    56    options. See the Chef Client [documentation](https://docs.chef.io/config_rb_client.html) for all available options.
    57  
    58  * `disable_reporting (boolean)` - (Optional) If true the Chef Client will not try to send
    59    reporting data (used by Chef Reporting) to the Chef Server (defaults false)
    60  
    61  * `environment (string)` - (Optional) The Chef environment the new node will be joining
    62    (defaults `_default`).
    63  
    64  * `log_to_file (boolean)` - (Optional) If true, the output of the initial Chef Client run
    65    will be logged to a local file instead of the console. The file will be created in a
    66    subdirectory called `logfiles` created in your current directory. The filename will be
    67    the `node_name` of the new node.
    68  
    69  * `http_proxy (string)` - (Optional) The proxy server for Chef Client HTTP connections.
    70  
    71  * `https_proxy (string)` - (Optional) The proxy server for Chef Client HTTPS connections.
    72  
    73  * `no_proxy (array)` - (Optional) A list of URLs that should bypass the proxy.
    74  
    75  * `node_name (string)` - (Required) The name of the node to register with the Chef Server.
    76  
    77  * `ohai_hints (array)` - (Optional) A list with
    78    [Ohai hints](https://docs.chef.io/ohai.html#hints) to upload to the node.
    79  
    80  * `os_type (string)` - (Optional) The OS type of the node. Valid options are: `linux` and
    81    `windows`. If not supplied the connection type will be used to determine the OS type (`ssh`
    82    will assume `linux` and `winrm` will assume `windows`).
    83  
    84  * `prevent_sudo (boolean)` - (Optional) Prevent the use of sudo while installing, configuring
    85    and running the initial Chef Client run. This option is only used with `ssh` type
    86    [connections](/docs/provisioners/connection.html).
    87  
    88  * `run_list (array)` - (Required) A list with recipes that will be invoked during the initial
    89    Chef Client run. The run-list will also be saved to the Chef Server after a successful
    90    initial run.
    91  
    92  * `secret_key (string)` - (Optional) The contents of the secret key that is used
    93    by the client to decrypt data bags on the Chef Server. The key will be uploaded to the remote
    94    machine.  These can be loaded from a file on disk using the [`file()` interpolation
    95    function](/docs/configuration/interpolation.html#file_path_).
    96  
    97  * `server_url (string)` - (Required) The URL to the Chef server. This includes the path to
    98    the organization. See the example.
    99  
   100  * `skip_install (boolean)` - (Optional) Skip the installation of Chef Client on the remote
   101    machine. This assumes Chef Client is already installed when you run the `chef`
   102    provisioner.
   103  
   104  * `ssl_verify_mode (string)` - (Optional) Use to set the verify mode for Chef Client HTTPS
   105    requests.
   106  
   107  * `validation_client_name (string)` - (Required) The name of the validation client to use
   108    for the initial communication with the Chef Server.
   109  
   110  * `validation_key (string)` - (Required) The contents of the validation key that is needed
   111    by the node to register itself with the Chef Server. The key will be uploaded to the remote
   112    machine. These can be loaded from a file on disk using the [`file()`
   113    interpolation function](/docs/configuration/interpolation.html#file_path_).
   114  
   115  * `version (string)` - (Optional) The Chef Client version to install on the remote machine.
   116    If not set the latest available version will be installed.
   117  
   118  These are supported for backwards compatibility and may be removed in a
   119  future version:
   120  
   121  * `validation_key_path (string)` - __Deprecated: please use `validation_key` instead__.
   122  * `secret_key_path (string)` - __Deprecated: please use `secret_key` instead__.