community / community.general / 0.1.4 / module / idrac_redfish_facts Gather PowerEdge server information through iDRAC using Redfish APIs Authors: Jose Delarosa (@jose-delarosa)community.general.idrac_redfish_facts (0.1.4) — module
Install with ansible-galaxy collection install community.general:==0.1.4
collections: - name: community.general version: 0.1.4
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(idrac_redfish_info) module no longer returns C(ansible_facts)!
- name: Get Manager attributes with a default of 20 seconds idrac_redfish_info: category: Manager command: GetManagerAttributes baseuri: "{{ baseuri }}" username: "{{ username }}" password: "{{ password }}" timeout: 20 register: result
# Examples to display the value of all or a single iDRAC attribute - name: Store iDRAC attributes as a fact variable set_fact: idrac_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'iDRACAttributes') | list | first }}"
- name: Display all iDRAC attributes debug: var: idrac_attributes
- name: Display the value of 'Syslog.1.SysLogEnable' iDRAC attribute debug: var: idrac_attributes['Syslog.1.SysLogEnable']
# Examples to display the value of all or a single LifecycleController attribute - name: Store LifecycleController attributes as a fact variable set_fact: lc_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'LCAttributes') | list | first }}"
- name: Display LifecycleController attributes debug: var: lc_attributes
- name: Display the value of 'CollectSystemInventoryOnRestart' attribute debug: var: lc_attributes['LCAttributes.1.CollectSystemInventoryOnRestart']
# Examples to display the value of all or a single System attribute - name: Store System attributes as a fact variable set_fact: system_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'SystemAttributes') | list | first }}"
- name: Display System attributes debug: var: system_attributes
- name: Display the value of 'PSRedPolicy' debug: var: system_attributes['ServerPwr.1.PSRedPolicy']
baseuri: description: - Base URI of iDRAC controller required: true type: str command: description: - List of commands to execute on iDRAC controller - C(GetManagerAttributes) returns the list of dicts containing iDRAC, LifecycleController and System attributes required: true type: list timeout: default: 10 description: - Timeout in seconds for URL requests to OOB controller type: int category: description: - Category to execute on iDRAC controller required: true type: str password: description: - Password for authentication with iDRAC controller required: true type: str username: description: - User for authentication with iDRAC controller required: true type: str
msg: description: different results depending on task returned: always sample: List of Manager attributes type: dict