module_utils/redfish_utils.py: add ForceRestart option (#61104)

The library does not allow you to force a restart via redfish, (unless GracefulRestart
triggered by PowerReboot-command is not supported).
Therefore, I added the option `PowerForceRestart` to be able to force a reboot of an
unresponsive host.
pull/61322/head
digi 5 years ago committed by Gonéri Le Bouder
parent 5941e4c843
commit 7f06db8211

@ -647,6 +647,8 @@ class RedfishUtils(object):
payload = {'ResetType': 'On'}
elif command == "PowerForceOff":
payload = {'ResetType': 'ForceOff'}
elif command == "PowerForceRestart":
payload = {'ResetType': "ForceRestart"}
elif command == "PowerGracefulRestart":
payload = {'ResetType': 'GracefulRestart'}
elif command == "PowerGracefulShutdown":

@ -202,7 +202,7 @@ from ansible.module_utils._text import to_native
# More will be added as module features are expanded
CATEGORY_COMMANDS_ALL = {
"Systems": ["PowerOn", "PowerForceOff", "PowerGracefulRestart",
"Systems": ["PowerOn", "PowerForceOff", "PowerForceRestart", "PowerGracefulRestart",
"PowerGracefulShutdown", "PowerReboot", "SetOneTimeBoot"],
"Chassis": ["IndicatorLedOn", "IndicatorLedOff", "IndicatorLedBlink"],
"Accounts": ["AddUser", "EnableUser", "DeleteUser", "DisableUser",

Loading…
Cancel
Save