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

cisco.dnac.global_pool is trying to create even though IP pool exists, if pool exist update should be done #128

Open
DNACENSolutions opened this issue Nov 19, 2023 · 1 comment

Comments

@DNACENSolutions
Copy link

Prerequisites

  • [Y ] Have you tested the operation in the API directly?
  • [ Y] Do you have the latest Ansible collection version?
  • [ Y] Review the compatibility matrix before opening an issue.

Describe the bug
global_pool module is not handling the situation when pool exist, it still tries to create which makes the operation fail.
Also the module does not check the execution status and return success even through exectuin status shows failed.

Expected behavior
When IP pool already exist then if the parameters are changed then update should be tried in place of POST. Also the execution status should be check for correct status.

Screenshots
"item": {
"IpAddressSpace": "IPv4",
"dhcpServerIps": [
"204.192.3.40"
],
"dnsServerIps": [
"171.70.168.183"
],
"gateway": "204.1.32.1",
"ipPoolCidr": "204.1.32.0/20",
"ipPoolName": "EXT_POOL",
"type": "Generic"
},
"result": "Object already present"
}
changed: [dnaccluster14] => (item={'IpAddressSpace': 'IPv4', 'dhcpServerIps': ['204.192.3.40'], 'dnsServerIps': ['171.70.168.183'], 'gateway': '40.10.0.1', 'ipPoolCidr': '40.10.0.0/16', 'ipPoolName': 'Fabric_VN', 'type': 'Generic'}) => {
"ansible_loop_var": "item",
"changed": true,
"dnac_response": {
"executionId": "228c6c0c-d252-433a-a9d2-91f6392b56ca",
"executionStatusUrl": "/dna/platform/management/business-api/v1/execution-status/228c6c0c-d252-433a-a9d2-91f6392b56ca",
"message": "The request has been accepted for execution"
},
"item": {
"IpAddressSpace": "IPv4",
"dhcpServerIps": [
"204.192.3.40"
],
"dnsServerIps": [
"171.70.168.183"
],
"gateway": "40.10.0.1",
"ipPoolCidr": "40.10.0.0/16",
"ipPoolName": "Fabric_VN",
"type": "Generic"
},
"result": "Object created"
}

/dna/intent/api/v1/dnacaap/management/execution-status/228c6c0c-d252-433a-a9d2-91f6392b56ca
{
"bapiKey": "f793-192a-43da-bed9",
"bapiName": "Create Global Pool",
"bapiExecutionId": "228c6c0c-d252-433a-a9d2-91f6392b56ca",
"startTime": "Sun Nov 19 12:39:36 UTC 2023",
"startTimeEpoch": 1700397576741,
"endTime": "Sun Nov 19 12:39:37 UTC 2023",
"endTimeEpoch": 1700397577248,
"timeDuration": 507,
"status": "FAILURE",
"bapiError": "{"status":false,"errorMessage":[{"ippool":["NCIP10251: A pool named Fabric_VN already exists, which conflicts with the proposed global pool. for ip pool name Fabric_VN."]}]}",
"runtimeInstanceId": "DNACP_Runtime_24b23bf2-e056-452c-b1ad-beaee0b91e4c"
}

Environment (please complete the following information):

  • Cisco DNA Center Version and patch: 2.3.5.3
  • Ansible Version:
  • Collection version: 6.8.0
  • OS Version:

Additional context
Add any other context about the problem here.

@bvargasre
Copy link
Collaborator

Hi @DNACENSolutions
Can you send me the playbook you used?
Also add dnac_debug: true and replicate the error and send me the output

bvargasre pushed a commit that referenced this issue Feb 5, 2024
Address the issue of editing the management IP of a device that alrea…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants