netascode / ansible-dc-vxlan

Ansible Collection for configuring a VXLAN Fabric using Direct to Controller (DTC) or Direct To Device (DTD) workflows.
https://galaxy.ansible.com/ui/repo/published/cisco/nac_dc_vxlan/
MIT License
6 stars 6 forks source link

Verify Authorization to NDFC fails for non-default HTTP port #151

Closed marehler closed 1 month ago

marehler commented 1 month ago

Error message:

TASK [cisco.nac_dc_vxlan.validate : Verify Authorization to NDFC localhost on Port 8442] *****************************
fatal: [marehler_vnd2 -> localhost]: FAILED! => {"changed": false, "elapsed": 0, "msg": "Status code was -1 and not [200]: Request failed: <urlopen error [Errno 61] Connection refused>", "redirected": false, "status": -1, "url": "https://localhost/login"}

Root cause:

The HTTP port is missing in the URL in nac_dc_vxlan/roles/validate/tasks/verify_ndfc_authorization.yml:

- name: Verify Authorization to NDFC
  block:
    - name: Verify Authorization to NDFC {{ ansible_host }} on Port {{ ansible_httpapi_port | default(443) }}
      ansible.builtin.uri:
        url: "https://{{ ansible_host }}/login"
        method: POST
        <...>

Proposed fix:

    url: "https://{{ ansible_host }}:{{ ansible_httpapi_port | default(443) }}/login"