From 926d18119688ab8309d35bd394c02d27964ec7a6 Mon Sep 17 00:00:00 2001 From: Shiva Shankar Vaddepally Date: Mon, 24 Mar 2025 05:04:08 +0000 Subject: [PATCH 1/2] Supporting operations install Signed-off-by: Shiva Shankar Vaddepally --- plugins/module_utils/common.py | 2 ++ plugins/module_utils/module_executor.py | 11 +++++++++++ plugins/modules/install.py | 8 +++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/plugins/module_utils/common.py b/plugins/module_utils/common.py index 1892f9273..a568e118c 100644 --- a/plugins/module_utils/common.py +++ b/plugins/module_utils/common.py @@ -601,6 +601,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") return desired_states diff --git a/plugins/module_utils/module_executor.py b/plugins/module_utils/module_executor.py index e3e7bc93f..a5dc399b8 100644 --- a/plugins/module_utils/module_executor.py +++ b/plugins/module_utils/module_executor.py @@ -365,6 +365,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( @@ -957,6 +965,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", diff --git a/plugins/modules/install.py b/plugins/modules/install.py index 055215ee3..f09417183 100644 --- a/plugins/modules/install.py +++ b/plugins/modules/install.py @@ -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 From 8e1b888c246e9abef861930f61158d6684469792 Mon Sep 17 00:00:00 2001 From: Shiva Shankar Vaddepally Date: Wed, 7 May 2025 18:25:01 +0000 Subject: [PATCH 2/2] adding install keys in nitro_resource_map Signed-off-by: Shiva Shankar Vaddepally --- plugins/module_utils/nitro_resource_map.py | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/plugins/module_utils/nitro_resource_map.py b/plugins/module_utils/nitro_resource_map.py index d8e07dd34..c48c4e3a3 100644 --- a/plugins/module_utils/nitro_resource_map.py +++ b/plugins/module_utils/nitro_resource_map.py @@ -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", @@ -30203,6 +30227,15 @@ "create": [], "force": [], "import": [], + "install": [ + "a", + "async", + "enhancedupgrade", + "l", + "resizeswapvar", + "url", + "y", + ], "link": [], "switch": [], "unlink": [],