New in version 2.2.
- python >= 2.6
parameter | required | default | choices | comments |
---|---|---|---|---|
api_token |
no |
DigitalOcean api token.
|
||
name |
yes |
The name of the tag. The supported characters for names include alphanumeric characters, dashes, and underscores.
|
||
resource_id |
no |
The ID of the resource to operate on.
The data type of resource_id is changed from integer to string, from version 2.5.
|
||
resource_type |
no | droplet |
|
The type of resource to operate on. Currently, only tagging of droplets is supported.
|
state |
no | present |
|
Whether the tag should be present or absent on the resource.
|
- name: create a tag digital_ocean_tag: name: production state: present - name: tag a resource; creating the tag if it does not exists digital_ocean_tag: name: "{{ item }}" resource_id: "73333005" state: present with_items: - staging - dbserver - name: untag a resource digital_ocean_tag: name: staging resource_id: "73333005" state: absent # Deleting a tag also untags all the resources that have previously been # tagged with it - name: remove a tag digital_ocean_tag: name: dbserver state: absent
Common return values are documented here Return Values, the following are the fields unique to this module:
name | description | returned | type | sample |
---|---|---|---|---|
data |
a DigitalOcean Tag resource
|
success and no resource constraint | dict | {'tag': {'name': 'awesome', 'resources': {'droplets': {'count': 0, 'last_tagged': None}}}} |
Note
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.