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

junipernetworks.junos.junos_l2_interfaces state: replaced doesn't work #452

Open
kollross opened this issue Oct 16, 2023 · 0 comments
Open
Assignees

Comments

@kollross
Copy link

kollross commented Oct 16, 2023

SUMMARY

When using the junos_l2_interface module to update vlan on interface, the "new" vlan is simply added to the vlan member list of an access port resulting in a failed commit.

Expected behavior:
Replace existing vlan configured on the port with new vlan being configured.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

junipernetworks.junos.junos_l2_interfaces

ANSIBLE VERSION
2.14.5

COLLECTION VERSION
junipernetworks.junos         5.3.0

CONFIGURATION
CONFIG_FILE() = /etc/ansible/ansible.cfg
DEFAULT_ACTION_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/home/ansible/.local/lib/python3.10/site-packages/napalm_ansible/plugins/action']
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 10
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/etc/ansible/netbox_inventory.yml']
DEFAULT_MODULE_PATH(/etc/ansible/ansible.cfg) = ['/home/ansible/.local/lib/python3.10/site-packages/napalm_ansible/modules']
DEFAULT_PRIVATE_KEY_FILE(/etc/ansible/ansible.cfg) = /home/ansible/.ssh/id_ed25519
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = /usr/bin/python3
INVENTORY_CACHE_ENABLED(/etc/ansible/ansible.cfg) = True
INVENTORY_CACHE_PLUGIN(/etc/ansible/ansible.cfg) = jsonfile
INVENTORY_CACHE_PLUGIN_CONNECTION(/etc/ansible/ansible.cfg) = /var/tmp/ansible-inventory-cache
INVENTORY_CACHE_TIMEOUT(/etc/ansible/ansible.cfg) = 999
INVENTORY_ENABLED(/etc/ansible/ansible.cfg) = ['host_list', 'script', 'auto', 'yaml', 'ini', 'toml']
PERSISTENT_COMMAND_TIMEOUT(/etc/ansible/ansible.cfg) = 120
PERSISTENT_CONNECT_TIMEOUT(/etc/ansible/ansible.cfg) = 60

OS / ENVIRONMENT

12.3R12-S21

STEPS TO REPRODUCE
    - name: Merge provided Junos vlans config with running-config
      junipernetworks.junos.junos_l2_interfaces:
        config:
        - name: "{{ variable_interface }}"
          access:
            vlan: "{{ variable_vlan }}"
        state: replaced
      connection: netconf
      when: ansible_network_os=='junos'


EXPECTED RESULTS

Before change:

 show interfaces xe-0/0/29
description FREE;
enable;
unit 0 {
    family ethernet-switching {
        interface-mode access;
        vlan {
            members 2402;
        }
    }
}

After change:

 show interfaces xe-0/0/29
description FREE;
enable;
unit 0 {
    family ethernet-switching {
        interface-mode access;
        vlan {
            members 2403;
        }
    }
}
ACTUAL RESULTS

show configuration interfaces ge-1/0/29
description HBP04-13;
enable;
unit 0 {
family ethernet-switching {
interface-mode access;
vlan {
members [ 2402 2403 ];
}
}
}

fatal: [switch1]: FAILED! => {"changed": false, "module_stderr": "b'error: Access interface <ge-1/0/29.0> has more than one vlan member: <v2011> and <v2010>\\nerror: configuration check-out failed'", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"}

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