mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
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>
This commit is contained in:
@@ -359,6 +359,16 @@ EXAMPLES = '''
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
|
||||
- name: Check the availability of the service with a timeout of 5 seconds
|
||||
community.general.redfish_info:
|
||||
category: Service
|
||||
command: CheckAvailability
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
timeout: 5
|
||||
register: result
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
@@ -385,6 +395,7 @@ CATEGORY_COMMANDS_ALL = {
|
||||
"GetUpdateStatus"],
|
||||
"Manager": ["GetManagerNicInventory", "GetVirtualMedia", "GetLogs", "GetNetworkProtocols",
|
||||
"GetHealthReport", "GetHostInterfaces", "GetManagerInventory", "GetServiceIdentification"],
|
||||
"Service": ["CheckAvailability"],
|
||||
}
|
||||
|
||||
CATEGORY_COMMANDS_DEFAULT = {
|
||||
@@ -393,7 +404,8 @@ CATEGORY_COMMANDS_DEFAULT = {
|
||||
"Accounts": "ListUsers",
|
||||
"Update": "GetFirmwareInventory",
|
||||
"Sessions": "GetSessions",
|
||||
"Manager": "GetManagerNicInventory"
|
||||
"Manager": "GetManagerNicInventory",
|
||||
"Service": "CheckAvailability",
|
||||
}
|
||||
|
||||
|
||||
@@ -473,7 +485,13 @@ def main():
|
||||
module.fail_json(msg="Invalid Category: %s" % category)
|
||||
|
||||
# Organize by Categories / Commands
|
||||
if category == "Systems":
|
||||
if category == "Service":
|
||||
# service-level commands are always available
|
||||
for command in command_list:
|
||||
if command == "CheckAvailability":
|
||||
result["service"] = rf_utils.check_service_availability()
|
||||
|
||||
elif category == "Systems":
|
||||
# execute only if we find a Systems resource
|
||||
resource = rf_utils._find_systems_resource()
|
||||
if resource['ret'] is False:
|
||||
|
||||
Reference in New Issue
Block a user