Skip to content

Commit e5df82f

Browse files
Merge pull request #568 from netscaler/reboot
supporting reboot action
2 parents 15dff41 + 359b546 commit e5df82f

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

examples/reboot.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
- name: Reboot a system
3+
hosts: localhost
4+
gather_facts: false
5+
tasks:
6+
- name: Reboot the NetScaler ADC node
7+
delegate_to: localhost
8+
netscaler.adc.reboot:
9+
state: rebooted

plugins/module_utils/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ def get_valid_desired_states(resource_name):
663663
desired_states.add("renamed")
664664
if "apply" in supported_operations:
665665
desired_states.add("applied")
666+
if "reboot" in supported_operations:
667+
desired_states.add("rebooted")
666668
return desired_states
667669

668670

plugins/module_utils/module_executor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,7 @@ def main(self):
11981198
"unset",
11991199
"renamed",
12001200
"applied",
1201+
"rebooted",
12011202
}:
12021203
state_action_map = {
12031204
"created": "create",
@@ -1207,6 +1208,7 @@ def main(self):
12071208
"unset": "unset",
12081209
"renamed": "rename",
12091210
"applied": "apply",
1211+
"rebooted": "reboot",
12101212
}
12111213
self.act_on_resource(
12121214
action=state_action_map[self.module.params["state"]]

plugins/module_utils/nitro_resource_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48706,7 +48706,7 @@
4870648706
"update_payload_keys": ["name", "psk", "rdpip", "rdpport", "rdpredirection"],
4870748707
},
4870848708
"reboot": {
48709-
"_supported_operations": ["Reboot"],
48709+
"_supported_operations": ["reboot"],
4871048710
"action_payload_keys": {
4871148711
"apply": [],
4871248712
"create": [],

plugins/modules/reboot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
- Shiva Shankar Vaddepally (@shivashankar-vaddepally)
2828
options:
2929
state:
30-
choices: []
30+
choices:
31+
- rebooted
3132
default: present
3233
description:
3334
- The state of the resource being configured by the module on the NetScaler

0 commit comments

Comments
 (0)