ansible-collections / community.digitalocean

This Ansible collection contains modules for assisting in the automation of the DigitalOcean cloud.
https://galaxy.ansible.com/community/digitalocean/
GNU General Public License v3.0
140 stars 57 forks source link

Ability to deploy droplet from custom image (or snapshot) #358

Open Lusitaniae opened 8 months ago

Lusitaniae commented 8 months ago

DigitalOcean only provides a few images by default (Ubuntu, Debian, Fedora, Centos, etc)

But they support the optioon to deploy custom images and or deploy from a VM snapshot too which can be very useful in automation

SUMMARY

either image_id should accept an integer value and find the respective image, or a new field should be created

https://docs.digitalocean.com/reference/api/api-reference/#operation/droplets_create

the API supports reading the slug or image id from the same field

ISSUE TYPE
COMPONENT NAME

community.digitalocean.digital_ocean_droplet

ADDITIONAL INFORMATION
- name: Launch DO
  community.digitalocean.digital_ocean_droplet:
    state: present
    name: "my-app"
    size: "c-2"
    image_id: "4567432"
    region: "nyc1"