Skip to content

Commit

Permalink
Merge pull request #298 from netscaler/certification
Browse files Browse the repository at this point in the history
Code changes for Ansible Automation Hub Certification
  • Loading branch information
sumanth-lingappa authored Nov 8, 2023
2 parents e1a9040 + 223a182 commit dcbb43b
Show file tree
Hide file tree
Showing 902 changed files with 36,179 additions and 15,645 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.0.2] - 2023-11-08

### Fixed

- updated secret attributes with `no_log` option ([#286])

- Prepared the collection for Ansible Automation Hub Certification

## [2.0.1] - 2023-09-30

Expand All @@ -24,7 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial Release

[unreleased]: https://github.com/netscaler/ansible-collection-netscaleradc/compare/2.0.1...HEAD
[unreleased]: https://github.com/netscaler/ansible-collection-netscaleradc/compare/2.0.2...HEAD
[2.0.2]: https://github.com/netscaler/ansible-collection-netscaleradc/compare/2.0.1...2.0.2
[2.0.1]: https://github.com/netscaler/ansible-collection-netscaleradc/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/netscaler/ansible-collection-netscaleradc/releases/tag/2.0.0

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The collection provides Ansible modules to configure and manage NetScaler ADC ap
### ansible-galaxy

```bash
ansible-galaxy collection install netscaler.adc
ansible-galaxy collection install netscaler.adc
```

### via github (to have the latest updated which are yet to be released in ansible-galaxy)
Expand Down Expand Up @@ -97,7 +97,7 @@ echo $NETSCALER_NITRO_AUTH_TOKEN

## Supported Ansible Versions

This collection supports Ansible version 2.9 and above.
This collection supports Ansible version 2.14 and above.

> Please raise issues at <https://github.com/netscaler/ansible-collection-netscaleradc/issues> if you face any issues with the collection.
Expand Down
5 changes: 3 additions & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace: netscaler
name: adc

# The version of the collection. Must be compatible with semantic versioning
version: 2.0.1
version: 2.0.2

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down Expand Up @@ -71,9 +71,10 @@ build_ignore:
- tools
- examples
- docs
- tests
- Dockerfile
- .gitignore
- issues
- "**/netscaler-adc-*.tar.gz"

# A dict controlling use of manifest directives used in building the collection artifact. The key 'directives' is a
# list of MANIFEST.in style
Expand Down
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# Collections must specify a minimum required ansible version to upload
# to galaxy
requires_ansible: '>=2.9.10'
requires_ansible: '>=2.14.0'

# Content that Ansible needs to load from another location or that has
# been deprecated/removed
Expand Down
15 changes: 2 additions & 13 deletions plugins/doc_fragments/netscaler_adc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,9 @@ class ModuleDocFragment(object):
description:
- If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.
required: false
default: false
default: true
type: bool
state:
choices: ['present', 'absent', 'enabled', 'disabled']
default: 'present'
description:
- The state of the resource being configured by the module on the NetScaler ADC node.
- C(enabled) and C(disabled) are only valid for resources that can be enabled or disabled.
- When C(present) the resource will be created if needed and configured according to the module's parameters.
- When C(absent) the resource will be deleted from the NetScaler ADC node.
- When C(enabled) the resource will be enabled on the NetScaler ADC node.
- When C(disabled) the resource will be disabled on the NetScaler ADC node.
type: str
save_config:
description:
- If C(true) the module will save the configuration on the NetScaler ADC node if it makes any changes.
Expand All @@ -75,6 +63,7 @@ class ModuleDocFragment(object):
description:
- Base NITRO API path.
- Define only in case of an ADM service proxy call
default: "nitro/v1/config"
notes:
- For more information on using Ansible to manage NetScaler ADC Network devices see U(https://www.ansible.com/integrations/networks/citrixadc).
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_bindings(client, binding_name, binding_id=None):
def is_resource_exists(
client, resource_name, resource_id=None, args=None, attrs=None, filter=None
):
status_code, _ = client.get(
status_code, resources = client.get(
resource=resource_name,
id=resource_id,
args=args,
Expand Down
11 changes: 9 additions & 2 deletions plugins/module_utils/module_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ def return_success(self):
self.module.exit_json(**self.module_result)

@trace
def update_diff_list(self, existing=dict(), desired=dict(), delete=False, **kwargs):
def update_diff_list(self, existing=None, desired=None, delete=False, **kwargs):
if existing is None:
existing = {}
if desired is None:
desired = {}
if "custom_msg" in kwargs:
prepared_str = (
self.diff_dict.get("prepared", "") + os.linesep + kwargs["custom_msg"]
Expand Down Expand Up @@ -230,7 +234,10 @@ def is_attribute_equal(
)
if attribute_type == "str":
# NITRO is case insensitive for string attribute values. So, convert both to lower case and compare
return str(existing_attribute_value).lower() == str(module_params_attribute_value).lower()
return (
str(existing_attribute_value).lower()
== str(module_params_attribute_value).lower()
)
return existing_attribute_value == module_params_attribute_value

@trace
Expand Down
Loading

0 comments on commit dcbb43b

Please sign in to comment.