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

lan_automation_create seems to loose provided IP pool parameters #150

Open
3 tasks done
pepemikrobi opened this issue Feb 12, 2024 · 0 comments
Open
3 tasks done

Comments

@pepemikrobi
Copy link

Prerequisites

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

Describe the bug
It seems that parameters passed to ipPools get lost somehow. The parameters pass through the validation and the API call is executed, however I get "[400] Bad Request - Enter correct IP pool or IP pool can not be empty."

Expected behavior
LAN Automation session should be created properly

Screenshots


This is a sample task with parameters and the output:

  • name: Create LAN Automation
    cisco.dnac.lan_automation_create:
    dnac_host: "{{ dnac_host }}"
    dnac_verify: "{{ dnac_verify }}"
    payload:
    - discoveredDeviceSiteNameHierarchy: "Global/Poland/Warszawa/Hector"
    - ipPools:
    - ipPoolName: "UNDERLAY"
    ipPoolRole: "MAIN_POOL"
    #- isisDomainPwd: "{{ isis_password }}"
    - mulitcastEnabled: true
    - primaryDeviceManagmentIPAddress: "10.15.127.3"
    - primaryDeviceInterfaceNames:
    - "GigabitEthernet1/0/1"
    - "GigabitEthernet1/0/2"
    - "GigabitEthernet1/0/3"
    - "GigabitEthernet1/0/4"
    register: lan_auto_create_output
    debugger: always

TASK [lan_auto : Create LAN Automation] **********************************************************************************************************************************************************************
task path: /home/pod5/DCNDEV/Ansible_DNAC/roles/lan_auto/tasks/main.yml:105

The full traceback is:
Traceback (most recent call last):
File "/home/pod5/.ansible/collections/ansible_collections/cisco/dnac/plugins/plugin_utils/dnac.py", line 231, in exec
response = func(**params)
File "/home/pod5/DCNDEV/Ansible_DNAC/v1/lib/python3.10/site-packages/dnacentersdk/api/v2_3_5_3/lan_automation.py", line 132, in lan_automation_start
json_data = self._session.post(endpoint_full_url, params=_params,
File "/home/pod5/DCNDEV/Ansible_DNAC/v1/lib/python3.10/site-packages/dnacentersdk/restsession.py", line 619, in post
response = self.request('POST', url, erc, 0, params=params,
File "/home/pod5/DCNDEV/Ansible_DNAC/v1/lib/python3.10/site-packages/dnacentersdk/restsession.py", line 471, in request
check_response_code(response, erc)
File "/home/pod5/DCNDEV/Ansible_DNAC/v1/lib/python3.10/site-packages/dnacentersdk/utils.py", line 209, in check_response_code
raise ApiError(response)
dnacentersdk.exceptions.ApiError: [400] Bad Request - Enter correct IP pool or IP pool can not be empty.
fatal: [pod5_dnac]: FAILED! => {
"changed": false,
"msg": "An error occured when executing operation. The error was: [400] Bad Request - Enter correct IP pool or IP pool can not be empty."
}
[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)>
[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)>
[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)> ?

Documented commands (type help ):
EOF c continue h help p pprint q quit r redo u update_task

[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)> p
***SyntaxError:SyntaxError('invalid syntax', ('', 0, 0, '', 0, 0))
[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)> p task.args
{'dnac_debug': False,
'dnac_host': 'pod5-dnac.sdn.lab',
'dnac_password': 'Admeen5sisko',
'dnac_port': 443,
'dnac_username': 'admin',
'dnac_verify': False,
'dnac_version': '2.3.5.3',
'payload': [{'discoveredDeviceSiteNameHierarchy': 'Global/Poland/Warszawa/Hector'},
{'ipPools': [{'ipPoolName': 'UNDERLAY',
'ipPoolRole': 'MAIN_POOL'}]},
{'mulitcastEnabled': True},
{'primaryDeviceManagmentIPAddress': '10.15.127.3'},
{'primaryDeviceInterfaceNames': ['GigabitEthernet1/0/1',
'GigabitEthernet1/0/2',
'GigabitEthernet1/0/3',
'GigabitEthernet1/0/4']}],
'validate_response_schema': True}


When I run this call with the same parameters using SDK directly, it succeeds, a LAN Auto session is created:

def lan_auto_start(pod):

s = \
[
    {
        "discoveredDeviceSiteNameHierarchy": "Global/Poland/Warszawa/Hector",
        "primaryDeviceManagmentIPAddress": "10.15.127.3",
        "primaryDeviceInterfaceNames": [
            "GigabitEthernet1/0/1",
            "GigabitEthernet1/0/2",
            "GigabitEthernet1/0/3",
            "GigabitEthernet1/0/4"
        ],
        "ipPools": [
            {
                "ipPoolName": "UNDERLAY",
                "ipPoolRole": "MAIN_POOL"
            }
        ],
        "mulitcastEnabled": True
        #"isisDomainPwd": "sisko"
    }
]

try:
    dnac.lan_automation.lan_automation_start(payload=s)

Environment (please complete the following information):

  • Cisco DNA Center Version and patch: 2.3.7.4
  • Ansible Version: 2.16.3 installed from pip
  • Collection version: 2.6.11 installed from pip
  • OS Version: Ubuntu 22.04.3

Additional context
Add any other context about the problem here.

wastorga pushed a commit that referenced this issue Feb 21, 2024
Added a global documentation file for all the workflow_manager modules
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

1 participant