community.general.ome_device_info (2.5.9) — module

Retrieves the information about Device.

Authors: Sajna Shetty(@Sajna-Shetty)

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 2.5.9

Description

This module retrieves the list of all devices information with the exhaustive inventory of each device.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- name: Retrieve basic inventory of all devices.
  community.general.ome_device_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve basic inventory for devices identified by IDs 33333 or 11111 using filtering.
  community.general.ome_device_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    fact_subset: "basic_inventory"
    system_query_options:
      filter: "Id eq 33333 or Id eq 11111"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve inventory details of specified devices identified by IDs 11111 and 22222.
  community.general.ome_device_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    fact_subset: "detailed_inventory"
    system_query_options:
      device_id:
        - 11111
        - 22222
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve inventory details of specified devices identified by service tags MXL1234 and MXL4567.
  community.general.ome_device_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    fact_subset: "detailed_inventory"
    system_query_options:
      device_service_tag:
        - MXL1234
        - MXL4567
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve details of specified inventory type of specified devices identified by ID and service tags.
  community.general.ome_device_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    fact_subset: "detailed_inventory"
    system_query_options:
      device_id:
        - 11111
      device_service_tag:
        - MXL1234
        - MXL4567
      inventory_type: "serverDeviceCards"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve subsystem health of specified devices identified by service tags.
  community.general.ome_device_info:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    fact_subset: "subsystem_health"
    system_query_options:
      device_service_tag:
        - MXL1234
        - MXL4567

Inputs

    
port:
    default: 443
    description:
    - Target HTTPS port.
    type: int

hostname:
    description:
    - Target IP Address or hostname.
    required: true
    type: str

password:
    description:
    - Target user password.
    required: true
    type: str

username:
    description:
    - Target username.
    required: true
    type: str

fact_subset:
    choices:
    - basic_inventory
    - detailed_inventory
    - subsystem_health
    default: basic_inventory
    description:
    - C(basic_inventory) returns the list of the devices.
    - C(detailed_inventory) returns the inventory details of specified devices.
    - C(subsystem_health) returns the health status of specified devices.
    type: str

system_query_options:
    description:
    - I(system_query_options) applicable for the choices of the fact_subset. Either I(device_id)
      or I(device_service_tag) is mandatory for C(detailed_inventory) and C(subsystem_health)
      or both can be applicable.
    suboptions:
      device_id:
        description:
        - A list of unique identifier is applicable for C(detailed_inventory) and C(subsystem_health).
        type: list
      device_service_tag:
        description:
        - A list of service tags are applicable for C(detailed_inventory) and C(subsystem_health).
        type: list
      filter:
        description:
        - For C(basic_inventory), it filters the collection of devices. I(filter) query
          format should be aligned with OData standards.
        type: str
      inventory_type:
        description:
        - For C(detailed_inventory), it returns details of the specified inventory type.
        type: str
    type: dict

Outputs

device_info:
  description: Returns the information collected from the Device.
  returned: success
  sample:
    value:
    - Actions: null
      AssetTag: null
      ChassisServiceTag: null
      ConnectionState: true
      DeviceManagement:
      - DnsName: dnsname.host.com
        InstrumentationName: MX-12345
        MacAddress: '11:10:11:10:11:10'
        ManagementId: 12345
        ManagementProfile:
        - HasCreds: 0
          ManagementId: 12345
          ManagementProfileId: 12345
          ManagementURL: https://192.168.0.1:443
          Status: 1000
          StatusDateTime: '2019-01-21 06:30:08.501'
        ManagementType: 2
        NetworkAddress: 192.168.0.1
      DeviceName: MX-0003I
      DeviceServiceTag: MXL1234
      DeviceSubscription: null
      LastInventoryTime: '2019-01-21 06:30:08.501'
      LastStatusTime: '2019-01-21 06:30:02.492'
      ManagedState: 3000
      Model: PowerEdge MX7000
      PowerState: 17
      SlotConfiguration: {}
      Status: 4000
      SystemId: 2031
      Type: 2000
  type: dict
msg:
  description: Over all device information status.
  returned: on error
  sample: Failed to fetch the device information
  type: str