github.com/kimor79/packer@v0.8.7-0.20151221212622-d507b18eb4cf/website/source/docs/builders/digitalocean.html.markdown (about)

     1  ---
     2  description: |
     3      The `digitalocean` Packer builder is able to create new images for use with
     4      DigitalOcean. The builder takes a source image, runs any provisioning necessary
     5      on the image after launching it, then snapshots it into a reusable image. This
     6      reusable image can then be used as the foundation of new servers that are
     7      launched within DigitalOcean.
     8  layout: docs
     9  page_title: DigitalOcean Builder
    10  ...
    11  
    12  # DigitalOcean Builder
    13  
    14  Type: `digitalocean`
    15  
    16  The `digitalocean` Packer builder is able to create new images for use with
    17  [DigitalOcean](http://www.digitalocean.com). The builder takes a source image,
    18  runs any provisioning necessary on the image after launching it, then snapshots
    19  it into a reusable image. This reusable image can then be used as the foundation
    20  of new servers that are launched within DigitalOcean.
    21  
    22  The builder does *not* manage images. Once it creates an image, it is up to you
    23  to use it or delete it.
    24  
    25  ## Configuration Reference
    26  
    27  There are many configuration options available for the builder. They are
    28  segmented below into two categories: required and optional parameters. Within
    29  each category, the available configuration keys are alphabetized.
    30  
    31  In addition to the options listed here, a
    32  [communicator](/docs/templates/communicator.html) can be configured for this
    33  builder.
    34  
    35  ### Required:
    36  
    37  -   `api_token` (string) - The client TOKEN to use to access your account. It
    38      can also be specified via environment variable `DIGITALOCEAN_API_TOKEN`,
    39      if set.
    40  
    41  -   `image` (string) - The name (or slug) of the base image to use. This is the
    42      image that will be used to launch a new droplet and provision it. See
    43      [https://developers.digitalocean.com/documentation/v2/\#list-all-images](https://developers.digitalocean.com/documentation/v2/#list-all-images) for
    44      details on how to get a list of the the accepted image names/slugs.
    45  
    46  -   `region` (string) - The name (or slug) of the region to launch the
    47      droplet in. Consequently, this is the region where the snapshot will
    48      be available. See
    49      [https://developers.digitalocean.com/documentation/v2/\#list-all-regions](https://developers.digitalocean.com/documentation/v2/#list-all-regions) for
    50      the accepted region names/slugs.
    51  
    52  -   `size` (string) - The name (or slug) of the droplet size to use. See
    53      [https://developers.digitalocean.com/documentation/v2/\#list-all-sizes](https://developers.digitalocean.com/documentation/v2/#list-all-sizes) for
    54      the accepted size names/slugs.
    55  
    56  ### Optional:
    57  
    58  -   `droplet_name` (string) - The name assigned to the droplet. DigitalOcean
    59      sets the hostname of the machine to this value.
    60  
    61  -   `private_networking` (boolean) - Set to `true` to enable private networking
    62      for the droplet being created. This defaults to `false`, or not enabled.
    63  
    64  -   `snapshot_name` (string) - The name of the resulting snapshot that will
    65      appear in your account. This must be unique. To help make this unique, use a
    66      function like `timestamp` (see [configuration
    67      templates](/docs/templates/configuration-templates.html) for more info)
    68  
    69  -   `state_timeout` (string) - The time to wait, as a duration string, for a
    70      droplet to enter a desired state (such as "active") before timing out. The
    71      default state timeout is "6m".
    72  
    73  -   `user_data` (string) - User data to launch with the Droplet.
    74  
    75  ## Basic Example
    76  
    77  Here is a basic example. It is completely valid as soon as you enter your own
    78  access tokens:
    79  
    80  ``` {.javascript}
    81  {
    82    "type": "digitalocean",
    83    "api_token": "YOUR API KEY",
    84    "image": "ubuntu-12-04-x64",
    85    "region": "nyc2",
    86    "size": "512mb"
    87  }
    88  ```