github.com/homburg/packer@v0.6.1-0.20140528012651-1dcaf1716848/website/source/docs/builders/digitalocean.html.markdown (about)

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