ansible.builtin.digital_ocean_tag (v2.4.2.0-1) — module

Create and remove tag(s) to DigitalOcean resource.

| "added in version" 2.2 of ansible.builtin"

Authors: Victor Volle (@kontrafiktion)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.4.2.0.post1

Description

Create and remove tag(s) to DigitalOcean resource.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: create a tag
  digital_ocean_tag:
    name: production
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: tag a resource; creating the tag if it does not exists
  digital_ocean_tag:
    name: "{{ item }}"
    resource_id: YYY
    state: present
  with_items:
    - staging
    - dbserver
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: untag a resource
  digital_ocean_tag:
    name: staging
    resource_id: YYY
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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

Inputs

    
name:
    description:
    - The name of the tag. The supported characters for names include alphanumeric characters,
      dashes, and underscores.
    required: true

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether the tag should be present or absent on the resource.

api_token:
    description:
    - DigitalOcean api token.

resource_id:
    description:
    - The ID of the resource to operate on.

resource_type:
    choices:
    - droplet
    default: droplet
    description:
    - The type of resource to operate on. Currently, only tagging of droplets is supported.

Outputs

data:
  description: a DigitalOcean Tag resource
  returned: success and no resource constraint
  sample:
    tag:
      name: awesome
      resources:
        droplets:
          count: 0
          last_tagged: null
  type: dict