github.com/askholme/packer@v0.7.2-0.20140924152349-70d9566a6852/website/source/docs/builders/digitalocean.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "DigitalOcean Builder"
     4  ---
     5  
     6  # DigitalOcean Builder
     7  
     8  Type: `digitalocean`
     9  
    10  The `digitalocean` builder is able to create new images for use with
    11  [DigitalOcean](http://www.digitalocean.com). The builder takes a source
    12  image, runs any provisioning necessary on the image after launching it,
    13  then snapshots it into a reusable image. This reusable image can then be
    14  used as the foundation of new servers that are launched within DigitalOcean.
    15  
    16  The builder does _not_ manage images. Once it creates an image, it is up to
    17  you to use it or delete it.
    18  
    19  ## Configuration Reference
    20  
    21  There are many configuration options available for the builder. They are
    22  segmented below into two categories: required and optional parameters. Within
    23  each category, the available configuration keys are alphabetized.
    24  
    25  ### Required:
    26  
    27  * `api_key` (string) - The API key to use to access your account. You can
    28    retrieve this on the "API" page visible after logging into your account
    29    on DigitalOcean.
    30    If not specified, Packer will use the environment variable
    31    `DIGITALOCEAN_API_KEY`, if set.
    32  
    33  * `client_id` (string) - The client ID to use to access your account. You can
    34    find this on the "API" page visible after logging into your account on
    35    DigitalOcean.
    36    If not specified, Packer will use the environment variable
    37    `DIGITALOCEAN_CLIENT_ID`, if set.
    38  
    39  ### Optional:
    40  
    41  * `droplet_name` (string) - The name assigned to the droplet. DigitalOcean
    42    sets the hostname of the machine to this value.
    43  
    44  * `image` (string) - The name (or slug) of the base image to use. This is the
    45    image that will be used to launch a new droplet and provision it. This
    46    defaults to 'ubuntu-12-04-x64' which is the slug for "Ubuntu 12.04.4 x64".
    47    See https://developers.digitalocean.com/#list-all-images for details on how to get a list of the the accepted image names/slugs.
    48  
    49  * `image_id` (integer) - The ID of the base image to use. This is the image that
    50    will be used to launch a new droplet and provision it.
    51    This setting is deprecated. Use `image` instead.
    52  
    53  * `private_networking` (boolean) - Set to `true` to enable private networking
    54    for the droplet being created. This defaults to `false`, or not enabled.
    55  
    56  * `region` (string) - The name (or slug) of the region to launch the droplet in.
    57    Consequently, this is the region where the snapshot will be available.
    58    This defaults to "nyc1", which is the slug for "New York 1".
    59    See https://developers.digitalocean.com/regions/ for the accepted region names/slugs.
    60  
    61  * `region_id` (integer) - The ID of the region to launch the droplet in. Consequently,
    62    this is the region where the snapshot will be available.
    63    This setting is deprecated. Use `region` instead.
    64  
    65  * `size` (string) - The name (or slug) of the droplet size to use.
    66    This defaults to "512mb", which is the slug for "512MB".
    67    See https://developers.digitalocean.com/sizes/ for the accepted size names/slugs.
    68  
    69  * `size_id` (integer) - The ID of the droplet size to use.
    70    This setting is deprecated. Use `size` instead.
    71  
    72  * `snapshot_name` (string) - The name of the resulting snapshot that will
    73    appear in your account. This must be unique.
    74    To help make this unique, use a function like `timestamp` (see
    75    [configuration templates](/docs/templates/configuration-templates.html) for more info)
    76  
    77  * `ssh_port` (integer) - The port that SSH will be available on. Defaults to port
    78    22.
    79  
    80  * `ssh_timeout` (string) - The time to wait for SSH to become available
    81    before timing out. The format of this value is a duration such as "5s"
    82    or "5m". The default SSH timeout is "1m".
    83  
    84  * `ssh_username` (string) - The username to use in order to communicate
    85    over SSH to the running droplet. Default is "root".
    86  
    87  * `state_timeout` (string) - The time to wait, as a duration string,
    88    for a droplet to enter a desired state (such as "active") before
    89    timing out. The default state timeout is "6m".
    90  
    91  ## Basic Example
    92  
    93  Here is a basic example. It is completely valid as soon as you enter your
    94  own access tokens:
    95  
    96  <pre class="prettyprint">
    97  {
    98    "type": "digitalocean",
    99    "client_id": "YOUR CLIENT ID",
   100    "api_key": "YOUR API KEY"
   101  }
   102  </pre>
   103  
   104  ## Finding Image, Region, and Size IDs
   105  
   106  Unfortunately, finding a list of available values for `image_id`, `region_id`,
   107  and `size_id` is not easy at the moment. Basically, it has to be done through
   108  the [DigitalOcean API](https://www.digitalocean.com/api_access) using the
   109  `/images`, `/regions`, and `/sizes` endpoints. You can use `curl` for this
   110  or request it in your browser.
   111  
   112  If you're comfortable installing RubyGems, [Tugboat](https://github.com/pearkes/tugboat)
   113  is a fantastic DigitalOcean command-line client that has commands to
   114  find the available images, regions, and sizes. For example, to see all the
   115  global images, you can run `tugboat images --global`.