[Bug]: lbvserer fails with servicename
pkodzis opened this issue · 2 comments
pkodzis commented
Summary
it is imposible to delete vserver:
"msg": "Exception <class 'KeyError'>: 'servicename'"
Issue Type
Bug Report
Component Name
adc.lbvserver
Python Version
$ python --version # or python3 --version
3.9
Ansible Version
$ ansible --version
2.15
Ansible Configuration
$ ansible-config dump --only-changed
netscaler.adc Collection Version
$ ansible-galaxy collection list netscaler.adc
2.0.3
Target NetScaler Version
> show ns version
Equivalent NetScaler CLI Command
Steps to Reproduce
- name: Task
delegate_to: localhost
netscaler.adc.lbvserver:
connfailover: STATEFUL
ipv46: 10.10.10.231
lbvserver_service_binding:
binding_members:
- name: cust2foo-test-cert-10.10.10.231-tcp-7777
- servicename: 10.123.123.123-tcp-11451
listenpolicy: client.ip.src.eq(100.100.100.1)
name: cust2foo-test-cert-10.10.10.231-tcp-7777
netprofile: cust2foo-default-cert-snat-ip
port: 7777
rhistate: ACTIVE
servicetype: TCP
state: absent
Expected Results
deleted lbvserver
Actual Results
FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"adfsproxyprofile": null,
"api_path": "nitro/v1/config",
"appflowlog": "ENABLED",
"authentication": "OFF",
"authenticationhost": null,
"authn401": "OFF",
"authnprofile": null,
"authnvsname": null,
"backuplbmethod": "ROUNDROBIN",
"backuppersistencetimeout": 2.0,
"backupvserver": null,
"bypassaaaa": "NO",
"cacheable": "NO",
"clttimeout": null,
"comment": "DO NOT MODIFY MANUALY! ansible source: 00testpp.yml.rollback",
"connfailover": "STATEFUL",
"cookiename": null,
"datalength": null,
"dataoffset": null,
"dbprofilename": null,
"dbslb": "DISABLED",
"disableprimaryondown": "DISABLED",
"dns64": null,
"dnsprofilename": null,
"downstateflush": "ENABLED",
"hashlength": 80.0,
"healththreshold": null,
"httpprofilename": null,
"httpsredirecturl": null,
"icmpvsrresponse": "PASSIVE",
"insertvserveripport": null,
"ipmask": null,
"ippattern": null,
"ipset": null,
"ipv46": "10.10.10.231",
"l2conn": null,
"lbmethod": "LEASTCONNECTION",
"lbprofilename": null,
"lbvserver_analyticsprofile_binding": null,
"lbvserver_appflowpolicy_binding": null,
"lbvserver_appfwpolicy_binding": null,
"lbvserver_appqoepolicy_binding": null,
"lbvserver_auditnslogpolicy_binding": null,
"lbvserver_auditsyslogpolicy_binding": null,
"lbvserver_authorizationpolicy_binding": null,
"lbvserver_botpolicy_binding": null,
"lbvserver_cachepolicy_binding": null,
"lbvserver_cmppolicy_binding": null,
"lbvserver_contentinspectionpolicy_binding": null,
"lbvserver_dnspolicy64_binding": null,
"lbvserver_feopolicy_binding": null,
"lbvserver_lbpolicy_binding": null,
"lbvserver_responderpolicy_binding": null,
"lbvserver_rewritepolicy_binding": null,
"lbvserver_service_binding": {
"binding_members": [
{
"name": "cust2foo-test-cert-10.10.10.231-tcp-7777"
},
{
"servicename": "10.123.123.123-tcp-11451"
}
],
"mode": "desired"
},
"lbvserver_servicegroup_binding": null,
"lbvserver_spilloverpolicy_binding": null,
"lbvserver_tmtrafficpolicy_binding": null,
"lbvserver_transformpolicy_binding": null,
"lbvserver_videooptimizationdetectionpolicy_binding": null,
"lbvserver_videooptimizationpacingpolicy_binding": null,
"listenpolicy": "client.ip.src.eq(100.100.100.1)",
"listenpriority": 101.0,
"m": "IP",
"macmoderetainvlan": "DISABLED",
"maxautoscalemembers": null,
"minautoscalemembers": null,
"mssqlserverversion": "2008R2",
"mysqlcharacterset": null,
"mysqlprotocolversion": null,
"mysqlservercapabilities": null,
"mysqlserverversion": null,
"name": "cust2foo-test-cert-10.10.10.231-tcp-7777",
"netmask": null,
"netprofile": "cust2foo-default-cert-snat-ip",
"newname": null,
"newservicerequest": null,
"newservicerequestincrementinterval": null,
"newservicerequestunit": "PER_SECOND",
"nitro_auth_token": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"nitro_pass": null,
"nitro_protocol": "https",
"nitro_user": null,
"nsip": "10.10.10..35",
"oracleserverversion": "10G",
"order": null,
"orderthreshold": null,
"persistavpno": null,
"persistencebackup": null,
"persistencetype": null,
"persistmask": null,
"port": 7777,
"probeport": null,
"probeprotocol": null,
"probesuccessresponsecode": "\"200 OK\"",
"processlocal": "DISABLED",
"push": "DISABLED",
"pushlabel": "\"none\"",
"pushmulticlients": "NO",
"pushvserver": null,
"quicbridgeprofilename": null,
"quicprofilename": null,
"range": 1.0,
"recursionavailable": "NO",
"redirectfromport": null,
"redirectportrewrite": "DISABLED",
"redirurl": null,
"redirurlflags": null,
"resrule": "\"none\"",
"retainconnectionsoncluster": "NO",
"rhistate": "ACTIVE",
"rtspnat": "OFF",
"rule": "\"none\"",
"save_config": false,
"servicename": null,
"servicetype": "TCP",
"sessionless": "DISABLED",
"skippersistency": "None",
"sobackupaction": null,
"somethod": null,
"sopersistence": "DISABLED",
"sopersistencetimeout": 2.0,
"sothreshold": null,
"state": "absent",
"tcpprobeport": null,
"tcpprofilename": null,
"td": null,
"timeout": 2.0,
"toggleorder": "ASCENDING",
"tosid": null,
"trofspersistence": "ENABLED",
"v6netmasklen": 128.0,
"v6persistmasklen": 128.0,
"validate_certs": false,
"vipheader": null,
"weight": null
}
},
"loglines": [
"DEBUG: Initializing ModuleExecutor for resource lbvserver",
"TRACE: ENTRY: get_valid_desired_states() called with ('lbvserver',), {}",
"TRACE: EXIT: get_valid_desired_states() returned {'disabled', 'enabled', 'absent', 'present'}",
"TRACE: ENTRY: get_netscaler_version() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f5f1eee1eb0>,), {}",
"TRACE: ENTRY: get_resource() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f5f1eee1eb0>, 'nsversion'), {}",
"TRACE: ENTRY: send() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f5f1eee1eb0>, 'GET', 'https://10.10.10..35/nitro/v1/config/nsversion'), {}",
"DEBUG: self={'_module': <ansible.module_utils.basic.AnsibleModule object at 0x7f5f1e8cfc70>, 'check_mode': False, 'api_path': 'nitro/v1/config', '_headers': {'Content-Type': 'application/json', 'User-Agent': 'ansible-ctxadc', 'Cookie': 'NITRO_AUTH_TOKEN=********'}}",
"DEBUG: fetch_url()-resonse-info={'url': 'https://10.10.10..35/nitro/v1/config/nsversion', 'status': 200, 'date': 'Sun, 03 Dec 2023 08:24:05 GMT', 'server': 'Apache', 'x-frame-options': 'SAMEORIGIN', 'expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'cache-control': 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'pragma': 'no-cache', 'vary': 'Accept-Encoding', 'feature-policy': \"camera 'none'; microphone 'none'; geolocation 'none'\", 'referrer-policy': 'no-referrer', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'content-length': '201', 'content-type': 'application/json; charset=utf-8', 'connection': 'close', 'cookies_string': '', 'cookies': {}, 'msg': 'OK (201 bytes)'}",
"TRACE: EXIT: send() returned (200, {'errorcode': 0, 'message': 'Done', 'severity': 'NONE', 'nsversion': {'installedversion': False, 'version': 'NetScaler NS13.1: Build 42.47.nc, Date: Feb 22 2023, 08:08:13 (64-bit)', 'mode': '1'}})",
"TRACE: EXIT: get_resource() returned [{'installedversion': False, 'version': 'NetScaler NS13.1: Build 42.47.nc, Date: Feb 22 2023, 08:08:13 (64-bit)', 'mode': '1'}]",
"TRACE: EXIT: get_netscaler_version() returned (13.1, 42.47)",
"INFO: NetScaler version: 13.1-42.47",
"DEBUG: All params (including non module-specific params) are: {'comment': 'DO NOT MODIFY MANUALY! ansible source: 00testpp.yml.rollback', 'connfailover': 'STATEFUL', 'ipv46': '10.10.10.231', 'lbvserver_service_binding': {'binding_members': [{'name': 'cust2foo-test-cert-10.10.10.231-tcp-7777'}, {'servicename': '10.123.123.123-tcp-11451'}], 'mode': 'desired'}, 'listenpolicy': 'client.ip.src.eq(100.100.100.1)', 'name': 'cust2foo-test-cert-10.10.10.231-tcp-7777', 'netprofile': 'cust2foo-default-cert-snat-ip', 'port': 7777, 'rhistate': 'ACTIVE', 'servicetype': 'TCP', 'state': 'absent', 'nsip': '10.10.10..35', 'nitro_protocol': 'https', 'validate_certs': False, 'nitro_auth_token': '********', 'save_config': False, 'api_path': 'nitro/v1/config', 'appflowlog': 'ENABLED', 'authentication': 'OFF', 'authn401': 'OFF', 'backuplbmethod': 'ROUNDROBIN', 'backuppersistencetimeout': 2.0, 'bypassaaaa': 'NO', 'cacheable': 'NO', 'dbslb': 'DISABLED', 'disableprimaryondown': 'DISABLED', 'downstateflush': 'ENABLED', 'hashlength': 80.0, 'icmpvsrresponse': 'PASSIVE', 'lbmethod': 'LEASTCONNECTION', 'listenpriority': 101.0, 'm': 'IP', 'macmoderetainvlan': 'DISABLED', 'mssqlserverversion': '2008R2', 'newservicerequestunit': 'PER_SECOND', 'oracleserverversion': '10G', 'probesuccessresponsecode': '\"200 OK\"', 'processlocal': 'DISABLED', 'push': 'DISABLED', 'pushlabel': '\"none\"', 'pushmulticlients': 'NO', 'range': 1.0, 'recursionavailable': 'NO', 'redirectportrewrite': 'DISABLED', 'resrule': '\"none\"', 'retainconnectionsoncluster': 'NO', 'rtspnat': 'OFF', 'rule': '\"none\"', 'sessionless': 'DISABLED', 'skippersistency': 'None', 'sopersistence': 'DISABLED', 'sopersistencetimeout': 2.0, 'timeout': 2.0, 'toggleorder': 'ASCENDING', 'trofspersistence': 'ENABLED', 'v6netmasklen': 128.0, 'v6persistmasklen': 128.0, 'nitro_user': None, 'nitro_pass': None, 'adfsproxyprofile': None, 'authenticationhost': None, 'authnprofile': None, 'authnvsname': None, 'backupvserver': None, 'clttimeout': None, 'cookiename': None, 'datalength': None, 'dataoffset': None, 'dbprofilename': None, 'dns64': None, 'dnsprofilename': None, 'healththreshold': None, 'httpprofilename': None, 'httpsredirecturl': None, 'insertvserveripport': None, 'ipmask': None, 'ippattern': None, 'ipset': None, 'l2conn': None, 'lbprofilename': None, 'lbvserver_analyticsprofile_binding': None, 'lbvserver_appflowpolicy_binding': None, 'lbvserver_appfwpolicy_binding': None, 'lbvserver_appqoepolicy_binding': None, 'lbvserver_auditnslogpolicy_binding': None, 'lbvserver_auditsyslogpolicy_binding': None, 'lbvserver_authorizationpolicy_binding': None, 'lbvserver_botpolicy_binding': None, 'lbvserver_cachepolicy_binding': None, 'lbvserver_cmppolicy_binding': None, 'lbvserver_contentinspectionpolicy_binding': None, 'lbvserver_dnspolicy64_binding': None, 'lbvserver_feopolicy_binding': None, 'lbvserver_lbpolicy_binding': None, 'lbvserver_responderpolicy_binding': None, 'lbvserver_rewritepolicy_binding': None, 'lbvserver_servicegroup_binding': None, 'lbvserver_spilloverpolicy_binding': None, 'lbvserver_tmtrafficpolicy_binding': None, 'lbvserver_transformpolicy_binding': None, 'lbvserver_videooptimizationdetectionpolicy_binding': None, 'lbvserver_videooptimizationpacingpolicy_binding': None, 'maxautoscalemembers': None, 'minautoscalemembers': None, 'mysqlcharacterset': None, 'mysqlprotocolversion': None, 'mysqlservercapabilities': None, 'mysqlserverversion': None, 'netmask': None, 'newname': None, 'newservicerequest': None, 'newservicerequestincrementinterval': None, 'order': None, 'orderthreshold': None, 'persistavpno': None, 'persistencebackup': None, 'persistencetype': None, 'persistmask': None, 'probeport': None, 'probeprotocol': None, 'pushvserver': None, 'quicbridgeprofilename': None, 'quicprofilename': None, 'redirectfromport': None, 'redirurl': None, 'redirurlflags': None, 'servicename': None, 'sobackupaction': None, 'somethod': None, 'sothreshold': None, 'tcpprobeport': None, 'tcpprofilename': None, 'td': None, 'tosid': None, 'vipheader': None, 'weight': None}",
"TRACE: ENTRY: _filter_resource_module_params() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f5f1edb6370>,), {}",
"DEBUG: Desired `lbvserver` module specific params are: {'comment': 'DO NOT MODIFY MANUALY! ansible source: 00testpp.yml.rollback', 'connfailover': 'STATEFUL', 'ipv46': '10.10.10.231', 'listenpolicy': 'client.ip.src.eq(100.100.100.1)', 'name': 'cust2foo-test-cert-10.10.10.231-tcp-7777', 'netprofile': 'cust2foo-default-cert-snat-ip', 'port': 7777, 'rhistate': 'ACTIVE', 'servicetype': 'TCP', 'appflowlog': 'ENABLED', 'authentication': 'OFF', 'authn401': 'OFF', 'backuplbmethod': 'ROUNDROBIN', 'backuppersistencetimeout': 2.0, 'bypassaaaa': 'NO', 'cacheable': 'NO', 'dbslb': 'DISABLED', 'disableprimaryondown': 'DISABLED', 'downstateflush': 'ENABLED', 'hashlength': 80.0, 'icmpvsrresponse': 'PASSIVE', 'lbmethod': 'LEASTCONNECTION', 'listenpriority': 101.0, 'm': 'IP', 'macmoderetainvlan': 'DISABLED', 'mssqlserverversion': '2008R2', 'newservicerequestunit': 'PER_SECOND', 'oracleserverversion': '10G', 'probesuccessresponsecode': '\"200 OK\"', 'processlocal': 'DISABLED', 'push': 'DISABLED', 'pushlabel': '\"none\"', 'pushmulticlients': 'NO', 'range': 1.0, 'recursionavailable': 'NO', 'redirectportrewrite': 'DISABLED', 'resrule': '\"none\"', 'retainconnectionsoncluster': 'NO', 'rtspnat': 'OFF', 'rule': '\"none\"', 'sessionless': 'DISABLED', 'skippersistency': 'None', 'sopersistence': 'DISABLED', 'sopersistencetimeout': 2.0, 'timeout': 2.0, 'toggleorder': 'ASCENDING', 'trofspersistence': 'ENABLED', 'v6netmasklen': 128.0, 'v6persistmasklen': 128.0}",
"TRACE: EXIT: _filter_resource_module_params() returned None",
"TRACE: ENTRY: _filter_desired_bindings() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f5f1edb6370>,), {}",
"DEBUG: Desired `lbvserver` module specific bindings are: ['lbvserver_service_binding']",
"TRACE: EXIT: _filter_desired_bindings() returned None",
"TRACE: ENTRY: get_existing_resource() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f5f1edb6370>,), {}",
"TRACE: ENTRY: get_resource() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f5f1eee1eb0>,), {'resource_name': 'lbvserver', 'resource_id': 'cust2foo-test-cert-10.10.10.231-tcp-7777', 'args': {}, 'filter': {}}",
"TRACE: ENTRY: send() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f5f1eee1eb0>, 'GET', 'https://10.10.10..35/nitro/v1/config/lbvserver/cust2foo-test-cert-10.10.10.231-tcp-7777'), {}",
"DEBUG: self={'_module': <ansible.module_utils.basic.AnsibleModule object at 0x7f5f1e8cfc70>, 'check_mode': False, 'api_path': 'nitro/v1/config', '_headers': {'Content-Type': 'application/json', 'User-Agent': 'ansible-ctxadc', 'Cookie': 'NITRO_AUTH_TOKEN=********'}}",
"DEBUG: fetch_url()-resonse-info={'url': 'https://10.10.10..35/nitro/v1/config/lbvserver/cust2foo-test-cert-10.10.10.231-tcp-7777', 'status': 404, 'date': 'Sun, 03 Dec 2023 08:24:06 GMT', 'server': 'Apache', 'x-frame-options': 'SAMEORIGIN', 'expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'cache-control': 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'pragma': 'no-cache', 'vary': 'Accept-Encoding', 'feature-policy': \"camera 'none'; microphone 'none'; geolocation 'none'\", 'referrer-policy': 'no-referrer', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'content-length': '126', 'content-type': 'application/json; charset=utf-8', 'connection': 'close', 'msg': 'HTTP Error 404: Not Found', 'body': b'{ \"errorcode\": 258, \"message\": \"No such resource [name, cust2foo-test-cert-10.10.10.231-tcp-7777]\", \"severity\": \"ERROR\" }'}",
"TRACE: EXIT: send() returned (404, {'errorcode': 258, 'message': 'No such resource [name, cust2foo-test-cert-10.10.10.231-tcp-7777]', 'severity': 'ERROR'})",
"TRACE: EXIT: get_resource() returned []",
"TRACE: EXIT: get_existing_resource() returned {}",
"TRACE: ENTRY: main() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f5f1edb6370>,), {}",
"TRACE: ENTRY: sync_all_bindings() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f5f1edb6370>,), {}",
"TRACE: ENTRY: sync_single_binding() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f5f1edb6370>, 'lbvserver_service_binding'), {}",
"INFO: Binding mode is `desired`",
"DEBUG: Desired binding members: [{'name': 'cust2foo-test-cert-10.10.10.231-tcp-7777'}, {'servicename': '10.123.123.123-tcp-11451'}]",
"TRACE: ENTRY: get_bindings() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f5f1eee1eb0>,), {'binding_name': 'lbvserver_service_binding', 'binding_id': 'cust2foo-test-cert-10.10.10.231-tcp-7777'}",
"TRACE: ENTRY: get_resource() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f5f1eee1eb0>,), {'resource_name': 'lbvserver_service_binding', 'resource_id': 'cust2foo-test-cert-10.10.10.231-tcp-7777'}",
"TRACE: ENTRY: send() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f5f1eee1eb0>, 'GET', 'https://10.10.10..35/nitro/v1/config/lbvserver_service_binding/cust2foo-test-cert-10.10.10.231-tcp-7777'), {}",
"DEBUG: self={'_module': <ansible.module_utils.basic.AnsibleModule object at 0x7f5f1e8cfc70>, 'check_mode': False, 'api_path': 'nitro/v1/config', '_headers': {'Content-Type': 'application/json', 'User-Agent': 'ansible-ctxadc', 'Cookie': 'NITRO_AUTH_TOKEN=********'}}",
"DEBUG: fetch_url()-resonse-info={'url': 'https://10.10.10..35/nitro/v1/config/lbvserver_service_binding/cust2foo-test-cert-10.10.10.231-tcp-7777', 'status': 404, 'date': 'Sun, 03 Dec 2023 08:24:07 GMT', 'server': 'Apache', 'x-frame-options': 'SAMEORIGIN', 'expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'cache-control': 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'pragma': 'no-cache', 'vary': 'Accept-Encoding', 'feature-policy': \"camera 'none'; microphone 'none'; geolocation 'none'\", 'referrer-policy': 'no-referrer', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'content-length': '126', 'content-type': 'application/json; charset=utf-8', 'connection': 'close', 'msg': 'HTTP Error 404: Not Found', 'body': b'{ \"errorcode\": 258, \"message\": \"No such resource [name, cust2foo-test-cert-10.10.10.231-tcp-7777]\", \"severity\": \"ERROR\" }'}",
"TRACE: EXIT: send() returned (404, {'errorcode': 258, 'message': 'No such resource [name, cust2foo-test-cert-10.10.10.231-tcp-7777]', 'severity': 'ERROR'})",
"TRACE: EXIT: get_resource() returned []",
"TRACE: EXIT: get_bindings() returned []",
"DEBUG: Existing `lbvserver_service_binding` bindings: []",
"TRACE: ENTRY: return_failure() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f5f1edb6370>, \"Exception <class 'KeyError'>: 'servicename'\"), {}"
],
"msg": "Exception <class 'KeyError'>: 'servicename'"
Additioinal Notes
No response
sumanth-lingappa commented
@pkodzis, can you please confirm that the below box in the screenshot is by mistake? If not, then name
and servicename
should be present as one list.
You can find the correct example below
pkodzis commented
ACK. The issue was on my side. I can reproduce it by defning separate item "- servicename". If I defined "servicename" as part of the same item as "name" ("servicename" instead of "- servicename") I can successfully delete lbvserver. thank you so much! :)
just for refernce if somebody looking for something simlar:
BAD:
lbvserver_service_binding:
binding_members:
- name: cust2foo-test-cert-10.10.10.231-tcp-7777
- servicename: 10.123.123.123-tcp-11451
OK:
lbvserver_service_binding:
binding_members:
- name: cust2foo-test-cert-10.10.10.231-tcp-7777
servicename: 10.123.123.123-tcp-11451