Skip to content

supporting install operation #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/module_utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ def get_valid_desired_states(resource_name):
desired_states.add("switched")
if "unset" in supported_operations:
desired_states.add("unset")
if "Install" in supported_operations or "install" in supported_operations:
desired_states.add("installed")
if "rename" in supported_operations:
desired_states.add("renamed")
if "apply" in supported_operations:
Expand Down
11 changes: 11 additions & 0 deletions plugins/module_utils/module_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,14 @@ def is_resource_identical(self):

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

@trace
def install(self):
ok, err = create_resource(
self.client, self.resource_name, self.resource_module_params
)
if not ok:
self.return_failure(err)

@trace
def create_or_update(self):
self.update_diff_list(
Expand Down Expand Up @@ -964,6 +972,9 @@ def main(self):
if "bindings" in NITRO_RESOURCE_MAP[self.resource_name].keys():
self.sync_all_bindings()

elif self.resource_name == "install" and self.module.params["state"] == "installed":
self.install()

elif self.module.params["state"] in {
"created",
"imported",
Expand Down
33 changes: 33 additions & 0 deletions plugins/module_utils/nitro_resource_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -19002,6 +19002,30 @@
"singleton": False,
"update_payload_keys": [],
},
"clear_config": {
"_supported_operations": ["add"],
"add_payload_keys": ["all", "mode"],
"bindings": [],
"bindprimary_key": "",
"delete_arg_keys": [],
"disable_payload_keys": [],
"enable_payload_keys": [],
"get_arg_keys": [],
"immutable_keys": [],
"primary_key": "",
"primary_key_composite": [],
"readwrite_arguments": {
"all": {"no_log": False, "required": False, "type": "bool"},
"mode": {
"choices": ["basic", "extended+", "full"],
"no_log": False,
"required": False,
"type": "str",
},
},
"singleton": False,
"update_payload_keys": [],
},
"cloudallowedngsticketprofile": {
"_supported_operations": [
"add",
Expand Down Expand Up @@ -30203,6 +30227,15 @@
"create": [],
"force": [],
"import": [],
"install": [
"a",
"async",
"enhancedupgrade",
"l",
"resizeswapvar",
"url",
"y",
],
"link": [],
"switch": [],
"unlink": [],
Expand Down
8 changes: 5 additions & 3 deletions plugins/modules/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@
DOCUMENTATION = r"""
---
module: install
short_description: Configuration for 0 resource.
description: Configuration for 0 resource.
short_description: Configuration for install resource.
description: Configuration for install resource.
version_added: 2.0.0
author:
- Sumanth Lingappa (@sumanth-lingappa)
- Shiva Shankar Vaddepally (@shivashankar-vaddepally)
options:
state:
choices: []
choices:
- installed
default: present
description:
- The state of the resource being configured by the module on the NetScaler
ADC node.
- When C(Install), the resource will be installed on the NetScaler ADC node.
type: str
async:
type: bool
Expand Down