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

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. #771

Closed
digitalfiend64 opened this issue Oct 17, 2023 · 1 comment · Fixed by #854
Assignees
Labels
bug This issue/PR relates to a bug. has_pr This issue has an associated PR.

Comments

@digitalfiend64
Copy link

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
@NilashishC NilashishC self-assigned this Oct 18, 2023
@NilashishC
Copy link
Collaborator

@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!

@NilashishC NilashishC added the needs_info This issue requires further information. Please answer any outstanding questions. label Oct 26, 2023
@NilashishC NilashishC removed the needs_info This issue requires further information. Please answer any outstanding questions. label Feb 12, 2024
@NilashishC NilashishC added bug This issue/PR relates to a bug. has_pr This issue has an associated PR. labels Apr 19, 2024
NilashishC added a commit to rohitthakur2590/cisco.nxos that referenced this issue Apr 19, 2024
rohitthakur2590 added a commit that referenced this issue Apr 22, 2024
* Prepare release 8.0.0

Signed-off-by: rohitthakur2590 <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update changelog for bug fix #771

Signed-off-by: NilashishC <[email protected]>

* Revert redundant updates

Signed-off-by: NilashishC <[email protected]>

* Revert redundant updates

Signed-off-by: NilashishC <[email protected]>

---------

Signed-off-by: rohitthakur2590 <[email protected]>
Signed-off-by: NilashishC <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: NilashishC <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug. has_pr This issue has an associated PR.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants