community.general.manageiq_group (8.5.0) — module

Management of groups in ManageIQ

Authors: Evert Mulder (@evertmulder)

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_group module supports adding, updating and deleting groups in ManageIQ.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a group in ManageIQ with the role EvmRole-user and tenant 'my_tenant'
  community.general.manageiq_group:
    description: 'MyGroup-user'
    role: 'EvmRole-user'
    tenant: 'my_tenant'
    manageiq_connection:
      url: 'http://127.0.0.1:3000'
      username: 'admin'
      password: 'smartvm'
      validate_certs: false  # only do this when you trust the network!
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a group in ManageIQ with the role EvmRole-user and tenant with tenant_id 4
  community.general.manageiq_group:
    description: 'MyGroup-user'
    role: 'EvmRole-user'
    tenant_id: 4
    manageiq_connection:
      url: 'http://127.0.0.1:3000'
      username: 'admin'
      password: 'smartvm'
      validate_certs: false  # only do this when you trust the network!
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name:
  - Create or update a group in ManageIQ with the role EvmRole-user and tenant my_tenant.
  - Apply 3 prov_max_cpu and 2 department tags to the group.
  - Limit access to a cluster for the group.
  community.general.manageiq_group:
    description: 'MyGroup-user'
    role: 'EvmRole-user'
    tenant: my_tenant
    managed_filters:
      prov_max_cpu:
      - '1'
      - '2'
      - '4'
      department:
      - defense
      - engineering
    managed_filters_merge_mode: replace
    belongsto_filters:
    - "/belongsto/ExtManagementSystem|ProviderName/EmsFolder|Datacenters/EmsFolder|dc_name/EmsFolder|host/EmsCluster|Cluster name"
    belongsto_filters_merge_mode: merge
    manageiq_connection:
      url: 'http://127.0.0.1:3000'
      username: 'admin'
      password: 'smartvm'
      validate_certs: false  # only do this when you trust the network!
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete a group in ManageIQ
  community.general.manageiq_group:
    state: 'absent'
    description: 'MyGroup-user'
    manageiq_connection:
      url: 'http://127.0.0.1:3000'
      username: 'admin'
      password: 'smartvm'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete a group in ManageIQ using a token
  community.general.manageiq_group:
    state: 'absent'
    description: 'MyGroup-user'
    manageiq_connection:
      url: 'http://127.0.0.1:3000'
      token: 'sometoken'

Inputs

    
role:
    default: null
    description:
    - The the group role name
    - The O(role_id) has precedence over the O(role) when supplied.
    required: false
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - absent - group should not exist, present - group should be.
    type: str

tenant:
    default: null
    description:
    - The tenant for the group identified by the tenant name.
    - The O(tenant_id) has precedence over the O(tenant) when supplied.
    - Tenant names are case sensitive.
    required: false
    type: str

role_id:
    default: null
    description:
    - The the group role id
    required: false
    type: int

tenant_id:
    default: null
    description:
    - The tenant for the group identified by the tenant id.
    required: false
    type: int

description:
    default: null
    description:
    - The group description.
    required: true
    type: str

managed_filters:
    default: null
    description: The tag values per category
    required: false
    type: dict

belongsto_filters:
    default: null
    description: A list of strings with a reference to the allowed host, cluster or folder
    elements: str
    required: false
    type: list

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

managed_filters_merge_mode:
    choices:
    - merge
    - replace
    default: replace
    description:
    - In merge mode existing categories are kept or updated, new categories are added.
    - In replace mode all categories will be replaced with the supplied O(managed_filters).
    type: str

belongsto_filters_merge_mode:
    choices:
    - merge
    - replace
    default: replace
    description:
    - In merge mode existing settings are merged with the supplied O(belongsto_filters).
    - In replace mode current values are replaced with the supplied O(belongsto_filters).
    type: str

Outputs

group:
  contains:
    belongsto_filters:
      description: A list of strings with a reference to the allowed host, cluster
        or folder
      returned: success
      type: list
    created_on:
      description: Group creation date
      returned: success
      sample: '2018-08-12T08:37:55+00:00'
      type: str
    description:
      description: The group description
      returned: success
      type: str
    group_type:
      description: The group type, system or user
      returned: success
      type: str
    id:
      description: The group id
      returned: success
      type: int
    managed_filters:
      description: The tag values per category
      returned: success
      type: dict
    role:
      description: The group role name
      returned: success
      type: str
    tenant:
      description: The group tenant name
      returned: success
      type: str
    updated_on:
      description: Group update date
      returned: success
      sample: '2018-08-12T08:37:55+00:00'
      type: int
  description: The group.
  returned: success
  type: complex