Skip to content

Commit c1bb406

Browse files
author
Shiva Shankar Vaddepally
committed
Supporting operations install
Signed-off-by: Shiva Shankar Vaddepally <[email protected]>
1 parent 8ca74ce commit c1bb406

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

plugins/module_utils/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,8 @@ def get_valid_desired_states(resource_name):
601601
desired_states.add("switched")
602602
if "unset" in supported_operations:
603603
desired_states.add("unset")
604+
if "Install" in supported_operations or "install" in supported_operations:
605+
desired_states.add("installed")
604606
return desired_states
605607

606608

plugins/module_utils/module_executor.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,13 @@ def is_resource_identical(self):
364364
return (False, immutable_resource_module_params)
365365

366366
return (False, None) if diff_list else (True, None)
367-
367+
@trace
368+
def install(self):
369+
ok, err = create_resource(
370+
self.client, self.resource_name, self.resource_module_params
371+
)
372+
if not ok:
373+
self.return_failure(err)
368374
@trace
369375
def create_or_update(self):
370376
self.update_diff_list(
@@ -957,6 +963,9 @@ def main(self):
957963
if "bindings" in NITRO_RESOURCE_MAP[self.resource_name].keys():
958964
self.sync_all_bindings()
959965

966+
elif self.resource_name == "install" and self.module.params["state"] == "installed":
967+
self.install()
968+
960969
elif self.module.params["state"] in {
961970
"created",
962971
"imported",

plugins/modules/install.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,21 @@
1919
DOCUMENTATION = r"""
2020
---
2121
module: install
22-
short_description: Configuration for 0 resource.
23-
description: Configuration for 0 resource.
22+
short_description: Configuration for install resource.
23+
description: Configuration for install resource.
2424
version_added: 2.0.0
2525
author:
2626
- Sumanth Lingappa (@sumanth-lingappa)
2727
- Shiva Shankar Vaddepally (@shivashankar-vaddepally)
2828
options:
2929
state:
30-
choices: []
30+
choices:
31+
- installed
3132
default: present
3233
description:
3334
- The state of the resource being configured by the module on the NetScaler
3435
ADC node.
36+
- When C(Install), the resource will be installed on the NetScaler ADC node.
3537
type: str
3638
async:
3739
type: bool

0 commit comments

Comments
 (0)