[PR #8434/961767e2 backport][stable-9] Redfish: Add options to check the availability of the service (#8457)

Redfish: Add options to check the availability of the service (#8434)

* Redfish: Add options to check the availability of the service

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Updates based on review feedback

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Updated comment to reflect changed behavior

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Added changelog fragments

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Update changelogs/fragments/8051-Redfish-Wait-For-Service.yml

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_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_command.py

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

---------

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 961767e2dd)

Co-authored-by: Mike Raineri <mraineri@gmail.com>
This commit is contained in:
patchback[bot] 2024-06-03 07:15:58 +02:00 committed by GitHub
parent 9b8011d692
commit f214f206c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 102 additions and 9 deletions

View file

@ -288,6 +288,20 @@ options:
type: str
choices: [ ResetAll, PreserveNetworkAndUsers, PreserveNetwork ]
version_added: 8.6.0
wait:
required: false
description:
- Block until the service is ready again.
type: bool
default: false
version_added: 9.1.0
wait_timeout:
required: false
description:
- How long to block until the service is ready again before giving up.
type: int
default: 120
version_added: 9.1.0
author:
- "Jose Delarosa (@jose-delarosa)"
@ -685,6 +699,16 @@ EXAMPLES = '''
username: "{{ username }}"
password: "{{ password }}"
- name: Restart manager power gracefully and wait for it to be available
community.general.redfish_command:
category: Manager
command: GracefulRestart
resource_id: BMC
baseuri: "{{ baseuri }}"
username: "{{ username }}"
password: "{{ password }}"
wait: True
- name: Restart manager power gracefully
community.general.redfish_command:
category: Manager
@ -841,7 +865,9 @@ def main():
),
strip_etag_quotes=dict(type='bool', default=False),
reset_to_defaults_mode=dict(choices=['ResetAll', 'PreserveNetworkAndUsers', 'PreserveNetwork']),
bios_attributes=dict(type="dict")
bios_attributes=dict(type="dict"),
wait=dict(type='bool', default=False),
wait_timeout=dict(type='int', default=120),
),
required_together=[
('username', 'password'),
@ -1016,7 +1042,7 @@ def main():
command = 'PowerGracefulRestart'
if command.startswith('Power'):
result = rf_utils.manage_manager_power(command)
result = rf_utils.manage_manager_power(command, module.params['wait'], module.params['wait_timeout'])
elif command == 'ClearLogs':
result = rf_utils.clear_logs()
elif command == 'VirtualMediaInsert':