dellemc.openmanage.ome_device_group (9.1.0) — module

Add or remove device(s) from a static device group on OpenManage Enterprise

| "added in version" 3.3.0 of dellemc.openmanage"

Authors: Felix Stephen (@felixs88), Sajna Shetty(@Sajna-Shetty), Abhishek Sinha (@Abhishek-Dell)

Install collection

Install with ansible-galaxy collection install dellemc.openmanage:==9.1.0


Add to requirements.yml

  collections:
    - name: dellemc.openmanage
      version: 9.1.0

Description

This module allows to add or remove device(s) from a static device group on OpenManage Enterprise.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- name: Add devices to a static device group by using the group name and device IDs
  dellemc.openmanage.ome_device_group:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    name: "Storage Services"
    device_ids:
      - 11111
      - 11112
      - 11113
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add devices to a static device group by using the group name and device service tags
  dellemc.openmanage.ome_device_group:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    name: "Storage Services"
    device_service_tags:
      - GHRT2RL
      - KJHDF3S
      - LKIJNG6
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add devices to a static device group by using the group ID and device service tags
  dellemc.openmanage.ome_device_group:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    group_id: 12345
    device_service_tags:
      - GHRT2RL
      - KJHDF3S
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add devices to a static device group by using the group name and IPv4 addresses
  dellemc.openmanage.ome_device_group:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    name: "Storage Services"
    ip_addresses:
      - 192.35.0.1
      - 192.35.0.5
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add devices to a static device group by using the group ID and IPv6 addresses
  dellemc.openmanage.ome_device_group:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    group_id: 12345
    ip_addresses:
      - fe80::ffff:ffff:ffff:ffff
      - fe80::ffff:ffff:ffff:2222
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add devices to a static device group by using the group ID and supported IPv4 and IPv6 address formats.
  dellemc.openmanage.ome_device_group:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    group_id: 12345
    ip_addresses:
      - 192.35.0.1
      - 10.36.0.0-192.36.0.255
      - 192.37.0.0/24
      - fe80::ffff:ffff:ffff:ffff
      - ::ffff:192.0.2.0/125
      - fe80::ffff:ffff:ffff:1111-fe80::ffff:ffff:ffff:ffff
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove devices from a static device group by using the group name and device IDs
  dellemc.openmanage.ome_device_group:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    state: "absent"
    name: "Storage Services"
    device_ids:
      - 11111
      - 11112
      - 11113
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove devices from a static device group by using the group name and device service tags
  dellemc.openmanage.ome_device_group:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    state: "absent"
    name: "Storage Services"
    device_service_tags:
      - GHRT2RL
      - KJHDF3S
      - LKIJNG6
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove devices from a static device group by using the group ID and device service tags
  dellemc.openmanage.ome_device_group:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    state: "absent"
    group_id: 12345
    device_service_tags:
      - GHRT2RL
      - KJHDF3S
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove devices from a static device group by using the group name and IPv4 addresses
  dellemc.openmanage.ome_device_group:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    state: "absent"
    name: "Storage Services"
    ip_addresses:
      - 192.35.0.1
      - 192.35.0.5
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove devices from a static device group by using the group ID and IPv6 addresses
  dellemc.openmanage.ome_device_group:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    state: "absent"
    group_id: 12345
    ip_addresses:
      - fe80::ffff:ffff:ffff:ffff
      - fe80::ffff:ffff:ffff:2222
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove devices from a static device group by using the group ID and supported IPv4 and IPv6 address formats.
  dellemc.openmanage.ome_device_group:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    state: "absent"
    group_id: 12345
    ip_addresses:
      - 192.35.0.1
      - 10.36.0.0-192.36.0.255
      - 192.37.0.0/24
      - fe80::ffff:ffff:ffff:ffff
      - ::ffff:192.0.2.0/125
      - fe80::ffff:ffff:ffff:1111-fe80::ffff:ffff:ffff:ffff

Inputs

    
name:
    description:
    - Name of the static group.
    - I(name) is mutually exclusive with I(group_id).
    type: str

port:
    default: 443
    description: OpenManage Enterprise HTTPS port.
    type: int

state:
    choices:
    - present
    - absent
    default: present
    description:
    - C(present) allows to add the device(s) to a static device group.
    - C(absent) allows to remove the device(s) from a static device group.
    type: str

ca_path:
    description:
    - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for
      the validation.
    type: path
    version_added: 5.0.0
    version_added_collection: dellemc.openmanage

timeout:
    default: 30
    description: The socket level timeout in seconds.
    type: int
    version_added: 5.0.0
    version_added_collection: dellemc.openmanage

group_id:
    description:
    - ID of the static device.
    - I(group_id) is mutually exclusive with I(name).
    type: int

hostname:
    description: OpenManage Enterprise IP address or hostname.
    required: true
    type: str

password:
    description:
    - OpenManage Enterprise password.
    - If the password is not provided, then the environment variable C(OME_PASSWORD) is
      used.
    - 'Example: export OME_PASSWORD=password'
    required: true
    type: str

username:
    description:
    - OpenManage Enterprise username.
    - If the username is not provided, then the environment variable C(OME_USERNAME) is
      used.
    - 'Example: export OME_USERNAME=username'
    required: true
    type: str

device_ids:
    description:
    - List of ID(s) of the device(s) to be added or removed from the device group.
    - I(device_ids) is mutually exclusive with I(device_service_tags) and I(ip_addresses).
    elements: int
    type: list

ip_addresses:
    description:
    - List of IPs of the device(s) to be added or removed from the device group.
    - I(ip_addresses) is mutually exclusive with I(device_ids) and I(device_service_tags).
    - 'Supported  IP address range formats:'
    - '    - 192.35.0.1'
    - '    - 10.36.0.0-192.36.0.255'
    - '    - 192.37.0.0/24'
    - '    - fe80::ffff:ffff:ffff:ffff'
    - '    - fe80::ffff:192.0.2.0/125'
    - '    - fe80::ffff:ffff:ffff:1111-fe80::ffff:ffff:ffff:ffff'
    - C(NOTE) Hostname is not supported.
    - C(NOTE) I(ip_addresses) requires python's netaddr packages to work on IP Addresses.
    - C(NOTE) This module reports success even if one of the IP addresses provided in
      the I(ip_addresses) list is available in OpenManage Enterprise.The module reports
      failure only if none of the IP addresses provided in the list are available in OpenManage
      Enterprise.
    elements: str
    type: list

validate_certs:
    default: true
    description:
    - If C(false), the SSL certificates will not be validated.
    - Configure C(false) only on personally controlled sites where self-signed certificates
      are used.
    - Prior to collection version C(5.0.0), the I(validate_certs) is C(false) by default.
    type: bool
    version_added: 5.0.0
    version_added_collection: dellemc.openmanage

device_service_tags:
    description:
    - List of service tag(s) of the device(s) to be added or removed from the device group.
    - I(device_service_tags) is mutually exclusive with I(device_ids) and I(ip_addresses).
    elements: str
    type: list

Outputs

error_info:
  description: Details of the HTTP Error.
  returned: on HTTP error
  sample:
    error:
      '@Message.ExtendedInfo':
      - Message: Unable to process the request because an error occurred.
        MessageArgs: []
        MessageId: GEN1234
        RelatedProperties: []
        Resolution: Retry the operation. If the issue persists, contact your system
          administrator.
        Severity: Critical
      code: Base.1.0.GeneralError
      message: A general error has occurred. See ExtendedInfo for more information.
  type: dict
group_id:
  description: ID of the group.
  returned: success
  sample: 21078
  type: int
ip_addresses_added:
  description: IP Addresses which are added to the device group.
  returned: success
  sample: 21078
  type: list
msg:
  description: Overall status of the device group settings.
  returned: always
  sample:
  - Successfully added member(s) to the device group.
  type: str