Redfish: Expanded SimpleUpdate command to allow for users to monitor the progress of an update and perform follow-up operations (#5580)

* Redfish: Expanded SimpleUpdate command to allow for users to monitor the progress of an update and perform follow-up operations

* Update changelogs/fragments/3910-redfish-add-operation-apply-time-to-simple-update.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/redfish_command.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/4276-redfish-command-updates-for-full-simple-update-workflow.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Updated based on feedback and CI results

* Update plugins/modules/redfish_command.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/redfish_command.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/redfish_info.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Mike Raineri 2022-11-23 01:46:39 -05:00 committed by GitHub
parent 3bf3d6bff4
commit 5c1c8152ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 218 additions and 8 deletions

View file

@ -58,6 +58,12 @@ options:
- Timeout in seconds for HTTP requests to OOB controller.
default: 10
type: int
update_handle:
required: false
description:
- Handle to check the status of an update in progress.
type: str
version_added: '6.1.0'
author: "Jose Delarosa (@jose-delarosa)"
'''
@ -247,6 +253,15 @@ EXAMPLES = '''
username: "{{ username }}"
password: "{{ password }}"
- name: Get the status of an update operation
community.general.redfish_info:
category: Update
command: GetUpdateStatus
baseuri: "{{ baseuri }}"
username: "{{ username }}"
password: "{{ password }}"
update_handle: /redfish/v1/TaskService/TaskMonitors/735
- name: Get Manager Services
community.general.redfish_info:
category: Manager
@ -324,7 +339,8 @@ CATEGORY_COMMANDS_ALL = {
"GetChassisThermals", "GetChassisInventory", "GetHealthReport"],
"Accounts": ["ListUsers"],
"Sessions": ["GetSessions"],
"Update": ["GetFirmwareInventory", "GetFirmwareUpdateCapabilities", "GetSoftwareInventory"],
"Update": ["GetFirmwareInventory", "GetFirmwareUpdateCapabilities", "GetSoftwareInventory",
"GetUpdateStatus"],
"Manager": ["GetManagerNicInventory", "GetVirtualMedia", "GetLogs", "GetNetworkProtocols",
"GetHealthReport", "GetHostInterfaces", "GetManagerInventory"],
}
@ -350,7 +366,8 @@ def main():
username=dict(),
password=dict(no_log=True),
auth_token=dict(no_log=True),
timeout=dict(type='int', default=10)
timeout=dict(type='int', default=10),
update_handle=dict(),
),
required_together=[
('username', 'password'),
@ -372,6 +389,9 @@ def main():
# timeout
timeout = module.params['timeout']
# update handle
update_handle = module.params['update_handle']
# Build root URI
root_uri = "https://" + module.params['baseuri']
rf_utils = RedfishUtils(creds, root_uri, timeout, module)
@ -482,6 +502,8 @@ def main():
result["software"] = rf_utils.get_software_inventory()
elif command == "GetFirmwareUpdateCapabilities":
result["firmware_update_capabilities"] = rf_utils.get_firmware_update_capabilities()
elif command == "GetUpdateStatus":
result["update_status"] = rf_utils.get_update_status(update_handle)
elif category == "Sessions":
# execute only if we find SessionService resources