ansible-collections / cisco.nxos

Ansible Network Collection for Cisco NXOS
GNU General Public License v3.0
116 stars 109 forks source link

nxapi with cisco.nxos.nxos_l3_interfaces: "HttpApi.edit_config() got an unexpected keyword argument 'err_responses'" #893

Open jcremp77 opened 2 months ago

jcremp77 commented 2 months ago
SUMMARY

Ansible is returning an error when using NXAPI with module name 'cisco.nxos.nxos_l3_interfaces'

There do not seem to be any issues with:

cisco.nxos.nxos_config
cisco.nxos.nxos_interfaces

Was able to use these Ansible modules via the NXAPI with no issues.

ISSUE TYPE

Cannot configure Cisco Nexus switchport using module: cisco.nxos.nxos_l3_interfaces, via httpapi.

Snippet of error returned:

"HttpApi.edit_config() got an unexpected keyword argument 'err_responses'"
COMPONENT NAME

Ansible Module: cisco.nxos.nxos_l3_interfaces

This module is part of the cisco.nxos collection (version 8.1.0).
ANSIBLE VERSION
ansible [core 2.17.3]
  config file = /home/user/ansible/playbooks/nxos/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/automation/lib/python3.10/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/user/automation/bin/ansible
  python version = 3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0] (/home/user/automation/bin/python3)
  jinja version = 3.1.4
  libyaml = True
COLLECTION VERSION
# /home/user/.ansible/collections/ansible_collections
Collection Version
---------- -------
cisco.nxos 9.2.1  

# /home/user/automation/lib/python3.10/site-packages/ansible_collections
Collection Version
---------- -------
cisco.nxos 8.1.0
CONFIGURATION
CONFIG_FILE() = /home/user/ansible/playbooks/nxos/ansible.cfg
HOST_KEY_CHECKING(/home/user/ansible/playbooks/nxos/ansible.cfg) = False
OS / ENVIRONMENT

Ansible control node: Ubuntu Desktop 22.04 Linux tools-auto-01 5.15.0-27-generic #28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Ansible Target Node: Cisco Nexus 9000v nxos.9.3.9.bin

STEPS TO REPRODUCE
  1. Deploy 1 x Cisco nexus 9000v with the aforementioned image file.

  2. Deploy 1 x Ansible Control Node with Python3, Ansible, Ansible-Galaxy (with NXOS), install roles 'spine' and 'leaf'.

  3. Connect both the Target (nxos) and Control nodes to some management network.

  4. Configure 'interface mgmt 0' on Cisco Nexus virtual switch.

    interface mgmt 0
    ip address <ip_address/mask>
    no shut
  5. Configure Control Node with IP address on same network as the Cisco Nexus virtual switch.

  6. Configure '/group_vars/all' file on the Ansible Control Node:

    ansible_httpapi_use_ssl: yes
    ansible_httpapi_validate_certs: no
    ansible_network_os: nxos
    ansible_user: admin
    ansible_httpapi_pass: Test123
  7. On the Control Node create 'hosts' file in the root of the 'playbook' folder:

    # fabric inventory
    spine:
    hosts:
    sp01:
      ansible_host: 192.168.1.161
    sp02:
      ansible_host: 192.168.1.162
  8. On the Control Node create '/roles/spine/tasks/main.yml'

    cisco.nxos.nxos_l3_interfaces:
    config:
      - name: "{{ item.interface }}"
        ipv4:
          - address: "{{ item.addr }}"
            tag: "{{ item.tag }}"
    state: merged
    loop: "{{ interfaces }}"
  9. On the Control Node create '/host_vars/sp01.yml'

  - { interface: Ethernet1/1, addr: 10.1.1.0/31, tag: 20001, description: lf01.e1/1 }
  - { interface: Ethernet1/2, addr: 10.1.1.2/31, tag: 20001, description: lf02.e1/1 }
  - { interface: Ethernet1/3, addr: 10.1.1.4/31, tag: 20001, description: lf03.e1/1 }
  - { interface: Ethernet1/4, addr: 10.1.1.6/31, tag: 20001, description: lf04.e1/1 }
  1. Module with provided values (Optional: but still fails)
    - name: CONFIGURE PHYSICAL INTERFACE IP ADDRESS AND TAGGING
    cisco.nxos.nxos_l3_interfaces:
    config:
      - name: Ethernet1/1
        ipv4:
          - address: 10.1.1.0/31
            tag: 20001
EXPECTED RESULTS

no errors

ACTUAL RESULTS

Using Module with variables

(automation) user@tools-auto-01:~/ansible/playbooks/nxos$ ansible-playbook -i hosts.yml site.yml -vvvv
ansible-playbook [core 2.17.3]
  config file = /home/user/ansible/playbooks/nxos/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/automation/lib/python3.10/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/user/automation/bin/ansible-playbook
  python version = 3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0] (/home/user/automation/bin/python3)
  jinja version = 3.1.4
  libyaml = True
Using /home/user/ansible/playbooks/nxos/ansible.cfg as config file
setting up inventory plugins
Loading collection ansible.builtin from 
host_list declined parsing /home/user/ansible/playbooks/nxos/hosts.yml as it did not pass its verify_file() method
script declined parsing /home/user/ansible/playbooks/nxos/hosts.yml as it did not pass its verify_file() method
Parsed /home/user/ansible/playbooks/nxos/hosts.yml inventory source with yaml plugin
Loading collection cisco.nxos from /home/user/.ansible/collections/ansible_collections/cisco/nxos
Loading callback plugin default of type stdout, v2.0 from /home/user/automation/lib/python3.10/site-packages/ansible/plugins/callback/default.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: site.yml *****************************************************************************************************************************************************************************************
Positional arguments: site.yml
verbosity: 4
connection: ssh
become_method: sudo
tags: ('all',)
inventory: ('/home/user/ansible/playbooks/nxos/hosts.yml',)
forks: 5
1 plays in site.yml

PLAY [CONFIGURE SPINES] ************************************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************************************
task path: /home/user/ansible/playbooks/nxos/site.yml:4
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
Loading collection ansible.netcommon from /home/user/automation/lib/python3.10/site-packages/ansible_collections/ansible/netcommon
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
Loading collection ansible.netcommon from /home/user/automation/lib/python3.10/site-packages/ansible_collections/ansible/netcommon
Loading collection ansible.utils from /home/user/automation/lib/python3.10/site-packages/ansible_collections/ansible/utils
redirecting (type: httpapi) ansible.builtin.nxos to cisco.nxos.nxos
<192.168.1.161> attempting to start connection
<192.168.1.161> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /home/user/automation/bin/ansible-connection
Loading collection ansible.utils from /home/user/automation/lib/python3.10/site-packages/ansible_collections/ansible/utils
redirecting (type: httpapi) ansible.builtin.nxos to cisco.nxos.nxos
<192.168.1.162> attempting to start connection
<192.168.1.162> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /home/user/automation/bin/ansible-connection
<192.168.1.161> local domain socket does not exist, starting it
<192.168.1.161> control socket path is /home/user/.ansible/pc/a349cbe63e
<192.168.1.161> Loading collection ansible.builtin from 
<192.168.1.161> redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
<192.168.1.161> Loading collection ansible.netcommon from /home/user/automation/lib/python3.10/site-packages/ansible_collections/ansible/netcommon
<192.168.1.161> Loading collection ansible.utils from /home/user/automation/lib/python3.10/site-packages/ansible_collections/ansible/utils
<192.168.1.161> redirecting (type: httpapi) ansible.builtin.nxos to cisco.nxos.nxos
<192.168.1.161> Loading collection cisco.nxos from /home/user/.ansible/collections/ansible_collections/cisco/nxos
<192.168.1.161> local domain socket listeners started successfully
<192.168.1.161> loaded API plugin ansible_collections.cisco.nxos.plugins.httpapi.nxos from path /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/httpapi/nxos.py for platform type nxos
<192.168.1.161> Loading collection ansible.builtin from 
<192.168.1.161> local domain socket path is /home/user/.ansible/pc/a349cbe63e
redirecting (type: modules) ansible.builtin.nxos_facts to cisco.nxos.nxos_facts
<192.168.1.161> ESTABLISH LOCAL CONNECTION FOR USER: user
<192.168.1.161> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/user/.ansible/tmp/ansible-local-308821fzqspgw8 `"&& mkdir "` echo /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.3418782-308824-139063521505167 `" && echo ansible-tmp-1725347051.3418782-308824-139063521505167="` echo /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.3418782-308824-139063521505167 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.nxos_facts to cisco.nxos.nxos_facts
<192.168.1.162> local domain socket does not exist, starting it
<192.168.1.162> control socket path is /home/user/.ansible/pc/967d2552ad
<192.168.1.162> Loading collection ansible.builtin from 
<192.168.1.162> redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
<192.168.1.162> Loading collection ansible.netcommon from /home/user/automation/lib/python3.10/site-packages/ansible_collections/ansible/netcommon
<192.168.1.162> Loading collection ansible.utils from /home/user/automation/lib/python3.10/site-packages/ansible_collections/ansible/utils
<192.168.1.162> redirecting (type: httpapi) ansible.builtin.nxos to cisco.nxos.nxos
<192.168.1.162> Loading collection cisco.nxos from /home/user/.ansible/collections/ansible_collections/cisco/nxos
<192.168.1.162> local domain socket listeners started successfully
<192.168.1.162> loaded API plugin ansible_collections.cisco.nxos.plugins.httpapi.nxos from path /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/httpapi/nxos.py for platform type nxos
<192.168.1.162> Loading collection ansible.builtin from 
<192.168.1.162> local domain socket path is /home/user/.ansible/pc/967d2552ad
redirecting (type: modules) ansible.builtin.nxos_facts to cisco.nxos.nxos_facts
<192.168.1.162> ESTABLISH LOCAL CONNECTION FOR USER: user
<192.168.1.162> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/user/.ansible/tmp/ansible-local-308821fzqspgw8 `"&& mkdir "` echo /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.5326216-308825-186024266892987 `" && echo ansible-tmp-1725347051.5326216-308825-186024266892987="` echo /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.5326216-308825-186024266892987 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.nxos_facts to cisco.nxos.nxos_facts
Using module file /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_facts.py
<192.168.1.161> PUT /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/tmp35400u49 TO /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.3418782-308824-139063521505167/AnsiballZ_nxos_facts.py
<192.168.1.161> EXEC /bin/sh -c 'chmod u+x /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.3418782-308824-139063521505167/ /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.3418782-308824-139063521505167/AnsiballZ_nxos_facts.py && sleep 0'
Using module file /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_facts.py
<192.168.1.162> PUT /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/tmp1hehv0ba TO /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.5326216-308825-186024266892987/AnsiballZ_nxos_facts.py
<192.168.1.162> EXEC /bin/sh -c 'chmod u+x /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.5326216-308825-186024266892987/ /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.5326216-308825-186024266892987/AnsiballZ_nxos_facts.py && sleep 0'
<192.168.1.161> EXEC /bin/sh -c '/home/user/automation/bin/python3 /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.3418782-308824-139063521505167/AnsiballZ_nxos_facts.py && sleep 0'
<192.168.1.162> EXEC /bin/sh -c '/home/user/automation/bin/python3 /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.5326216-308825-186024266892987/AnsiballZ_nxos_facts.py && sleep 0'
<192.168.1.161> EXEC /bin/sh -c 'rm -f -r /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.3418782-308824-139063521505167/ > /dev/null 2>&1 && sleep 0'
ok: [sp01]
<192.168.1.162> EXEC /bin/sh -c 'rm -f -r /home/user/.ansible/tmp/ansible-local-308821fzqspgw8/ansible-tmp-1725347051.5326216-308825-186024266892987/ > /dev/null 2>&1 && sleep 0'
ok: [sp02]

TASK [spine : CONFIGURE PHYSICAL INTERFACE IP ADDRESS AND TAGGING] *****************************************************************************************************************************************
task path: /home/user/ansible/playbooks/nxos/roles/spine/tasks/main.yml:5
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
Loading collection ansible.netcommon from /home/user/automation/lib/python3.10/site-packages/ansible_collections/ansible/netcommon
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
Loading collection ansible.netcommon from /home/user/automation/lib/python3.10/site-packages/ansible_collections/ansible/netcommon
Loading collection ansible.utils from /home/user/automation/lib/python3.10/site-packages/ansible_collections/ansible/utils
redirecting (type: httpapi) ansible.builtin.nxos to cisco.nxos.nxos
<192.168.1.161> Using network group action cisco.nxos.nxos for cisco.nxos.nxos_l3_interfaces
<192.168.1.161> attempting to start connection
<192.168.1.161> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /home/user/automation/bin/ansible-connection
Loading collection ansible.utils from /home/user/automation/lib/python3.10/site-packages/ansible_collections/ansible/utils
redirecting (type: httpapi) ansible.builtin.nxos to cisco.nxos.nxos
<192.168.1.162> Using network group action cisco.nxos.nxos for cisco.nxos.nxos_l3_interfaces
<192.168.1.162> attempting to start connection
<192.168.1.162> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /home/user/automation/bin/ansible-connection
<192.168.1.161> found existing local domain socket, using it!
<192.168.1.161> ESTABLISH HTTP(S) CONNECTFOR USER: admin TO https://192.168.1.161:443
<192.168.1.161> updating play_context for connection
<192.168.1.161> Loading collection ansible.builtin from 
<192.168.1.161> local domain socket path is /home/user/.ansible/pc/a349cbe63e
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<192.168.1.162> found existing local domain socket, using it!
<192.168.1.162> ESTABLISH HTTP(S) CONNECTFOR USER: admin TO https://192.168.1.162:443
<192.168.1.162> updating play_context for connection
<192.168.1.162> Loading collection ansible.builtin from 
<192.168.1.162> local domain socket path is /home/user/.ansible/pc/967d2552ad
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.nxos.nxos_l3_interfaces  at /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_l3_interfaces.py
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.nxos.nxos_l3_interfaces
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.nxos.nxos_l3_interfaces  at /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_l3_interfaces.py
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.nxos.nxos_l3_interfaces
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: complete
failed: [sp02] (item={'interface': 'Ethernet1/1', 'addr': '10.1.1.8/31', 'tag': 20001, 'description': 'lf01.e1/2'}) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": {
        "addr": "10.1.1.8/31",
        "description": "lf01.e1/2",
        "interface": "Ethernet1/1",
        "tag": 20001
    },
    "module_stderr": "HttpApi.edit_config() got an unexpected keyword argument 'err_responses'",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}
<192.168.1.162> Using network group action cisco.nxos.nxos for cisco.nxos.nxos_l3_interfaces
<192.168.1.162> attempting to start connection
<192.168.1.162> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /home/user/automation/bin/ansible-connection
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: complete
failed: [sp01] (item={'interface': 'Ethernet1/1', 'addr': '10.1.1.0/31', 'tag': 20001, 'description': 'lf01.e1/1'}) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": {
        "addr": "10.1.1.0/31",
        "description": "lf01.e1/1",
        "interface": "Ethernet1/1",
        "tag": 20001
    },
    "module_stderr": "HttpApi.edit_config() got an unexpected keyword argument 'err_responses'",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}
<192.168.1.161> Using network group action cisco.nxos.nxos for cisco.nxos.nxos_l3_interfaces
<192.168.1.161> attempting to start connection
<192.168.1.161> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /home/user/automation/bin/ansible-connection
<192.168.1.162> found existing local domain socket, using it!
<192.168.1.162> updating play_context for connection
<192.168.1.162> Loading collection ansible.builtin from 
<192.168.1.162> local domain socket path is /home/user/.ansible/pc/967d2552ad
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.nxos.nxos_l3_interfaces  at /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_l3_interfaces.py
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.nxos.nxos_l3_interfaces
<192.168.1.161> found existing local domain socket, using it!
<192.168.1.161> updating play_context for connection
<192.168.1.161> Loading collection ansible.builtin from 
<192.168.1.161> local domain socket path is /home/user/.ansible/pc/a349cbe63e
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.nxos.nxos_l3_interfaces  at /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_l3_interfaces.py
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.nxos.nxos_l3_interfaces
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: complete
failed: [sp02] (item={'interface': 'Ethernet1/2', 'addr': '10.1.1.10/31', 'tag': 20001, 'description': 'lf02.e1/2'}) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": {
        "addr": "10.1.1.10/31",
        "description": "lf02.e1/2",
        "interface": "Ethernet1/2",
        "tag": 20001
    },
    "module_stderr": "HttpApi.edit_config() got an unexpected keyword argument 'err_responses'",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}
<192.168.1.162> Using network group action cisco.nxos.nxos for cisco.nxos.nxos_l3_interfaces
<192.168.1.162> attempting to start connection
<192.168.1.162> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /home/user/automation/bin/ansible-connection
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: complete
failed: [sp01] (item={'interface': 'Ethernet1/2', 'addr': '10.1.1.2/31', 'tag': 20001, 'description': 'lf02.e1/1'}) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": {
        "addr": "10.1.1.2/31",
        "description": "lf02.e1/1",
        "interface": "Ethernet1/2",
        "tag": 20001
    },
    "module_stderr": "HttpApi.edit_config() got an unexpected keyword argument 'err_responses'",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}
<192.168.1.161> Using network group action cisco.nxos.nxos for cisco.nxos.nxos_l3_interfaces
<192.168.1.161> attempting to start connection
<192.168.1.161> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /home/user/automation/bin/ansible-connection
<192.168.1.162> found existing local domain socket, using it!
<192.168.1.162> updating play_context for connection
<192.168.1.162> Loading collection ansible.builtin from 
<192.168.1.162> local domain socket path is /home/user/.ansible/pc/967d2552ad
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.nxos.nxos_l3_interfaces  at /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_l3_interfaces.py
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.nxos.nxos_l3_interfaces
<192.168.1.161> found existing local domain socket, using it!
<192.168.1.161> updating play_context for connection
<192.168.1.161> Loading collection ansible.builtin from 
<192.168.1.161> local domain socket path is /home/user/.ansible/pc/a349cbe63e
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.nxos.nxos_l3_interfaces  at /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_l3_interfaces.py
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.nxos.nxos_l3_interfaces
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: complete
failed: [sp02] (item={'interface': 'Ethernet1/3', 'addr': '10.1.1.12/31', 'tag': 20001, 'description': 'lf03.e1/2'}) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": {
        "addr": "10.1.1.12/31",
        "description": "lf03.e1/2",
        "interface": "Ethernet1/3",
        "tag": 20001
    },
    "module_stderr": "HttpApi.edit_config() got an unexpected keyword argument 'err_responses'",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}
<192.168.1.162> Using network group action cisco.nxos.nxos for cisco.nxos.nxos_l3_interfaces
<192.168.1.162> attempting to start connection
<192.168.1.162> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /home/user/automation/bin/ansible-connection
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: complete
failed: [sp01] (item={'interface': 'Ethernet1/3', 'addr': '10.1.1.4/31', 'tag': 20001, 'description': 'lf03.e1/1'}) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": {
        "addr": "10.1.1.4/31",
        "description": "lf03.e1/1",
        "interface": "Ethernet1/3",
        "tag": 20001
    },
    "module_stderr": "HttpApi.edit_config() got an unexpected keyword argument 'err_responses'",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}
<192.168.1.161> Using network group action cisco.nxos.nxos for cisco.nxos.nxos_l3_interfaces
<192.168.1.161> attempting to start connection
<192.168.1.161> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /home/user/automation/bin/ansible-connection
<192.168.1.162> found existing local domain socket, using it!
<192.168.1.162> updating play_context for connection
<192.168.1.162> Loading collection ansible.builtin from 
<192.168.1.162> local domain socket path is /home/user/.ansible/pc/967d2552ad
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.nxos.nxos_l3_interfaces  at /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_l3_interfaces.py
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.nxos.nxos_l3_interfaces
<192.168.1.161> found existing local domain socket, using it!
<192.168.1.161> updating play_context for connection
<192.168.1.161> Loading collection ansible.builtin from 
<192.168.1.161> local domain socket path is /home/user/.ansible/pc/a349cbe63e
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.nxos.nxos_l3_interfaces  at /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_l3_interfaces.py
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.nxos.nxos_l3_interfaces
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: complete
failed: [sp02] (item={'interface': 'Ethernet1/4', 'addr': '10.1.1.14/31', 'tag': 20001, 'description': 'lf04.e1/2'}) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": {
        "addr": "10.1.1.14/31",
        "description": "lf04.e1/2",
        "interface": "Ethernet1/4",
        "tag": 20001
    },
    "module_stderr": "HttpApi.edit_config() got an unexpected keyword argument 'err_responses'",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: complete
failed: [sp01] (item={'interface': 'Ethernet1/4', 'addr': '10.1.1.6/31', 'tag': 20001, 'description': 'lf04.e1/1'}) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": {
        "addr": "10.1.1.6/31",
        "description": "lf04.e1/1",
        "interface": "Ethernet1/4",
        "tag": 20001
    },
    "module_stderr": "HttpApi.edit_config() got an unexpected keyword argument 'err_responses'",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}

PLAY RECAP *************************************************************************************************************************************************************************************************
sp01                       : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
sp02                       : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Using Module with provided values; note: (truncated for brevity)

<192.168.1.162> Using network group action cisco.nxos.nxos for cisco.nxos.nxos_l3_interfaces
<192.168.1.162> attempting to start connection
<192.168.1.162> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /home/user/automation/bin/ansible-connection
<192.168.1.161> found existing local domain socket, using it!
<192.168.1.161> updating play_context for connection
<192.168.1.161> Loading collection ansible.builtin from 
<192.168.1.161> local domain socket path is /home/user/.ansible/pc/0e1da04191
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.nxos.nxos_l3_interfaces  at /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_l3_interfaces.py
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.nxos.nxos_l3_interfaces
<192.168.1.162> found existing local domain socket, using it!
<192.168.1.162> updating play_context for connection
<192.168.1.162> Loading collection ansible.builtin from 
<192.168.1.162> local domain socket path is /home/user/.ansible/pc/29d9816647
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.nxos.nxos_l3_interfaces  at /home/user/.ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_l3_interfaces.py
<192.168.1.162> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.nxos.nxos_l3_interfaces
<192.168.1.161> ANSIBLE_NETWORK_IMPORT_MODULES: complete
failed: [sp01] (item={'interface': 'Ethernet1/4', 'addr': '10.1.1.6/31', 'tag': 20001, 'description': 'lf04.e1/1'}) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": {
        "addr": "10.1.1.6/31",
        "description": "lf04.e1/1",
        "interface": "Ethernet1/4",
        "tag": 20001
    },
    "module_stderr": "HttpApi.edit_config() got an unexpected keyword argument 'err_responses'",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}
oh-c commented 2 months ago

Seems it was introduced with https://github.com/ansible-collections/cisco.nxos/commit/5b461af7f4e7d5fc38365db15055370c32e3a2b6

jcremp77 commented 2 months ago

It appears to be in context to 'sub-interface encapsulation' which is not part of the scenario here.

Ruchip16 commented 2 months ago

@jcremp77 whats the ansible.netcommon version you are using here? Can you please check this with using the latest ansible.netcommon version and if it solves this issue?

jcremp77 commented 2 months ago

@Ruchip16 'ansible.netcommon 6.1.3'; the site shows this to be latest, and is the version I have been testing with.

https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/index.html

oh-c commented 2 months ago

I see the same issue with ansible.netcommon 7.1.0 and cisco.nxos 9.2.1

sdktr commented 3 weeks ago

I can reproduce the same issue with nxos versions 8.1.0 and newer.

Problem doesn't present when running 8.0.0 (ansible-galaxy collection install cisco.nxos==8.0.0)

Other versions used: 'ansible.netcommon:6.1.0' 'ansible.utils:4.0.0'

sdktr commented 3 weeks ago

I can reproduce the same issue with nxos versions 8.1.0 and newer.

Problem doesn't present when running 8.0.0 (ansible-galaxy collection install cisco.nxos==8.0.0)

Other versions used: 'ansible.netcommon:6.1.0' 'ansible.utils:4.0.0'

ansible.netcommon==7.2.1 has the same issue here