Skip to content

Instantly share code, notes, and snippets.

@laprice
Last active December 28, 2015 22:39
Show Gist options
  • Save laprice/7573168 to your computer and use it in GitHub Desktop.
Save laprice/7573168 to your computer and use it in GitHub Desktop.
Functioning playbook to create a VM on digital ocean. Substitute your ssh_key_ids and image_id and run as is. You will need dopy installed.
---
- hosts: 127.0.0.1
connection: local
gather_facts: false
tasks:
- name: start a droplet
local_action: digital_ocean
state=present
ssh_key_ids=#,#,#
command=droplet
name=#validdnsname#
virtio=yes
wait=yes
unique_name=yes
size_id=66
region_id=3
image_id=####
wait_timeout=500
register: digital_ocean
- debug: msg="ID = {{ digital_ocean.droplet.id }}"
- debug: msg="IP = {{ digital_ocean.droplet.ip_address}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment