Skip to content

Commit

Permalink
Fix Digital Ocean tags module data type (ansible#33486)
Browse files Browse the repository at this point in the history
Digital Ocean changed their api to no longer accept an integer as a resource_id.  Fix adds changed data type (from integer to string).

Signed-off-by: Anthony Bond <[email protected]>
Signed-off-by: Abhijeet Kasurde <[email protected]>
  • Loading branch information
BondAnthony authored and Akasurde committed Dec 2, 2017
1 parent 24f8a35 commit f9b138b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/ansible/modules/cloud/digital_ocean/digital_ocean_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
resource_id:
description:
- 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:
description:
- The type of resource to operate on. Currently, only tagging of
Expand Down Expand Up @@ -64,7 +65,7 @@
- name: tag a resource; creating the tag if it does not exists
digital_ocean_tag:
name: "{{ item }}"
resource_id: YYY
resource_id: "73333005"
state: present
with_items:
- staging
Expand All @@ -73,7 +74,7 @@
- name: untag a resource
digital_ocean_tag:
name: staging
resource_id: YYY
resource_id: "73333005"
state: absent
# Deleting a tag also untags all the resources that have previously been
Expand Down Expand Up @@ -198,7 +199,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
name=dict(type='str', required=True),
resource_id=dict(aliases=['droplet_id'], type='int'),
resource_id=dict(aliases=['droplet_id'], type='str'),
resource_type=dict(choices=['droplet'], default='droplet'),
state=dict(choices=['present', 'absent'], default='present'),
api_token=dict(aliases=['API_TOKEN'], no_log=True),
Expand Down

0 comments on commit f9b138b

Please sign in to comment.