The dopy manager defaults to False for virtio, but the DigitalOcean web interface defaults to True, which is a pretty safe default and sensible considering the performance gains.
Private networks are a new feature currently available only in the NYC2 region as of Oct 2, 2013.
NOTE: dopy >= 0.2.2 is required for these options to work.
As it stands now, it is difficult to write idempotent tasks for digital
ocean droplets. Digital ocean assigns new nodes a random id when they
are provisioned and that id is the only key that can be used to identify
it in subsequent runs of that play.
The workflow previously involved manual intervention:
- write a play defining a new node with no specified id
- run it, collect the randomly assigned id by hand
- modify the play to add the id by hand so future runs don't create
duplicate nodes
- perform future re-runs that check if the node exists (by its id)
- if it does exist then do nothing.
- if it does not exist, then create it and return a *new random id*
- collect the new random id by hand, modify the playbook file, and
start all over.
Its a huge pain.
The modifications in this commit allow you to use the 'hostname' as a
primary key for idempotence with digital ocean. By default, digital
ocean will let you create as many hosts with the same hostname as you
like. Here, we provide an option to constrain the user to using only
unique hostnames.
The workflow will now look like:
- write a play defining a new node with a specified hostname and
"unique_name: true""
- run it, create the new node and move on.
- re-run it, notice that a node with that hostname is already created
and move on.
The EXAMPLES block here has two copies of the same docs,
one nicely formatted, the other less so.
It looks like a pass was made to clean up the docs but the old
cruftier ones were never removed.
Sometimes when using digital_ocean with wait=no I get the error "No ip is found". But with wait=no I wouldn't expect there to be any IP, that gets allocated later. However, looking at the code, it turns out that with even with wait=no it waits up to 10 seconds for an IP to be allocated. We could wait longer, but with wait=no that seems like the wrong choice; it's easy enough to grab an IP later with a wait=yes command.
To make this change I removed the call to update_attr in @classmethod add. An add is always followed by an ensure_powered_on which will do the update_attr if wait=yes. It would be possible to instead do a call to update_attr with no retries and ignore the errors but I figured it would be better to be consistently not return an IP than to sometimes return it and sometimes not. Inconsistent behaviour makes debugging deployment scripts very difficult.