DigitalOcean Example for Ansible

Chapter 7 of Ansible for DevOps contains details and examples for using Ansible to provision and dynamically work with DigitalOcean droplets.

Dynamic Inventory and Provisioning

Examples using Ansible's DigitalOcean integration are contained within this directory.

  • provision.yml contains an example of provisioning a new DigitalOcean droplet, then immediately configuring it with Ansible.
  • (and digital_ocean.ini) is the DigitalOcean dynamic inventory script included with Ansible. Don't use this copy; get the latest version from the Ansible project:

Before you can use either of these examples, you will need to set an environment variable with your DigitalOcean API Personal Access Token:


Author Information

These examples were created in 2015 by Jeff Geerling, author of Ansible for DevOps.