From 359b546d99751a2631f05bd0a09a0df49e10db28 Mon Sep 17 00:00:00 2001 From: Shiva Shankar Vaddepally Date: Mon, 17 Nov 2025 05:49:06 +0000 Subject: [PATCH] adding get_args key for hanode Signed-off-by: Shiva Shankar Vaddepally --- examples/reboot.yaml | 9 +++++++++ plugins/module_utils/common.py | 2 ++ plugins/module_utils/module_executor.py | 2 ++ plugins/module_utils/nitro_resource_map.py | 2 +- plugins/modules/reboot.py | 3 ++- 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 examples/reboot.yaml diff --git a/examples/reboot.yaml b/examples/reboot.yaml new file mode 100644 index 00000000..cecaebb4 --- /dev/null +++ b/examples/reboot.yaml @@ -0,0 +1,9 @@ +--- +- name: Reboot a system + hosts: localhost + gather_facts: false + tasks: + - name: Reboot the NetScaler ADC node + delegate_to: localhost + netscaler.adc.reboot: + state: rebooted diff --git a/plugins/module_utils/common.py b/plugins/module_utils/common.py index 03d7b1ce..ba57fde1 100644 --- a/plugins/module_utils/common.py +++ b/plugins/module_utils/common.py @@ -663,6 +663,8 @@ def get_valid_desired_states(resource_name): desired_states.add("renamed") if "apply" in supported_operations: desired_states.add("applied") + if "reboot" in supported_operations: + desired_states.add("rebooted") return desired_states diff --git a/plugins/module_utils/module_executor.py b/plugins/module_utils/module_executor.py index 9e1df85a..06f3d382 100644 --- a/plugins/module_utils/module_executor.py +++ b/plugins/module_utils/module_executor.py @@ -1198,6 +1198,7 @@ def main(self): "unset", "renamed", "applied", + "rebooted", }: state_action_map = { "created": "create", @@ -1207,6 +1208,7 @@ def main(self): "unset": "unset", "renamed": "rename", "applied": "apply", + "rebooted": "reboot", } self.act_on_resource( action=state_action_map[self.module.params["state"]] diff --git a/plugins/module_utils/nitro_resource_map.py b/plugins/module_utils/nitro_resource_map.py index d078ff2c..527dbc7d 100644 --- a/plugins/module_utils/nitro_resource_map.py +++ b/plugins/module_utils/nitro_resource_map.py @@ -48706,7 +48706,7 @@ "update_payload_keys": ["name", "psk", "rdpip", "rdpport", "rdpredirection"], }, "reboot": { - "_supported_operations": ["Reboot"], + "_supported_operations": ["reboot"], "action_payload_keys": { "apply": [], "create": [], diff --git a/plugins/modules/reboot.py b/plugins/modules/reboot.py index 8c736b43..c1e44d4f 100644 --- a/plugins/modules/reboot.py +++ b/plugins/modules/reboot.py @@ -27,7 +27,8 @@ - Shiva Shankar Vaddepally (@shivashankar-vaddepally) options: state: - choices: [] + choices: + - rebooted default: present description: - The state of the resource being configured by the module on the NetScaler