Last Updated: February 25, 2016
·
380
· scott2b

Some notes on getting Salt Cloud configurations right for Droplet provisioning on DigitalOcean

Between various tutorials and documentations available, including those from both DigitalOcean and SaltStack, there are a lot of mixed messages about how to setup Salt Cloud based Droplet provisioning on Digital Ocean. Here are some specific issues I encountered.

(1) API Version Specifics

It seems like DigitalOcean is in the process of transitioning between API versions. While there exists documentation for using a new Access Token based approach to configuring your provider, this approach does not really seem to work. Salt will complain about missing parameters in your provider config. Instead, you need to provide a client_key and an api_key, along with an ssh_key_file specification and ssh_key_names.

You can add SSH keys by clicking the "SSH Keys" link in your DigitalOcean cloud console. For the API credentials, click the "Apps & API" link, then "View API v1". Here you will see your Client ID (called client_key in Salt Cloud) and you can generate an API Key.

(2) ssh_key_file Specification

This is not really DigitalOcean specific, but is worth mentioning. The ssh_key_file specification in your provider config must be the PRIVATE counterpart to the public key you uploaded and named in your DigitalOcean console. Furthermore, the Salt-relative salt:// path syntax does not seem to work here -- you should specify an absolute path to your private key.

(3) DigitalOcean Image Names

Image Names in your cloud profile config. Most of the documentation out there indicates that you can specify something like this for your image: "Ubuntu 14.04 x64". This is not correct. Nor is it correct that you can use a slug like "ubuntu-14-04-x64".

Get the list of images by typing salt-cloud --list-images <provider>. In those images, there are 2 valid keys which can be used for specifying the image in your profile config: name and id. You will note that the Ubuntu names do not begin with "Ubuntu" but are instead something like "14.04 x64". Also note that the ID is not a slug, but a numeric ID (9801950 in this case). These are the valid values for the image parameter in your profile config. I have it on authority from DigitalOcean's support group that the numeric ID is really the way to go here.