Repository: ansible-collections/community.general

Issue:
IndicatorLED / Systems / redfish_command.py 
### Summary

Hi all,

IndicatorLED is implemented for Chassis, not Systems.

Is it possible to add it in:
community.general/plugins/modules/remote_management/redfish/redfish_command.py  

Best Regards,
Francine

### Issue Type

Feature Idea

### Component Name

module community.general/plugins/modules/remote_management/redfish/redfish_command.py

### Additional Information

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
  - name: Set system indicator LED to blink using security token for auth
    community.general.redfish_command:
      category: Systems
      command: IndicatorLedBlink
      resource_id: system
      baseuri: "{{ baseuri }}"
      auth_token: "{{ result.session.token }}"
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:
Files identified in the description:
* [`plugins/modules/remote_management/redfish/redfish_command.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/remote_management/redfish/redfish_command.py)
* [`plugins/modules/system/python_requirements_info.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/system/python_requirements_info.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @bhavya06 @mraineri @rajeevkallur @renxulei @tomasg2012 @willthames @xmadsen
[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: notify --->
From the perspective of the standard, it is allowed in both places. We can certainly add a command to allow a user to manage it under Chassis.
Hi Mike,
Yes, it could be nice :-) 
Kind Regards,
Francine

Resolving patch:
diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py
--- a/plugins/module_utils/redfish_utils.py
+++ b/plugins/module_utils/redfish_utils.py
@@ -732,14 +732,22 @@ def get_volume_inventory(self, systems_uri):
     def get_multi_volume_inventory(self):
         return self.aggregate_systems(self.get_volume_inventory)
 
-    def manage_indicator_led(self, command):
+    def manage_system_indicator_led(self, command):
+        return self.manage_indicator_led(command, self.systems_uri)
+
+    def manage_chassis_indicator_led(self, command):
+        return self.manage_indicator_led(command, self.chassis_uri)
+
+    def manage_indicator_led(self, command, resource_uri=None):
         result = {}
         key = 'IndicatorLED'
+        if resource_uri is None:
+            resource_uri = self.chassis_uri
 
         payloads = {'IndicatorLedOn': 'Lit', 'IndicatorLedOff': 'Off', "IndicatorLedBlink": 'Blinking'}
 
         result = {}
-        response = self.get_request(self.root_uri + self.chassis_uri)
+        response = self.get_request(self.root_uri + resource_uri)
         if response['ret'] is False:
             return response
         result['ret'] = True
@@ -749,7 +757,7 @@ def manage_indicator_led(self, command):
 
         if command in payloads.keys():
             payload = {'IndicatorLED': payloads[command]}
-            response = self.patch_request(self.root_uri + self.chassis_uri, payload)
+            response = self.patch_request(self.root_uri + resource_uri, payload)
             if response['ret'] is False:
                 return response
         else:
diff --git a/plugins/modules/remote_management/redfish/redfish_command.py b/plugins/modules/remote_management/redfish/redfish_command.py
--- a/plugins/modules/remote_management/redfish/redfish_command.py
+++ b/plugins/modules/remote_management/redfish/redfish_command.py
@@ -318,6 +318,14 @@
       category: Systems
       command: DisableBootOverride
 
+  - name: Set system indicator LED to blink using security token for auth
+    community.general.redfish_command:
+      category: Systems
+      command: IndicatorLedBlink
+      resource_id: 437XR1138R2
+      baseuri: "{{ baseuri }}"
+      auth_token: "{{ result.session.token }}"
+
   - name: Add user
     community.general.redfish_command:
       category: Accounts
@@ -583,7 +591,8 @@
 # More will be added as module features are expanded
 CATEGORY_COMMANDS_ALL = {
     "Systems": ["PowerOn", "PowerForceOff", "PowerForceRestart", "PowerGracefulRestart",
-                "PowerGracefulShutdown", "PowerReboot", "SetOneTimeBoot", "EnableContinuousBootOverride", "DisableBootOverride"],
+                "PowerGracefulShutdown", "PowerReboot", "SetOneTimeBoot", "EnableContinuousBootOverride", "DisableBootOverride",
+                "IndicatorLedOn", "IndicatorLedOff", "IndicatorLedBlink"],
     "Chassis": ["IndicatorLedOn", "IndicatorLedOff", "IndicatorLedBlink"],
     "Accounts": ["AddUser", "EnableUser", "DeleteUser", "DisableUser",
                  "UpdateUserRole", "UpdateUserPassword", "UpdateUserName",
@@ -754,6 +763,8 @@ def main():
             elif command == "DisableBootOverride":
                 boot_opts['override_enabled'] = 'Disabled'
                 result = rf_utils.set_boot_override(boot_opts)
+            elif command.startswith('IndicatorLed'):
+                result = rf_utils.manage_system_indicator_led(command)
 
     elif category == "Chassis":
         result = rf_utils._find_chassis_resource()
@@ -769,7 +780,7 @@ def main():
         else:
             for command in command_list:
                 if command in led_commands:
-                    result = rf_utils.manage_indicator_led(command)
+                    result = rf_utils.manage_chassis_indicator_led(command)
 
     elif category == "Sessions":
         # execute only if we find SessionService resources


Test patch: