community.general.idrac_redfish_info (6.6.8) — module

Gather PowerEdge server information through iDRAC using Redfish APIs

Authors: Jose Delarosa (@jose-delarosa)

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 6.6.8

Description

Builds Redfish URIs locally and sends them to remote iDRAC controllers to get information back.

For use with Dell EMC iDRAC operations that require Redfish OEM extensions.

This module was called C(idrac_redfish_facts) before Ansible 2.9, returning C(ansible_facts). Note that the M(community.general.idrac_redfish_info) module no longer returns C(ansible_facts)!

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Get Manager attributes with a default of 20 seconds
    community.general.idrac_redfish_info:
      category: Manager
      command: GetManagerAttributes
      baseuri: "{{ baseuri }}"
      username: "{{ username }}"
      password: "{{ password }}"
      timeout: 20
    register: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  # Examples to display the value of all or a single iDRAC attribute
  - name: Store iDRAC attributes as a fact variable
    ansible.builtin.set_fact:
      idrac_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'iDRACAttributes') | list | first }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Display all iDRAC attributes
    ansible.builtin.debug:
      var: idrac_attributes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Display the value of 'Syslog.1.SysLogEnable' iDRAC attribute
    ansible.builtin.debug:
      var: idrac_attributes['Syslog.1.SysLogEnable']
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  # Examples to display the value of all or a single LifecycleController attribute
  - name: Store LifecycleController attributes as a fact variable
    ansible.builtin.set_fact:
      lc_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'LCAttributes') | list | first }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Display LifecycleController attributes
    ansible.builtin.debug:
      var: lc_attributes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Display the value of 'CollectSystemInventoryOnRestart' attribute
    ansible.builtin.debug:
      var: lc_attributes['LCAttributes.1.CollectSystemInventoryOnRestart']
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  # Examples to display the value of all or a single System attribute
  - name: Store System attributes as a fact variable
    ansible.builtin.set_fact:
      system_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'SystemAttributes') | list | first }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Display System attributes
    ansible.builtin.debug:
      var: system_attributes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Display the value of 'PSRedPolicy'
    ansible.builtin.debug:
      var: system_attributes['ServerPwr.1.PSRedPolicy']

Inputs

    
baseuri:
    description:
    - Base URI of iDRAC.
    required: true
    type: str

command:
    description:
    - List of commands to execute on iDRAC.
    - C(GetManagerAttributes) returns the list of dicts containing iDRAC, LifecycleController
      and System attributes.
    elements: str
    required: true
    type: list

timeout:
    default: 10
    description:
    - Timeout in seconds for HTTP requests to iDRAC.
    type: int

category:
    description:
    - Category to execute on iDRAC.
    required: true
    type: str

password:
    description:
    - Password for authenticating to iDRAC.
    type: str

username:
    description:
    - Username for authenticating to iDRAC.
    type: str

auth_token:
    description:
    - Security token for authenticating to iDRAC.
    type: str
    version_added: 2.3.0
    version_added_collection: community.general

Outputs

msg:
  description: different results depending on task
  returned: always
  sample: List of Manager attributes
  type: dict