community.digitalocean.digital_ocean_droplet – Create and delete a DigitalOcean droplet¶
Note
This plugin is part of the community.digitalocean collection (version 1.1.1).
To install it use: ansible-galaxy collection install community.digitalocean
.
To use it in a playbook, specify: community.digitalocean.digital_ocean_droplet
.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.6
Parameters¶
Examples¶
- name: Create a new droplet
community.digitalocean.digital_ocean_droplet:
state: present
name: mydroplet
oauth_token: XXX
size: 2gb
region: sfo1
image: ubuntu-16-04-x64
wait_timeout: 500
ssh_keys: [ .... ]
register: my_droplet
- debug:
msg: "ID is {{ my_droplet.data.droplet.id }}, IP is {{ my_droplet.data.ip_address }}"
- name: Ensure a droplet is present
community.digitalocean.digital_ocean_droplet:
state: present
id: 123
name: mydroplet
oauth_token: XXX
size: 2gb
region: sfo1
image: ubuntu-16-04-x64
wait_timeout: 500
- name: Ensure a droplet is present with SSH keys installed
community.digitalocean.digital_ocean_droplet:
state: present
id: 123
name: mydroplet
oauth_token: XXX
size: 2gb
region: sfo1
ssh_keys: ['1534404', '1784768']
image: ubuntu-16-04-x64
wait_timeout: 500
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Gurchet Rai (@gurch101)