# Discussion regarding lag and l2\_interface resource modules

**URL:** <https://forum.ansible.com/t/discussion-regarding-lag-and-l2-interface-resource-modules/45257>\
**Category:** Project Discussions\
**Tags:** cisco\
**Created:** [February 4, 2026, 1:13pm UTC](https://forum.ansible.com/t/discussion-regarding-lag-and-l2-interface-resource-modules/45257 "2026-02-04T13:13:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorgenspange](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jorgenspange/32/9667_2.png) [@jorgenspange](https://forum.ansible.com/u/jorgenspange)\
**Post date:** [February 4, 2026, 1:13pm UTC](https://forum.ansible.com/t/discussion-regarding-lag-and-l2-interface-resource-modules/45257/1 "2026-02-04T13:13:09Z")

</div>

Good day!

I would like to start a discussion regarding the lag and l2\_interface resource modules across ios/iosxr/nxos.

This is based upon a problem I stumbled upon a with nxos, where vlan configuration on a port is not possible when it’s part of a port-channel:

```auto
n93180yc-fx(config-if)#k execution. To see the full traceback, use -vvv. The error was:
fatal: [n93180yc-fx]: FAILED! =>
  msg: |-
    Unexpected failure during module execution: switchport trunk allowed vlan add 1337
                                                ^
    % Invalid command at '^' marker.
    n93180yc-fx(config-if)#
  stdout: ''

```

As you can see on the actual device, the command is removed once an interface is part of a port-channel:

```auto
interface Ethernet1/50
  switchport trunk allowed vlan 100-102
  channel-group 20 mode active
  no shutdown

```

```auto
n93180yc-fx(config-if)# int eth1/50
n93180yc-fx(config-if)# switchport ?
  host Set port host

```

Working around this issue is complicated as the facts for port-channel membership is gathered with the cisco.nxos.nxos\_lag\_interfaces resource module and not the cisco.nxos.nxos\_l2\_interfaces resource module, where the vlans are actually configured.

I’ve discussed this with [@sagarpaul](https://forum.ansible.com/u/kb-perbyte/summary), and we both agreed that lag\_interfaces should be configurable through the l2\_interfaces resource module and that the lag\_interfaces one can be deprecated.

What is the communitys standpoint around a change like this to the cisco.\* collections.  
Have people had these kind of problems, and how were they solved?

Best regards.

---

<div class="post-metadata">

**Author:** ![KB-perByte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kb-perbyte/32/541_2.png) [@KB-perByte](https://forum.ansible.com/u/KB-perByte)\
**Post date:** [February 4, 2026, 1:23pm UTC](https://forum.ansible.com/t/discussion-regarding-lag-and-l2-interface-resource-modules/45257/2 "2026-02-04T13:23:58Z")

</div>

Thanks for bringing it to notice, considering lag\_interface operations are tied mostly to l2\_interface related attributes.

And for module-specific operations, fact crunching or dealing with VLANs that are added within a Port Channel and then added into an interface, can be tricky to deal with.  
The point is that whatever you configure on the port channel interface is typically inherited by all member physical interfaces, and the member interfaces themselves usually can’t have conflicting configurations.  
Let me check on how possible it to have things under one module or if we can add facts or operations to get both information in one place.  
wrt to [nxos\_lag\_interfaces](https://docs.ansible.com/projects/ansible/latest/collections/cisco/nxos/nxos_lag_interfaces_module.html) and [nxos\_l2\_interfaces](https://docs.ansible.com/projects/ansible/latest/collections/cisco/nxos/nxos_l2_interfaces_module.html#ansible-collections-cisco-nxos-nxos-l2-interfaces-module)

thinking…
