Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: service does not accept custom monitor - 'Default monitor cannot be unbound from a service' #312

Closed
pkodzis opened this issue Nov 30, 2023 · 4 comments
Assignees
Labels

Comments

@pkodzis
Copy link

pkodzis commented Nov 30, 2023

Summary

I'm unable to bind custom monitor to the service. Errors says it is impossible to do not use default monitor.......

"msg": "ERROR: delete_resource FAILED; status_code: 599; Reason:{'errorcode': 2164, 'message': 'Default monitor cannot be unbound from a service', 'severity': 'ERROR'}"

Issue Type

Bug Report

Component Name

service

Python Version

$ python --version # or python3 --version
3.9

Ansible Version

$ ansible --version
ansible [core 2.15.6]
  config file = None
  configured module search path = ['/home/pkodzis/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/pkodzis/.local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/pkodzis/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/pkodzis/.local/bin/ansible
  python version = 3.9.5 (default, Nov 18 2021, 16:00:48) [GCC 10.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

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
13.1

Equivalent NetScaler CLI Command

Steps to Reproduce

    - name: setup services
      delegate_to: localhost
      netscaler.adc.service:
        nsip: "{{ provider.nsip }}"
        nitro_auth_token: "{{ provider.nitro_auth_token | default(omit) }}"
        nitro_protocol: "{{ provider.nitro_protocol | default(omit) }}"
        validate_certs: "{{ provider.validate_certs | default(omit) }}"
        comment: "{{ provider.comment | default(omit) }}"

        state: present
        name: 10.123.123.123-tcp-12345
        servicetype: TCP
        ipaddress: 10.123.123.123
        port: 12345
        healthmonitor: "NO"
        netprofile: foo2cust-default-cert-snat-ip

        service_lbmonitor_binding:
          binding_members:
            - monitor_name: foo2cust-default-cert-snat-ip-tcp
              servicename: 10.123.123.123-tcp-12345

Expected Results

service using custom monitor instead of default one

Actual Results

FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "Internal": null,
            "accessdown": "NO",
            "all": null,
            "api_path": "nitro/v1/config",
            "appflowlog": "ENABLED",
            "cacheable": "NO",
            "cachetype": null,
            "cip": null,
            "cipheader": null,
            "cka": null,
            "cleartextport": null,
            "clttimeout": null,
            "cmp": null,
            "comment": null,
            "contentinspectionprofilename": null,
            "customserverid": "\"None\"",
            "delay": null,
            "dnsprofilename": null,
            "downstateflush": "ENABLED",
            "graceful": "NO",
            "hashid": null,
            "healthmonitor": "NO",
            "httpprofilename": null,
            "ip": null,
            "ipaddress": "10.123.123.123",
            "maxbandwidth": null,
            "maxclient": null,
            "maxreq": null,
            "monconnectionclose": null,
            "monitor_name_svc": null,
            "monthreshold": null,
            "name": "10.123.123.123-tcp-12345",
            "netprofile": "foo2cust-default-cert-snat-ip",
            "newname": null,
            "nitro_auth_token": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "nitro_pass": null,
            "nitro_protocol": "https",
            "nitro_user": null,
            "nsip": "10.133.254.35",
            "pathmonitor": null,
            "pathmonitorindv": null,
            "port": 12345,
            "processlocal": "DISABLED",
            "rtspsessionidremap": "OFF",
            "save_config": false,
            "serverid": null,
            "servername": null,
            "service_lbmonitor_binding": {
                "binding_members": [
                    {
                        "monitor_name": "foo2cust-default-cert-snat-ip-tcp",
                        "servicename": "10.123.123.123-tcp-12345"
                    }
                ],
                "mode": "desired"
            },
            "servicegroup_lbmonitor_binding": null,
            "servicegroup_servicegroupmember_binding": null,
            "servicetype": "TCP",
            "sp": null,
            "state": "present",
            "svrtimeout": null,
            "tcpb": null,
            "tcpprofilename": null,
            "td": null,
            "useproxyport": null,
            "usip": null,
            "validate_certs": false,
            "weight": null
        }
    },
    "loglines": [
        "DEBUG: Initializing ModuleExecutor for resource service",
        "TRACE: ENTRY: get_valid_desired_states() called with ('service',), {}",
        "TRACE: EXIT: get_valid_desired_states() returned {'present', 'absent', 'disabled', 'enabled'}",
        "TRACE: ENTRY: get_netscaler_version() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>,), {}",
        "TRACE: ENTRY: get_resource() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>, 'nsversion'), {}",
        "TRACE: ENTRY: send() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>, 'GET', 'https://10.133.254.35/nitro/v1/config/nsversion'), {}",
        "DEBUG: self={'_module': <ansible.module_utils.basic.AnsibleModule object at 0x7f29e92cf310>, '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.133.254.35/nitro/v1/config/nsversion', 'status': 200, 'date': 'Thu, 30 Nov 2023 02:42:27 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: {'nsip': '10.133.254.35', 'nitro_auth_token': '********', 'validate_certs': False, 'state': 'present', 'name': '10.123.123.123-tcp-12345', 'servicetype': 'TCP', 'ipaddress': '10.123.123.123', 'port': 12345, 'healthmonitor': 'NO', 'netprofile': 'foo2cust-default-cert-snat-ip', 'service_lbmonitor_binding': {'binding_members': [{'monitor_name': 'foo2cust-default-cert-snat-ip-tcp', 'servicename': '10.123.123.123-tcp-12345'}], 'mode': 'desired'}, 'nitro_protocol': 'https', 'save_config': False, 'api_path': 'nitro/v1/config', 'accessdown': 'NO', 'appflowlog': 'ENABLED', 'cacheable': 'NO', 'customserverid': '\"None\"', 'downstateflush': 'ENABLED', 'graceful': 'NO', 'processlocal': 'DISABLED', 'rtspsessionidremap': 'OFF', 'nitro_user': None, 'nitro_pass': None, 'Internal': None, 'all': None, 'cachetype': None, 'cip': None, 'cipheader': None, 'cka': None, 'cleartextport': None, 'clttimeout': None, 'cmp': None, 'comment': None, 'contentinspectionprofilename': None, 'delay': None, 'dnsprofilename': None, 'hashid': None, 'httpprofilename': None, 'ip': None, 'maxbandwidth': None, 'maxclient': None, 'maxreq': None, 'monconnectionclose': None, 'monitor_name_svc': None, 'monthreshold': None, 'newname': None, 'pathmonitor': None, 'pathmonitorindv': None, 'serverid': None, 'servername': None, 'servicegroup_lbmonitor_binding': None, 'servicegroup_servicegroupmember_binding': None, 'sp': None, 'svrtimeout': None, 'tcpb': None, 'tcpprofilename': None, 'td': None, 'useproxyport': None, 'usip': None, 'weight': None}",
        "TRACE: ENTRY: _filter_resource_module_params() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>,), {}",
        "DEBUG: Desired `service` module specific params are: {'name': '10.123.123.123-tcp-12345', 'servicetype': 'TCP', 'ipaddress': '10.123.123.123', 'port': 12345, 'healthmonitor': 'NO', 'netprofile': 'foo2cust-default-cert-snat-ip', 'accessdown': 'NO', 'appflowlog': 'ENABLED', 'cacheable': 'NO', 'customserverid': '\"None\"', 'downstateflush': 'ENABLED', 'graceful': 'NO', 'processlocal': 'DISABLED', 'rtspsessionidremap': 'OFF'}",
        "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 0x7f29e8ef9dc0>,), {}",
        "DEBUG: Desired `service` module specific bindings are: ['service_lbmonitor_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 0x7f29e8ef9dc0>,), {}",
        "TRACE: ENTRY: get_resource() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>,), {'resource_name': 'service', 'resource_id': '10.123.123.123-tcp-12345', 'args': {}, 'filter': {}}",
        "TRACE: ENTRY: send() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>, 'GET', 'https://10.133.254.35/nitro/v1/config/service/10.123.123.123-tcp-12345'), {}",
        "DEBUG: self={'_module': <ansible.module_utils.basic.AnsibleModule object at 0x7f29e92cf310>, '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.133.254.35/nitro/v1/config/service/10.123.123.123-tcp-12345', 'status': 200, 'date': 'Thu, 30 Nov 2023 02:42:29 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': '1663', 'content-type': 'application/json; charset=utf-8', 'connection': 'close', 'cookies_string': '', 'cookies': {}, 'msg': 'OK (1663 bytes)'}",
        "TRACE: EXIT: send() returned (200, {'errorcode': 0, 'message': 'Done', 'severity': 'NONE', 'service': [{'name': '10.123.123.123-tcp-12345', 'numofconnections': 0, 'servername': '10.123.123.123', 'policyname': '10.123.123.123', 'servicetype': 'TCP', 'serviceconftype2': 'Configured', 'port': 12345, 'gslb': 'NONE', 'cachetype': 'SERVER', 'maxclient': '0', 'maxreq': '0', 'cacheable': 'NO', 'cip': 'DISABLED', 'usip': 'NO', 'pathmonitor': 'NO', 'pathmonitorindv': 'NO', 'useproxyport': 'YES', 'dup_weight': '0', 'sp': 'OFF', 'rtspsessionidremap': 'OFF', 'failedprobes': '0', 'clttimeout': 9000, 'totalprobes': '9000', 'svrtimeout': 9000, 'totalfailedprobes': '9000', 'publicip': '0.0.0.0', 'publicport': 12345, 'customserverid': '\"None\"', 'cka': 'NO', 'tcpb': 'NO', 'processlocal': 'DISABLED', 'cmp': 'NO', 'maxbandwidth': '0', 'accessdown': 'NO', 'svrstate': 'UP', 'delay': 0, 'ipaddress': '10.123.123.123', 'monthreshold': '0', 'monitor_state': 'Unknown', 'monstatcode': 0, 'lastresponse': 'Probing ownership is with some other node in cluster.', 'responsetime': '0', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'downstateflush': 'ENABLED', 'statechangetimesec': 'Thu Nov 30 02:36:32 2023', 'statechangetimemsec': '577', 'tickssincelaststatechange': '35733', 'stateupdatereason': '0', 'clmonowner': '0', 'clmonview': '0', 'graceful': 'NO', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'healthmonitor': 'NO', 'appflowlog': 'ENABLED', 'netprofile': 'foo2cust-default-cert-snat-ip', 'serviceipstr': '10.123.123.123', 'td': '0', 'passive': False, 'monconnectionclose': 'NONE', 'nodefaultbindings': 'NO', 'feature': 'SYSTEM'}]})",
        "TRACE: EXIT: get_resource() returned [{'name': '10.123.123.123-tcp-12345', 'numofconnections': 0, 'servername': '10.123.123.123', 'policyname': '10.123.123.123', 'servicetype': 'TCP', 'serviceconftype2': 'Configured', 'port': 12345, 'gslb': 'NONE', 'cachetype': 'SERVER', 'maxclient': '0', 'maxreq': '0', 'cacheable': 'NO', 'cip': 'DISABLED', 'usip': 'NO', 'pathmonitor': 'NO', 'pathmonitorindv': 'NO', 'useproxyport': 'YES', 'dup_weight': '0', 'sp': 'OFF', 'rtspsessionidremap': 'OFF', 'failedprobes': '0', 'clttimeout': 9000, 'totalprobes': '9000', 'svrtimeout': 9000, 'totalfailedprobes': '9000', 'publicip': '0.0.0.0', 'publicport': 12345, 'customserverid': '\"None\"', 'cka': 'NO', 'tcpb': 'NO', 'processlocal': 'DISABLED', 'cmp': 'NO', 'maxbandwidth': '0', 'accessdown': 'NO', 'svrstate': 'UP', 'delay': 0, 'ipaddress': '10.123.123.123', 'monthreshold': '0', 'monitor_state': 'Unknown', 'monstatcode': 0, 'lastresponse': 'Probing ownership is with some other node in cluster.', 'responsetime': '0', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'downstateflush': 'ENABLED', 'statechangetimesec': 'Thu Nov 30 02:36:32 2023', 'statechangetimemsec': '577', 'tickssincelaststatechange': '35733', 'stateupdatereason': '0', 'clmonowner': '0', 'clmonview': '0', 'graceful': 'NO', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'healthmonitor': 'NO', 'appflowlog': 'ENABLED', 'netprofile': 'foo2cust-default-cert-snat-ip', 'serviceipstr': '10.123.123.123', 'td': '0', 'passive': False, 'monconnectionclose': 'NONE', 'nodefaultbindings': 'NO', 'feature': 'SYSTEM'}]",
        "TRACE: EXIT: get_existing_resource() returned {'name': '10.123.123.123-tcp-12345', 'numofconnections': 0, 'servername': '10.123.123.123', 'policyname': '10.123.123.123', 'servicetype': 'TCP', 'serviceconftype2': 'Configured', 'port': 12345, 'gslb': 'NONE', 'cachetype': 'SERVER', 'maxclient': '0', 'maxreq': '0', 'cacheable': 'NO', 'cip': 'DISABLED', 'usip': 'NO', 'pathmonitor': 'NO', 'pathmonitorindv': 'NO', 'useproxyport': 'YES', 'dup_weight': '0', 'sp': 'OFF', 'rtspsessionidremap': 'OFF', 'failedprobes': '0', 'clttimeout': 9000, 'totalprobes': '9000', 'svrtimeout': 9000, 'totalfailedprobes': '9000', 'publicip': '0.0.0.0', 'publicport': 12345, 'customserverid': '\"None\"', 'cka': 'NO', 'tcpb': 'NO', 'processlocal': 'DISABLED', 'cmp': 'NO', 'maxbandwidth': '0', 'accessdown': 'NO', 'svrstate': 'UP', 'delay': 0, 'ipaddress': '10.123.123.123', 'monthreshold': '0', 'monitor_state': 'Unknown', 'monstatcode': 0, 'lastresponse': 'Probing ownership is with some other node in cluster.', 'responsetime': '0', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'downstateflush': 'ENABLED', 'statechangetimesec': 'Thu Nov 30 02:36:32 2023', 'statechangetimemsec': '577', 'tickssincelaststatechange': '35733', 'stateupdatereason': '0', 'clmonowner': '0', 'clmonview': '0', 'graceful': 'NO', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'healthmonitor': 'NO', 'appflowlog': 'ENABLED', 'netprofile': 'foo2cust-default-cert-snat-ip', 'serviceipstr': '10.123.123.123', 'td': '0', 'passive': False, 'monconnectionclose': 'NONE', 'nodefaultbindings': 'NO', 'feature': 'SYSTEM'}",
        "TRACE: ENTRY: main() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>,), {}",
        "TRACE: ENTRY: create_or_update() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>,), {}",
        "TRACE: ENTRY: update_diff_list() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>,), {'existing': {'name': '10.123.123.123-tcp-12345', 'numofconnections': 0, 'servername': '10.123.123.123', 'policyname': '10.123.123.123', 'servicetype': 'TCP', 'serviceconftype2': 'Configured', 'port': 12345, 'gslb': 'NONE', 'cachetype': 'SERVER', 'maxclient': '0', 'maxreq': '0', 'cacheable': 'NO', 'cip': 'DISABLED', 'usip': 'NO', 'pathmonitor': 'NO', 'pathmonitorindv': 'NO', 'useproxyport': 'YES', 'dup_weight': '0', 'sp': 'OFF', 'rtspsessionidremap': 'OFF', 'failedprobes': '0', 'clttimeout': 9000, 'totalprobes': '9000', 'svrtimeout': 9000, 'totalfailedprobes': '9000', 'publicip': '0.0.0.0', 'publicport': 12345, 'customserverid': '\"None\"', 'cka': 'NO', 'tcpb': 'NO', 'processlocal': 'DISABLED', 'cmp': 'NO', 'maxbandwidth': '0', 'accessdown': 'NO', 'svrstate': 'UP', 'delay': 0, 'ipaddress': '10.123.123.123', 'monthreshold': '0', 'monitor_state': 'Unknown', 'monstatcode': 0, 'lastresponse': 'Probing ownership is with some other node in cluster.', 'responsetime': '0', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'downstateflush': 'ENABLED', 'statechangetimesec': 'Thu Nov 30 02:36:32 2023', 'statechangetimemsec': '577', 'tickssincelaststatechange': '35733', 'stateupdatereason': '0', 'clmonowner': '0', 'clmonview': '0', 'graceful': 'NO', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'healthmonitor': 'NO', 'appflowlog': 'ENABLED', 'netprofile': 'foo2cust-default-cert-snat-ip', 'serviceipstr': '10.123.123.123', 'td': '0', 'passive': False, 'monconnectionclose': 'NONE', 'nodefaultbindings': 'NO', 'feature': 'SYSTEM'}, 'desired': {'name': '10.123.123.123-tcp-12345', 'servicetype': 'TCP', 'ipaddress': '10.123.123.123', 'port': 12345, 'healthmonitor': 'NO', 'netprofile': 'foo2cust-default-cert-snat-ip', 'accessdown': 'NO', 'appflowlog': 'ENABLED', 'cacheable': 'NO', 'customserverid': '\"None\"', 'downstateflush': 'ENABLED', 'graceful': 'NO', 'processlocal': 'DISABLED', 'rtspsessionidremap': 'OFF'}}",
        "TRACE: EXIT: update_diff_list() returned None",
        "TRACE: ENTRY: is_resource_identical() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>,), {}",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'name', '10.123.123.123-tcp-12345', '10.123.123.123-tcp-12345'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'servicetype', 'TCP', 'TCP'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'ipaddress', '10.123.123.123', '10.123.123.123'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'port', 12345, 12345), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'healthmonitor', 'NO', 'NO'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'netprofile', 'foo2cust-default-cert-snat-ip', 'foo2cust-default-cert-snat-ip'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'accessdown', 'NO', 'NO'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'appflowlog', 'ENABLED', 'ENABLED'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'cacheable', 'NO', 'NO'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'customserverid', '\"None\"', '\"None\"'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'downstateflush', 'ENABLED', 'ENABLED'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'graceful', 'NO', 'NO'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'processlocal', 'DISABLED', 'DISABLED'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: ENTRY: is_attribute_equal() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'rtspsessionidremap', 'OFF', 'OFF'), {}",
        "TRACE: EXIT: is_attribute_equal() returned True",
        "TRACE: EXIT: is_resource_identical() returned True",
        "INFO: Resource `service:10.123.123.123-tcp-12345` exists and is identical. No change required.",
        "TRACE: EXIT: create_or_update() returned None",
        "TRACE: ENTRY: sync_all_bindings() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>,), {}",
        "TRACE: ENTRY: sync_single_binding() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, 'service_lbmonitor_binding'), {}",
        "INFO: Binding mode is `desired`",
        "DEBUG: Desired binding members: [{'monitor_name': 'foo2cust-default-cert-snat-ip-tcp', 'servicename': '10.123.123.123-tcp-12345'}]",
        "TRACE: ENTRY: get_bindings() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>,), {'binding_name': 'service_lbmonitor_binding', 'binding_id': '10.123.123.123-tcp-12345'}",
        "TRACE: ENTRY: get_resource() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>,), {'resource_name': 'service_lbmonitor_binding', 'resource_id': '10.123.123.123-tcp-12345'}",
        "TRACE: ENTRY: send() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>, 'GET', 'https://10.133.254.35/nitro/v1/config/service_lbmonitor_binding/10.123.123.123-tcp-12345'), {}",
        "DEBUG: self={'_module': <ansible.module_utils.basic.AnsibleModule object at 0x7f29e92cf310>, '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.133.254.35/nitro/v1/config/service_lbmonitor_binding/10.123.123.123-tcp-12345', 'status': 200, 'date': 'Thu, 30 Nov 2023 02:42:32 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': '645', 'content-type': 'application/json; charset=utf-8', 'connection': 'close', 'cookies_string': '', 'cookies': {}, 'msg': 'OK (645 bytes)'}",
        "TRACE: EXIT: send() returned (200, {'errorcode': 0, 'message': 'Done', 'severity': 'NONE', 'service_lbmonitor_binding': [{'name': '10.123.123.123-tcp-12345', 'monitor_name': 'tcp-default', 'stateflag': '7168', 'monstate': 'ENABLED', 'monitor_state': 'UNKNOWN', 'dup_state': 'ENABLED', 'weight': '1', 'dup_weight': '1', 'totalprobes': '9000', 'totalfailedprobes': '9000', 'failedprobes': '0', 'monstatcode': 17, 'lastresponse': 'Probe skipped - Health monitoring is turned off.', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'responsetime': '0', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'passive': False}]})",
        "TRACE: EXIT: get_resource() returned [{'name': '10.123.123.123-tcp-12345', 'monitor_name': 'tcp-default', 'stateflag': '7168', 'monstate': 'ENABLED', 'monitor_state': 'UNKNOWN', 'dup_state': 'ENABLED', 'weight': '1', 'dup_weight': '1', 'totalprobes': '9000', 'totalfailedprobes': '9000', 'failedprobes': '0', 'monstatcode': 17, 'lastresponse': 'Probe skipped - Health monitoring is turned off.', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'responsetime': '0', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'passive': False}]",
        "TRACE: EXIT: get_bindings() returned [{'name': '10.123.123.123-tcp-12345', 'monitor_name': 'tcp-default', 'stateflag': '7168', 'monstate': 'ENABLED', 'monitor_state': 'UNKNOWN', 'dup_state': 'ENABLED', 'weight': '1', 'dup_weight': '1', 'totalprobes': '9000', 'totalfailedprobes': '9000', 'failedprobes': '0', 'monstatcode': 17, 'lastresponse': 'Probe skipped - Health monitoring is turned off.', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'responsetime': '0', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'passive': False}]",
        "DEBUG: Existing `service_lbmonitor_binding` bindings: [{'name': '10.123.123.123-tcp-12345', 'monitor_name': 'tcp-default', 'stateflag': '7168', 'monstate': 'ENABLED', 'monitor_state': 'UNKNOWN', 'dup_state': 'ENABLED', 'weight': '1', 'dup_weight': '1', 'totalprobes': '9000', 'totalfailedprobes': '9000', 'failedprobes': '0', 'monstatcode': 17, 'lastresponse': 'Probe skipped - Health monitoring is turned off.', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'responsetime': '0', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'passive': False}]",
        "DEBUG: To be deleted bindings: {'tcp-default'}",
        "DEBUG: To be added bindings: {'foo2cust-default-cert-snat-ip-tcp'}",
        "DEBUG: To be updated bindings: set()",
        "TRACE: ENTRY: delete_bindings() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>,), {'binding_name': 'service_lbmonitor_binding', 'bindprimary_key': 'monitor_name', 'to_be_deleted_bindings': {'tcp-default'}, 'existing_bindings': [{'name': '10.123.123.123-tcp-12345', 'monitor_name': 'tcp-default', 'stateflag': '7168', 'monstate': 'ENABLED', 'monitor_state': 'UNKNOWN', 'dup_state': 'ENABLED', 'weight': '1', 'dup_weight': '1', 'totalprobes': '9000', 'totalfailedprobes': '9000', 'failedprobes': '0', 'monstatcode': 17, 'lastresponse': 'Probe skipped - Health monitoring is turned off.', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'responsetime': '0', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'passive': False}]}",
        "TRACE: ENTRY: unbind_resource() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>,), {'binding_name': 'service_lbmonitor_binding', 'binding_module_params': {'name': '10.123.123.123-tcp-12345', 'monitor_name': 'tcp-default', 'stateflag': '7168', 'monstate': 'ENABLED', 'monitor_state': 'UNKNOWN', 'dup_state': 'ENABLED', 'weight': '1', 'dup_weight': '1', 'totalprobes': '9000', 'totalfailedprobes': '9000', 'failedprobes': '0', 'monstatcode': 17, 'lastresponse': 'Probe skipped - Health monitoring is turned off.', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'responsetime': '0', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'passive': False}}",
        "TRACE: ENTRY: delete_resource() called with (), {'client': <ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>, 'resource_name': 'service_lbmonitor_binding', 'resource_module_params': {'name': '10.123.123.123-tcp-12345', 'monitor_name': 'tcp-default', 'stateflag': '7168', 'monstate': 'ENABLED', 'monitor_state': 'UNKNOWN', 'dup_state': 'ENABLED', 'weight': '1', 'dup_weight': '1', 'totalprobes': '9000', 'totalfailedprobes': '9000', 'failedprobes': '0', 'monstatcode': 17, 'lastresponse': 'Probe skipped - Health monitoring is turned off.', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'responsetime': '0', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'passive': False}}",
        "TRACE: ENTRY: _check_delete_resource_params() called with ('service_lbmonitor_binding', {'name': '10.123.123.123-tcp-12345', 'monitor_name': 'tcp-default', 'stateflag': '7168', 'monstate': 'ENABLED', 'monitor_state': 'UNKNOWN', 'dup_state': 'ENABLED', 'weight': '1', 'dup_weight': '1', 'totalprobes': '9000', 'totalfailedprobes': '9000', 'failedprobes': '0', 'monstatcode': 17, 'lastresponse': 'Probe skipped - Health monitoring is turned off.', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'responsetime': '0', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'passive': False}), {}",
        "TRACE: EXIT: _check_delete_resource_params() returned (True, None)",
        "TRACE: ENTRY: is_resource_exists() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>, 'service_lbmonitor_binding', '10.123.123.123-tcp-12345'), {'filter': {'monitor_name': 'tcp-default'}}",
        "TRACE: ENTRY: send() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>, 'GET', 'https://10.133.254.35/nitro/v1/config/service_lbmonitor_binding/10.123.123.123-tcp-12345?filter=monitor_name:tcp-default'), {}",
        "DEBUG: self={'_module': <ansible.module_utils.basic.AnsibleModule object at 0x7f29e92cf310>, '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.133.254.35/nitro/v1/config/service_lbmonitor_binding/10.123.123.123-tcp-12345?filter=monitor_name:tcp-default', 'status': 200, 'date': 'Thu, 30 Nov 2023 02:42:34 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': '645', 'content-type': 'application/json; charset=utf-8', 'connection': 'close', 'cookies_string': '', 'cookies': {}, 'msg': 'OK (645 bytes)'}",
        "TRACE: EXIT: send() returned (200, {'errorcode': 0, 'message': 'Done', 'severity': 'NONE', 'service_lbmonitor_binding': [{'name': '10.123.123.123-tcp-12345', 'monitor_name': 'tcp-default', 'stateflag': '7168', 'monstate': 'ENABLED', 'monitor_state': 'UNKNOWN', 'dup_state': 'ENABLED', 'weight': '1', 'dup_weight': '1', 'totalprobes': '9000', 'totalfailedprobes': '9000', 'failedprobes': '0', 'monstatcode': 17, 'lastresponse': 'Probe skipped - Health monitoring is turned off.', 'monstatparam1': 0, 'monstatparam2': 0, 'monstatparam3': 0, 'responsetime': '0', 'monitortotalprobes': '0', 'monitortotalfailedprobes': '0', 'monitorcurrentfailedprobes': '0', 'passive': False}]})",
        "TRACE: EXIT: is_resource_exists() returned True",
        "TRACE: ENTRY: send() called with (<ansible_collections.netscaler.adc.plugins.module_utils.client.NitroAPIClient object at 0x7f29e861e670>, 'DELETE', 'https://10.133.254.35/nitro/v1/config/service_lbmonitor_binding/10.123.123.123-tcp-12345?args=monitor_name:tcp-default'), {}",
        "DEBUG: self={'_module': <ansible.module_utils.basic.AnsibleModule object at 0x7f29e92cf310>, '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.133.254.35/nitro/v1/config/service_lbmonitor_binding/10.123.123.123-tcp-12345?args=monitor_name:tcp-default', 'status': 599, 'date': 'Thu, 30 Nov 2023 02:42:36 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', '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': '105', 'content-type': 'application/json; charset=utf-8', 'connection': 'close', 'msg': 'HTTP Error 599: Netscaler specific error', 'body': b'{ \"errorcode\": 2164, \"message\": \"Default monitor cannot be unbound from a service\", \"severity\": \"ERROR\" }'}",
        "TRACE: EXIT: send() returned (599, {'errorcode': 2164, 'message': 'Default monitor cannot be unbound from a service', 'severity': 'ERROR'})",
        "TRACE: ENTRY: return_response() called with (), {'status_code': 599, 'response_body': {'errorcode': 2164, 'message': 'Default monitor cannot be unbound from a service', 'severity': 'ERROR'}, 'operation': 'delete_resource', 'resource_name': 'service_lbmonitor_binding', 'resource_id': '10.123.123.123-tcp-12345'}",
        "ERROR: delete_resource FAILED; status_code: 599; Reason:{'errorcode': 2164, 'message': 'Default monitor cannot be unbound from a service', 'severity': 'ERROR'}",
        "TRACE: EXIT: return_response() returned (False, \"ERROR: delete_resource FAILED; status_code: 599; Reason:{'errorcode': 2164, 'message': 'Default monitor cannot be unbound from a service', 'severity': 'ERROR'}\")",
        "TRACE: EXIT: delete_resource() returned (False, \"ERROR: delete_resource FAILED; status_code: 599; Reason:{'errorcode': 2164, 'message': 'Default monitor cannot be unbound from a service', 'severity': 'ERROR'}\")",
        "TRACE: EXIT: unbind_resource() returned (False, \"ERROR: delete_resource FAILED; status_code: 599; Reason:{'errorcode': 2164, 'message': 'Default monitor cannot be unbound from a service', 'severity': 'ERROR'}\")",
        "TRACE: EXIT: delete_bindings() returned (False, \"ERROR: delete_resource FAILED; status_code: 599; Reason:{'errorcode': 2164, 'message': 'Default monitor cannot be unbound from a service', 'severity': 'ERROR'}\")",
        "TRACE: ENTRY: return_failure() called with (<ansible_collections.netscaler.adc.plugins.module_utils.module_executor.ModuleExecutor object at 0x7f29e8ef9dc0>, \"ERROR: delete_resource FAILED; status_code: 599; Reason:{'errorcode': 2164, 'message': 'Default monitor cannot be unbound from a service', 'severity': 'ERROR'}\"), {}"
    ],
    "msg": "ERROR: delete_resource FAILED; status_code: 599; Reason:{'errorcode': 2164, 'message': 'Default monitor cannot be unbound from a service', 'severity': 'ERROR'}"
}

Additioinal Notes

No response

@sumanth-lingappa
Copy link
Collaborator

@pkodzis, thank you for the issue.

Before I give a fix, please try the below workaround.

  1. use mode: bind for binding_members. Default is mode: desired which deletes all other bindings except mentioned in the playbook. So this is also trying to delete the default binding.
  2. replace servicename with name
image

@pkodzis
Copy link
Author

pkodzis commented Dec 15, 2023

Yes, it functions with "bind" mode. However, this isn't a workaround that I can integrate into our pipeline to replace the existing 1.3.0 Citrix ADC collection. Our pipeline delegates all the monitor binding logic to Ansible and 1.3.0 collection does it for us just fine. Using "bind" mode with 2.0.3 would necessitate a redevelopment of the pipeline to check the state and then create the expected unbind/bind statements.

sumanth-lingappa added a commit that referenced this issue Dec 17, 2023
… cannot be unbound from a service'

Signed-off-by: Sumanth Lingappa <sumanth.lingappa@cloud.com>
sumanth-lingappa added a commit that referenced this issue Dec 17, 2023
### Added

- introduced new states -- `created` and `imported` ([#295])

### Fixed

- removed default values in `nitro_resource_map.py` ([#313], [#314], [#311])
- default monitor can now be unbound from service ([#312])
- `ip` is now not mandatory for server based resources ([#297])
@sumanth-lingappa
Copy link
Collaborator

This issue is fixed in the latest release 2.1.0. Please check and update the issue accordingly.

@pkodzis
Copy link
Author

pkodzis commented Dec 19, 2023

ack - it's resolved in 2.1.0. thank you so much! :)

@pkodzis pkodzis closed this as completed Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants