community.general.manageiq_tags (8.5.0) — module

Management of resource tags in ManageIQ

Authors: Daniel Korn (@dkorn)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

The manageiq_tags module supports adding, updating and deleting tags in ManageIQ.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create new tags for a provider in ManageIQ.
  community.general.manageiq_tags:
    resource_name: 'EngLab'
    resource_type: 'provider'
    tags:
    - category: environment
      name: prod
    - category: owner
      name: prod_ops
    manageiq_connection:
      url: 'http://127.0.0.1:3000'
      username: 'admin'
      password: 'smartvm'
      validate_certs: false  # only do this when connecting to localhost!
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create new tags for a provider in ManageIQ.
  community.general.manageiq_tags:
    resource_id: 23000000790497
    resource_type: 'provider'
    tags:
    - category: environment
      name: prod
    - category: owner
      name: prod_ops
    manageiq_connection:
      url: 'http://127.0.0.1:3000'
      username: 'admin'
      password: 'smartvm'
      validate_certs: false  # only do this when connecting to localhost!
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove tags for a provider in ManageIQ.
  community.general.manageiq_tags:
    state: absent
    resource_name: 'EngLab'
    resource_type: 'provider'
    tags:
    - category: environment
      name: prod
    - category: owner
      name: prod_ops
    manageiq_connection:
      url: 'http://127.0.0.1:3000'
      username: 'admin'
      password: 'smartvm'
      validate_certs: false  # only do this when connecting to localhost!

Inputs

    
tags:
    description:
    - V(tags) - list of dictionaries, each includes C(name) and C(category) keys.
    - Required if O(state) is V(present) or V(absent).
    elements: dict
    type: list

state:
    choices:
    - absent
    - present
    default: present
    description:
    - V(absent) - tags should not exist.
    - V(present) - tags should exist.
    type: str

resource_id:
    description:
    - The ID of the resource at which tags will be controlled.
    - Must be specified if O(resource_name) is not set. Both options are mutually exclusive.
    type: int
    version_added: 2.2.0
    version_added_collection: community.general

resource_name:
    description:
    - The name of the resource at which tags will be controlled.
    - Must be specified if O(resource_id) is not set. Both options are mutually exclusive.
    type: str

resource_type:
    choices:
    - provider
    - host
    - vm
    - blueprint
    - category
    - cluster
    - data store
    - group
    - resource pool
    - service
    - service template
    - template
    - tenant
    - user
    description:
    - The relevant resource type in manageiq.
    required: true
    type: str

manageiq_connection:
    description:
    - ManageIQ connection configuration information.
    required: false
    suboptions:
      ca_cert:
        aliases:
        - ca_bundle_path
        description:
        - The path to a CA bundle file or directory with certificates.
        type: str
      password:
        description:
        - ManageIQ password. E(MIQ_PASSWORD) environment variable if set. Otherwise, required
          if no token is passed in.
        type: str
      token:
        description:
        - ManageIQ token. E(MIQ_TOKEN) environment variable if set. Otherwise, required
          if no username or password is passed in.
        type: str
      url:
        description:
        - ManageIQ environment URL. E(MIQ_URL) environment variable if set. Otherwise,
          it is required to pass it.
        required: false
        type: str
      username:
        description:
        - ManageIQ username. E(MIQ_USERNAME) environment variable if set. Otherwise, required
          if no token is passed in.
        type: str
      validate_certs:
        aliases:
        - verify_ssl
        default: true
        description:
        - Whether SSL certificates should be verified for HTTPS requests.
        type: bool
    type: dict