Closed wollmannbruno closed 1 year ago
@wollmannbruno, would you share the output of your sh running-config | section ^interface
command from the appliance where there are no facts generated?
As I don't see the issue at my end, the device when some lag-specific configuration is present,
lags:
- members:
- member: GigabitEthernet2
mode: active
name: Port-channel10
- members:
- member: GigabitEthernet4
mode: active
name: Port-channel20
- members:
- {}
name: Port-channel30
and when no lag-specific configuration is present
lags:
- members:
- {}
name: Port-channel10
- members:
- {}
name: Port-channel20
- members:
- {}
name: Port-channel30
Regards
@KB-perByte , Your example of "no lag-specific configuration" shows that there is in fact lag configured on that switch. The presence of Port-channelxx
gives that away. These lags may not have member interfaces configured anymore, but the lag interfaces exist.
Here is the output for sh run | ^interface
. It contains no Port-channel
interfaces.
swt-rga-01-dside#sh run | sec ^interface
interface GigabitEthernet0/0
vrf forwarding Mgmt-vrf
no ip address
negotiation auto
interface GigabitEthernet1/0/1
switchport access vlan 400
switchport mode access
switchport nonegotiate
switchport voice vlan 735
no snmp trap link-status
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/2
switchport access vlan 400
switchport mode access
switchport nonegotiate
switchport voice vlan 735
no snmp trap link-status
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/3
description SPS Programming
switchport access vlan 236
switchport mode access
switchport nonegotiate
switchport voice vlan 735
no snmp trap link-status
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/4
switchport access vlan 400
switchport mode access
switchport nonegotiate
switchport voice vlan 735
no snmp trap link-status
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/5
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/6
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/7
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/8
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/9
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/10
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/11
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/12
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/13
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/14
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/15
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/16
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/17
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/18
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/19
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/20
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/21
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/22
switchport access vlan 711
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/23
switchport access vlan 713
switchport mode access
switchport nonegotiate
switchport voice vlan 731
device-tracking attach-policy IPDT_POLICY
authentication periodic
authentication timer reauthenticate server
access-session control-direction in
access-session port-control auto
mab
no snmp trap link-status
dot1x pae authenticator
dot1x timeout tx-period 7
dot1x max-reauth-req 3
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
service-policy type control subscriber PORT_AUTH_PMAP
service-policy input FIVE-MODEL-QOS
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/0/24
description Trunk to SWT-RGA-A100-A
switchport trunk native vlan 99
switchport trunk allowed vlan 1,236,249,400,711,713,731
switchport mode trunk
switchport nonegotiate
service-policy output EGRESS-FIVE-MODEL-QOS
interface GigabitEthernet1/1/1
interface GigabitEthernet1/1/2
interface GigabitEthernet1/1/3
interface GigabitEthernet1/1/4
interface TenGigabitEthernet1/1/1
interface TenGigabitEthernet1/1/2
interface TenGigabitEthernet1/1/3
interface TenGigabitEthernet1/1/4
interface Vlan1
no ip address
shutdown
interface Vlan249
description InBand Management
ip address x.x.x.x y.y.y.y
swt-rga-01-dside#
SUMMARY
When a switch has lag interfaces configured, the facts module returns a list of dictionaries for these interfaces. When a switch has no lag interfaces configured, the facts module returns an empty dictionary.
This inconsistency causes extra processing of the variable in a play.
ISSUE TYPE
COMPONENT NAME
lag_interfaces inside the cisco.ios.ios_facts module.
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Use the ios_facts module to gather the lag_interfaces from switches with and without lag interfaces configured.
EXPECTED RESULTS
I would expect that the same type of data structure be returned whether there are lag interfaces configured or not. Either return a list in both cases or a dictionary in both cases.
ACTUAL RESULTS
ios_facts returns a dictionary when no lag interfaces exist and a list when they do exist.