From 21a840eab7ddc8c1720c1a0e65dab8c97d46a96a Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 22:24:53 +0200 Subject: [PATCH] [PR #9012/67ddb567 backport][stable-9] Dell PwrButton requires a job initated at reboot (#9015) Dell PwrButton requires a job initated at reboot (#9012) Dell systems do not change the bios setting PwrButton right away. The command will return changed=true, but it is not applied. Also no job is scheduled at next reboot for the change to take place. This patch aims to fix this issue. (cherry picked from commit 67ddb567c90f6a03dd3a9a3e2c4873c415b07e0d) Co-authored-by: Ruben Bosch <8641284+Rubueno@users.noreply.github.com> --- ...ll-pwrbutton-requires-a-job-initiated-at-reboot.yml | 4 ++++ plugins/module_utils/redfish_utils.py | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/9012-dell-pwrbutton-requires-a-job-initiated-at-reboot.yml diff --git a/changelogs/fragments/9012-dell-pwrbutton-requires-a-job-initiated-at-reboot.yml b/changelogs/fragments/9012-dell-pwrbutton-requires-a-job-initiated-at-reboot.yml new file mode 100644 index 0000000000..131ee68c7c --- /dev/null +++ b/changelogs/fragments/9012-dell-pwrbutton-requires-a-job-initiated-at-reboot.yml @@ -0,0 +1,4 @@ +minor_changes: + - redfish_utils module utils - schedule a BIOS configuration job at next + reboot when the BIOS config is changed + (https://github.com/ansible-collections/community.general/pull/9012). diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py index 28d6f2ef0c..2ef928e510 100644 --- a/plugins/module_utils/redfish_utils.py +++ b/plugins/module_utils/redfish_utils.py @@ -2311,11 +2311,19 @@ class RedfishUtils(object): # Construct payload and issue PATCH command payload = {"Attributes": attrs_to_patch} + + # WORKAROUND + # Dell systems require manually setting the apply time to "OnReset" + # to spawn a proprietary job to apply the BIOS settings + vendor = self._get_vendor()['Vendor'] + if vendor == 'Dell': + payload.update({"@Redfish.SettingsApplyTime": {"ApplyTime": "OnReset"}}) + response = self.patch_request(self.root_uri + set_bios_attr_uri, payload) if response['ret'] is False: return response return {'ret': True, 'changed': True, - 'msg': "Modified BIOS attributes %s" % (attrs_to_patch), + 'msg': "Modified BIOS attributes %s. A reboot is required" % (attrs_to_patch), 'warning': warning} def set_boot_order(self, boot_list):