# digital\_ocean: any real-world examples of this working for droplet creation?

**URL:** <https://forum.ansible.com/t/digital-ocean-any-real-world-examples-of-this-working-for-droplet-creation/13497>\
**Category:** Ansible Project\
**Created:** [September 17, 2013, 7:49pm UTC](https://forum.ansible.com/t/digital-ocean-any-real-world-examples-of-this-working-for-droplet-creation/13497 "2013-09-17T19:49:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_D](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@John\_D](https://forum.ansible.com/u/John_D)\
**Post date:** [September 17, 2013, 7:49pm UTC](https://forum.ansible.com/t/digital-ocean-any-real-world-examples-of-this-working-for-droplet-creation/13497/1 "2013-09-17T19:49:58Z")

</div>

I’m sure this is just me being obtuse, but I’ve never figured out how to make digital\_ocean idempotent (it will keep creating new instances)

[http://www.ansibleworks.com/docs/modules.html#digital-ocean](http://www.ansibleworks.com/docs/modules.html#digital-ocean)

Can I register a variable that is used for future runs w/o manual intervention? Does anyone have a working example playbook using this module??

Also, the example in the docs fails (I can open an issue, after making sure I’m not doing anything dumb)

```auto
- digital_ocean: >
      state=present
      command=droplet
      name=my_new_droplet
      client_id=XXX
      api_key=XXX
      size_id=1
      region_id=2
      image_id=3
      wait_timeout=500
  register: my_droplet
- debug: msg="ID: {{ my_droplet.droplet.id }} IP: {{ my_droplet.droplet.ip_address }}"

```

```auto
ERROR: Syntax Error while loading YAML script, <top secret>
Note: The error may actually appear before this position: line 22, column 17

  
- debug: msg="ID: {{ my_droplet.droplet.id }} IP: {{ my_droplet.droplet.ip_address }}

```

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [September 17, 2013, 9:08pm UTC](https://forum.ansible.com/t/digital-ocean-any-real-world-examples-of-this-working-for-droplet-creation/13497/2 "2013-09-17T21:08:06Z")

</div>

The error is caused by the ": " (colon followed by a space) on the line, you need to put quotes around the entire msg= part. This is a known YAML interpreter issue. So it should be like this:

```auto
- debug: 'msg="ID: {{ [my_droplet.droplet.id](http://my_droplet.droplet.id/) }} IP: {{ my_droplet.droplet.ip_address }}"'

```
