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

nxos_l2_interfaces with state: merged replaces vlans when all vlans are allowed on trunk #920

Open
j-lahitte opened this issue Jan 3, 2025 · 0 comments
Assignees

Comments

@j-lahitte
Copy link

SUMMARY

When using cisco.nxos.nxos_l2_interfaces with state: merged on a trunk with all vlans (switchport trunk allowed vlan all), the module replaces allowed vlans with the ones used with the module

ISSUE TYPE
  • Bug Report
COMPONENT NAME

nxos_l2_interfaces

ANSIBLE VERSION
$ ansible --version
ansible [core 2.15.12]
  config file = /home/jb/project/ansible.cfg
  configured module search path = ['/home/jb/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/jb/venv_project/lib/python3.9/site-packages/ansible
  ansible collection location = /home/jb/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/jb/venv_project/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] (/home/jb/venv_project/bin/python3)
  jinja version = 3.1.4
  libyaml = True
COLLECTION VERSION

Note: Tried with both 4.4.0 and manually installed 9.2.1, same result.

$ ansible-galaxy collection list cisco.nxos

# /home/jb/.ansible/collections/ansible_collections
Collection Version
---------- -------
cisco.nxos 9.2.1

# /home/jb/venv_project/lib/python3.9/site-packages/ansible_collections
Collection Version
---------- -------
cisco.nxos 4.4.0
CONFIGURATION
$ ansible-config dump --only-changed
CALLBACKS_ENABLED(/home/jb/project/ansible.cfg) = ['timer', 'profile_roles', 'profile_tasks']
CONFIG_FILE() = /home/jb/project/ansible.cfg
DEFAULT_FORKS(/home/jb/project/ansible.cfg) = 10
DEFAULT_GATHERING(/home/jb/project/ansible.cfg) = smart
DEFAULT_TIMEOUT(/home/jb/project/ansible.cfg) = 120
DEFAULT_TRANSPORT(/home/jb/project/ansible.cfg) = paramiko
DEFAULT_UNDEFINED_VAR_BEHAVIOR(/home/jb/project/ansible.cfg) = True
HOST_KEY_CHECKING(/home/jb/project/ansible.cfg) = False
INTERPRETER_PYTHON(/home/jb/project/ansible.cfg) = /usr/bin/env python
RETRY_FILES_ENABLED(/home/jb/project/ansible.cfg) = False
OS / ENVIRONMENT

Nexus9000 C93180YC-FX
NXOS 9.3(10)

STEPS TO REPRODUCE
nexus# configure
nexus(config)# interface port-channel111
nexus(config)# switchport
nexus(config)# switchport mode trunk
nexus(config)# switchport trunk allowed vlan all
- cisco.nxos.nxos_l2_interfaces:
    config:
      - name: "Port-channel111"
        trunk:
          allowed_vlans: "1234"
    state: "merged"
EXPECTED RESULTS

Running the module with these parameters should not do anything, as merging vlan 1234 with "all" (= 1-4094) results to all vlans (= 1-4094)

ACTUAL RESULTS

Module runs fine but allowed vlans get replaced (instead of merged) with 1234 :

nexus# show run int po111

interface port-channel111
  switchport
  switchport mode trunk
  switchport trunk allowed vlan 1234
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

2 participants