ansible-collections/cisco.nxos

ansible_net_all_ipv6_addresses array is empty even when interfaces with ipv6 addresses are configured. This issue is not replicated on IOS or IOSXR.

digitalfiend64 opened this issue · 1 comments

SUMMARY

ansible_net_all_ipv6_addresses array is empty even when interfaces with ipv6 addresses are configured. This issue is not replicated on IOS or IOSXR.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

cisco.nxos v5.2.1

ANSIBLE VERSION

Ansible v2.12.6

COLLECTION VERSION
# /home/<username>/.ansible/collections/ansible_collections
Collection Version
---------- -------
cisco.nxos 4.4.0
CONFIGURATION
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/<username>/.ansible.cfg) = True
DEFAULT_STDOUT_CALLBACK(/home/<username>/.ansible.cfg) = yaml
DEFAULT_TIMEOUT(/home/<username>/.ansible.cfg) = 120
DEPRECATION_WARNINGS(/home/<username>/.ansible.cfg) = False
GALAXY_IGNORE_CERTS(/home/<username>/.ansible.cfg) = True
GALAXY_SERVER_LIST(/home/<username>/.ansible.cfg) = ['inbound_yeti_repo', 'published_repo', 'rh-certified_repo']
HOST_KEY_CHECKING(/home/<username>/.ansible.cfg) = False
PARAMIKO_HOST_KEY_AUTO_ADD(/home/<username>/.ansible.cfg) = True
PERSISTENT_COMMAND_TIMEOUT(/home/<username>/.ansible.cfg) = 300
PERSISTENT_CONNECT_TIMEOUT(/home/<username>/.ansible.cfg) = 120
RETRY_FILES_ENABLED(/home/<username>/.ansible.cfg) = False
OS / ENVIRONMENT

cisco Nexus3000 C31128PQ-10GE Chassis (Nexus 9000 Series)
version 7.0(3)I7(6)

STEPS TO REPRODUCE
  1. Run the Interface Update Implementation playbook
---
- name: Test ansible_net_all_ipv6_addresses var
  hosts: all
  gather_facts: no
  tasks:
      - name: Set IP on interface
        cisco.nxos.nxos_l3_interfaces:
            config:
                - name: interface1
                      ipv6:
                          - address: ipv6_address
            state: merged
     - name: DEBUG v6
       debug:
           var: ansible_net_all_ipv6_addresses
EXPECTED RESULTS

ansible_net_all_ipv6_addresses should contain IPv6 addresses configured on interfaces.

ACTUAL RESULTS

@digitalfiend64 That playbook shared in this issue doesn't seem to be correct for the stated use case. Firstly, gather_facts is set to no at the play level (it wouldn't have worked anyway because the default subset if min now, which doesn't gather interface facts). Secondly, after the Set IP on interface task executes, there's no fact gathering done. So, the var being debugged in the second task will not exist. The following should work for this situation:

---
- name: Test ansible_net_all_ipv6_addresses var
  hosts: nxos
  gather_facts: false
  tasks:
    - name: Set IP on interface
      cisco.nxos.nxos_l3_interfaces:
        config:
          - name: Ethernet1/2
            ipv6:
              - address: fd5d:12c9:2201:2::1/64
        state: merged
    
    - name: Gather facts
      cisco.nxos.nxos_facts:
        gather_subset: interfaces

    - name: DEBUG v6
      debug:
        var: ansible_net_all_ipv6_addresses

Please let me know if this resolves the issue. Thanks!