Open Callisto88 opened 5 months ago
I think i have spotted the problem while troubleshooting netscaler.adc.csvserver_cspolicy_binding
module
The request sent to the Netscaler API is as follow :
"TRACE: ENTRY: client.send() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7fa2fe8d9a20>, 'GET', 'https://NSIP/nitro/v1/config/lbvserver_rewritepolicy_binding/LBVS_Keycloak?filter=bindpoint:REQUEST,policyname:RP_Insert_X_Forwarded_Proto,priority:100.0'), {}",
In the filter arguments the priority is specified as a floating number ( 100.0 ) BUT in the Netscaler it wants a positiv integer
> bind cs vserver CSVS_OnCall_Web -policyName CSP_OnCall_Web_RealTimeAPI -priority 110.0
^^^^^
ERROR: Invalid value [unsigned integer, 110.0]
Replaying the same request with priority as an integer and tadaa it works
'GET', 'https://NSIP/nitro/v1/config/lbvserver_rewritepolicy_binding/LBVS_Keycloak?filter=bindpoint:REQUEST,policyname:RP_Insert_X_Forwarded_Proto,priority:100'), {}
So i guess it's the same problem since it also use priority parameter. I don't know about the others modules but could be affected as well.
I found this part of the code that might be responsible for this but quite unsure how to fix it. I would be grateful if anyone more Python skilled could do PR to address this.
Meanwhile, a quick & dirty fix
( this is the change for csvserver_cspolicy_binding
but most probably applicable to other *_binding
module
In plugins/module_utils/nitro_resource_map.py
@@ -24441,7 +24441,7 @@
},
"name": {"no_log": False, "type": "str"},
"policyname": {"no_log": False, "type": "str"},
- "priority": {"no_log": False, "type": "float"},
+ "priority": {"no_log": False, "type": "int"},
"targetlbvserver": {"no_log": False, "type": "str"},
},
"singleton": False,
Summary
pip freeze
outputIssue Type
Bug Report
Component Name
lbvserver_rewritepolicy_binding
Python Version
Ansible Version
Ansible Configuration
netscaler.adc Collection Version
Target NetScaler Version
Equivalent NetScaler CLI Command
Steps to Reproduce
Re-run the playbook, get the exact same result
Expected Results
Expect the Ansible run to detect the existing binding
Actual Results
The run report changes everytime. Even though the instructions is present in the Netscaler
Additional Notes
No response