Skip to content

Commit 926d181

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

3 files changed

Lines changed: 18 additions & 3 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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,14 @@ def is_resource_identical(self):
365365

366366
return (False, None) if diff_list else (True, None)
367367

368+
@trace
369+
def install(self):
370+
ok, err = create_resource(
371+
self.client, self.resource_name, self.resource_module_params
372+
)
373+
if not ok:
374+
self.return_failure(err)
375+
368376
@trace
369377
def create_or_update(self):
370378
self.update_diff_list(
@@ -957,6 +965,9 @@ def main(self):
957965
if "bindings" in NITRO_RESOURCE_MAP[self.resource_name].keys():
958966
self.sync_all_bindings()
959967

968+
elif self.resource_name == "install" and self.module.params["state"] == "installed":
969+
self.install()
970+
960971
elif self.module.params["state"] in {
961972
"created",
962973
"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)