Skip to content

Commit

Permalink
Dell PwrButton requires a job initated at reboot (#9012)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Rubueno authored Oct 10, 2024
1 parent 3de4682 commit 67ddb56
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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).
10 changes: 9 additions & 1 deletion plugins/module_utils/redfish_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2311,11 +2311,19 @@ def set_bios_attributes(self, attributes):

# 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):
Expand Down

0 comments on commit 67ddb56

Please sign in to comment.