From 00f5f7dfe73b75d781b4b26e8493749bc64612e8 Mon Sep 17 00:00:00 2001 From: Bill Dodd Date: Fri, 29 Jan 2021 00:17:57 -0600 Subject: [PATCH] Add Name and/or Id properties to resource inventory output (#1691) * add Name and/or Id properties to resource inventory output * add changelog fragment --- ...-and-id-props-to-redfish-inventory-output.yml | 2 ++ plugins/module_utils/redfish_utils.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 changelogs/fragments/1691-add-name-and-id-props-to-redfish-inventory-output.yml diff --git a/changelogs/fragments/1691-add-name-and-id-props-to-redfish-inventory-output.yml b/changelogs/fragments/1691-add-name-and-id-props-to-redfish-inventory-output.yml new file mode 100644 index 0000000000..1cf8897018 --- /dev/null +++ b/changelogs/fragments/1691-add-name-and-id-props-to-redfish-inventory-output.yml @@ -0,0 +1,2 @@ +bugfixes: + - redfish_info module, redfish_utils module utils - add ``Name`` and ``Id`` properties to output of Redfish inventory commands (https://github.com/ansible-collections/community.general/issues/1650). diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py index 79ef7213b9..8f14dbad78 100644 --- a/plugins/module_utils/redfish_utils.py +++ b/plugins/module_utils/redfish_utils.py @@ -469,7 +469,7 @@ class RedfishUtils(object): controller_results = [] # Get these entries, but does not fail if not found properties = ['CacheSummary', 'FirmwareVersion', 'Identifiers', - 'Location', 'Manufacturer', 'Model', 'Name', + 'Location', 'Manufacturer', 'Model', 'Name', 'Id', 'PartNumber', 'SerialNumber', 'SpeedGbps', 'Status'] key = "StorageControllers" @@ -1700,7 +1700,7 @@ class RedfishUtils(object): chassis_results = [] # Get these entries, but does not fail if not found - properties = ['ChassisType', 'PartNumber', 'AssetTag', + properties = ['Name', 'Id', 'ChassisType', 'PartNumber', 'AssetTag', 'Manufacturer', 'IndicatorLED', 'SerialNumber', 'Model'] # Go through list @@ -1724,7 +1724,7 @@ class RedfishUtils(object): fan_results = [] key = "Thermal" # Get these entries, but does not fail if not found - properties = ['FanName', 'Reading', 'ReadingUnits', 'Status'] + properties = ['Name', 'FanName', 'Reading', 'ReadingUnits', 'Status'] # Go through list for chassis_uri in self.chassis_uris: @@ -1836,8 +1836,8 @@ class RedfishUtils(object): cpu_results = [] key = "Processors" # Get these entries, but does not fail if not found - properties = ['Id', 'Manufacturer', 'Model', 'MaxSpeedMHz', 'TotalCores', - 'TotalThreads', 'Status'] + properties = ['Id', 'Name', 'Manufacturer', 'Model', 'MaxSpeedMHz', + 'TotalCores', 'TotalThreads', 'Status'] # Search for 'key' entry and extract URI from it response = self.get_request(self.root_uri + systems_uri) @@ -1886,7 +1886,7 @@ class RedfishUtils(object): memory_results = [] key = "Memory" # Get these entries, but does not fail if not found - properties = ['SerialNumber', 'MemoryDeviceType', 'PartNumber', + properties = ['Id', 'SerialNumber', 'MemoryDeviceType', 'PartNumber', 'MemoryLocation', 'RankCount', 'CapacityMiB', 'OperatingMemoryModes', 'Status', 'Manufacturer', 'Name'] # Search for 'key' entry and extract URI from it @@ -1943,7 +1943,7 @@ class RedfishUtils(object): nic_results = [] key = "EthernetInterfaces" # Get these entries, but does not fail if not found - properties = ['Description', 'FQDN', 'IPv4Addresses', 'IPv6Addresses', + properties = ['Name', 'Id', 'Description', 'FQDN', 'IPv4Addresses', 'IPv6Addresses', 'NameServers', 'MACAddress', 'PermanentMACAddress', 'SpeedMbps', 'MTUSize', 'AutoNeg', 'Status'] @@ -2368,7 +2368,7 @@ class RedfishUtils(object): properties = ['Status', 'HostName', 'PowerState', 'Model', 'Manufacturer', 'PartNumber', 'SystemType', 'AssetTag', 'ServiceTag', 'SerialNumber', 'SKU', 'BiosVersion', 'MemorySummary', - 'ProcessorSummary', 'TrustedModules'] + 'ProcessorSummary', 'TrustedModules', 'Name', 'Id'] response = self.get_request(self.root_uri + systems_uri) if response['ret'] is False: