parameter | required | default | choices | comments |
---|---|---|---|---|
api_key | no | Digital Ocean api key. | ||
client_id | no | Digital Ocean manager id. | ||
id | no | Numeric, the droplet id you want to operate on. | ||
ip | no | The IP address to point a domain at. | ||
name | no | String, this is the name of the droplet - must be formatted by hostname rules, or the name of a SSH key, or the name of a domain. | ||
state | no | present |
|
Indicate desired state of the target. |
# Create a domain record
- digital_ocean_domain: >
state=present
name=my.digitalocean.domain
ip=127.0.0.1
# Create a droplet and a corresponding domain record
- digital_cean_droplet: >
state=present
name=test_droplet
size_id=1
region_id=2
image_id=3
register: test_droplet
- digital_ocean_domain: >
state=present
name={{ test_droplet.name }}.my.domain
ip={{ test_droplet.ip_address }}
Note
Two environment variables can be used, DO_CLIENT_ID and DO_API_KEY.