mitchellh/packer — pull request #504 by rasa (2013-10-06 03:23:43+00:00)
Title: Adds vagrant support for digitalocean

First, I upgraded the vagrant-digitalocean plugin to version 0.3.0.

Then, I ran packer with:
```
{
"builders": [{
"type": "digitalocean",
"api_key": "insert-key-here",
"client_id": "insert-key-here",
"image_id": 345791,
"name": "example",
"region_id": 3,
"size_id": 66
}],
"post-processors": [{
"type": "vagrant",
"keep_input_artifact": true,
"output": "example.box"
}]
}
```
The resulting `example.box` contains the following `Vagrantfile`:
```
Vagrant.configure("2") do |config|
config.vm.provider :digital_ocean do |digital_ocean|
digital_ocean.image = "packer-1381025582"
digital_ocean.region = "San Francisco 1"
end
end
```
Then, I brought up the box via:
```
export VAGRANT_DEFAULT_PROVIDER=digital_ocean
export DO_API_KEY=insert-key-here
export DO_CLIENT_ID=insert-key-here
export SSL_CERT_FILE=/usr/share/ncat/ca-bundle.crt
vagrant box add example example.box
vagrant up
```
Note that this PR reverts https://github.com/mitchellh/packer/pull/473 as when the `status` field is `ERROR`, the message field is always named `error_message`, and not `message`. Thankfully, if the field somehow changes back to `message`, packer won't panic, due to https://github.com/mitchellh/packer/commit/58899f38880845f5802c3c39fd118239a7a178ba#diff-773223d4ba1a61e81daea8a8dfcdb692L227