netscaler/ansible-collection-netscaleradc

[FEATURE REQUEST]: restoring default values

pkodzis opened this issue · 2 comments

Summary

I'm not sure if something like this would be possible. This is regarding any object that I've been dealing with on Netscaler via Ansible (e.g. lbmonitor/server/service/servicegroup/lbvserver/netprofile). I will use lbmonitor just as e.g. to explain situation and requirement.

Step 1. Create monitor:
monitorname: test-monitor-1
state: present
interval: 60
type: HTTP

it gives:
add lb monitor test-monitor-1 HTTP -respCode 200 -httpRequest "HEAD /" -interval 1 MIN

Step 2. I changed my mind and I want to modify e.g. retry from default 3 to 15, so I redeploy test-monitor-1 as:
monitorname: test-monitor-1
state: present
interval: 60
type: HTTP
retry: 15

it gives:
add lb monitor test-monitor-1 HTTP -respCode 200 -httpRequest "HEAD /" -interval 1 MIN -retries 15

Step 3. Now I changed my mind and I want "retry" back to the default so I do:
monitorname: test-monitor-1
state: present
interval: 60
type: HTTP

And surprise, nothing changes, "retry" stays as 15. To reset the "retry" value back to the default 3 I have to explicity declare:
monitorname: test-monitor-1
state: present
interval: 60
type: HTTP
retry: 3

So the question is, if it would be possible so the netscaler.adc collection auto-set to Netscaler defaults all values that are not declared?

Issue Type

Feature Idea

Component Name

all

Describe alternatives you've considered

No response

Additional Information

No @pkodzis. It would not be possible.

To make this, the ansible collection should remember the default values of all the attributes of all the modules. And send the default values when the attribute is not present in the playbook-task.

It would be cumbersome to maintain the ansible collection, because -

  1. the NITRO default values may change from release to release
  2. we had many issues keeping the default values of the attributes of all the modules. Hence removed the default values in the earlier fixes.

As a maintainer of this project, I would suggest not to implement this.

fair enough. thank you so much for checking this! :)