From 13035e2a2c74577d69cf033b140d0d8ef32ae466 Mon Sep 17 00:00:00 2001 From: Scott Seekamp <13857911+sseekamp@users.noreply.github.com> Date: Fri, 2 Jan 2026 09:58:49 -0700 Subject: [PATCH] Add support for multiple managers to get_manager_attributes command in idrac_redfish_info module (#11301) * Update get_manager_attributes method to support systems with multiple managers present Fixes https://github.com/ansible-collections/community.general/issues/11294 * Add changelog fragment Pre-define reponse for get_manager_attributes method * Update changelogs/fragments/11301-idrac-info-multi-manager.yml Update per suggestion! Co-authored-by: Felix Fontein * Update plugins/modules/idrac_redfish_info.py Remove extra manager quantity check Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein --- changelogs/fragments/11301-idrac-info-multi-manager.yml | 2 ++ plugins/modules/idrac_redfish_info.py | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/11301-idrac-info-multi-manager.yml diff --git a/changelogs/fragments/11301-idrac-info-multi-manager.yml b/changelogs/fragments/11301-idrac-info-multi-manager.yml new file mode 100644 index 0000000000..738e11610e --- /dev/null +++ b/changelogs/fragments/11301-idrac-info-multi-manager.yml @@ -0,0 +1,2 @@ +minor_changes: + - idrac_redfish_info - add multiple manager support to ``GetManagerAttributes`` command (https://github.com/ansible-collections/community.general/pull/11294). diff --git a/plugins/modules/idrac_redfish_info.py b/plugins/modules/idrac_redfish_info.py index 2b515722d7..fbb16cdec3 100644 --- a/plugins/modules/idrac_redfish_info.py +++ b/plugins/modules/idrac_redfish_info.py @@ -138,10 +138,14 @@ from ansible_collections.community.general.plugins.module_utils.redfish_utils im class IdracRedfishUtils(RedfishUtils): def get_manager_attributes(self): result = {} + response = {} manager_attributes = [] properties = ["Attributes", "Id"] - response = self.get_request(self.root_uri + self.manager_uri) + if len(self.manager_uris) == 1: + response = self.get_request(f"{self.root_uri}{self.manager_uri}") + elif len(self.manager_uris) > 1: + response = self.get_request(f"{self.root_uri}/redfish/v1/Managers/iDRAC.Embedded.1", override_headers=None) if response["ret"] is False: return response