diff --git a/changelogs/fragments/2090-idrac-redfish-resource-id-fix.yml b/changelogs/fragments/2090-idrac-redfish-resource-id-fix.yml new file mode 100644 index 0000000000..e386cb1416 --- /dev/null +++ b/changelogs/fragments/2090-idrac-redfish-resource-id-fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - idrac_redfish_command - allow user to specify ``resource_id`` for ``CreateBiosConfigJob`` to specify an exact manager (https://github.com/ansible-collections/community.general/issues/2090). diff --git a/plugins/modules/idrac_redfish_command.py b/plugins/modules/idrac_redfish_command.py index 54efdea134..d760a2c3a3 100644 --- a/plugins/modules/idrac_redfish_command.py +++ b/plugins/modules/idrac_redfish_command.py @@ -207,7 +207,20 @@ def main(): if category == "Systems": # execute only if we find a System resource + # NOTE: Currently overriding the usage of 'data_modification' due to + # how 'resource_id' is processed. In the case of CreateBiosConfigJob, + # we interact with BOTH systems and managers, so you currently cannot + # specify a single 'resource_id' to make both '_find_systems_resource' + # and '_find_managers_resource' return success. Since + # CreateBiosConfigJob doesn't use the matched 'resource_id' for a + # system regardless of what's specified, disabling the 'resource_id' + # inspection for the next call allows a specific manager to be + # specified with 'resource_id'. If we ever need to expand the input + # to inspect a specific system and manager in parallel, this will need + # updates. + rf_utils.data_modification = False result = rf_utils._find_systems_resource() + rf_utils.data_modification = True if result['ret'] is False: module.fail_json(msg=to_native(result['msg']))