Add GetHostInterfaces command to redfish_info (#3693)

* Add GetHostInterfaces command to redfish_info

Adding a GetHostInterfaces command to redfish_info in order to report the
following:
- Properties about the HostInterface(s) like Status, InterfaceEnabled, etc
- ManagerEthernetInterface (info on BMC -> host NIC)
- HostEthernetInterfaces (list of NICs for host -> BMC connectivity)

fixes #3692

* add fragment

* fixup for linter

* redfish_utils.py cleanup

- Remove unneeded Properties list from get_nic_inventory()
- Remove bogus key variable from get_hostinterfaces()
- Add additional Properties to collect from HostInterface objects

* fixup for stray deletion
This commit is contained in:
Jacob 2021-11-16 13:46:28 -05:00 committed by GitHub
commit 98cca3c19c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 110 additions and 17 deletions

View file

@ -269,6 +269,14 @@ EXAMPLES = '''
baseuri: "{{ baseuri }}"
username: "{{ username }}"
password: "{{ password }}"
- name: Get manager Redfish Host Interface inventory
community.general.redfish_info:
category: Manager
command: GetHostInterfaces
baseuri: "{{ baseuri }}"
username: "{{ username }}"
password: "{{ password }}"
'''
RETURN = '''
@ -293,7 +301,7 @@ CATEGORY_COMMANDS_ALL = {
"Sessions": ["GetSessions"],
"Update": ["GetFirmwareInventory", "GetFirmwareUpdateCapabilities", "GetSoftwareInventory"],
"Manager": ["GetManagerNicInventory", "GetVirtualMedia", "GetLogs", "GetNetworkProtocols",
"GetHealthReport"],
"GetHealthReport", "GetHostInterfaces"],
}
CATEGORY_COMMANDS_DEFAULT = {
@ -475,6 +483,8 @@ def main():
result["network_protocols"] = rf_utils.get_network_protocols()
elif command == "GetHealthReport":
result["health_report"] = rf_utils.get_multi_manager_health_report()
elif command == "GetHostInterfaces":
result["host_interfaces"] = rf_utils.get_hostinterfaces()
# Return data back
module.exit_json(redfish_facts=result)