ios_lldp_interfaces – Manage link layer discovery protocol (LLDP) attributes of interfaces on Cisco IOS devices¶
New in version 2.9.
Synopsis¶
- This module manages link layer discovery protocol (LLDP) attributes of interfaces on Cisco IOS devices.
Parameters¶
Notes¶
Note
- Tested against Cisco IOSv Version 15.2 on VIRL
- This module works with connection
network_cli
, See IOS Platform Options.
Examples¶
# Using merged
#
# Before state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
- name: Merge provided configuration with device configuration
ios_lldp_interfaces:
config:
- name: GigabitEthernet0/1
receive: True
transmit: True
- name: GigabitEthernet0/2
receive: True
- name: GigabitEthernet0/3
transmit: True
state: merged
# After state:
# ------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: enabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# Using overridden
#
# Before state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
- name: Override device configuration of all lldp_interfaces with provided configuration
ios_lldp_interfaces:
config:
- name: GigabitEthernet0/2
receive: True
transmit: True
state: overridden
# After state:
# ------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
# Using replaced
#
# Before state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
- name: Replaces device configuration of listed lldp_interfaces with provided configuration
ios_lldp_interfaces:
config:
- name: GigabitEthernet0/2
receive: True
transmit: True
- name: GigabitEthernet0/3
receive: True
state: replaced
# After state:
# ------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: disabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# Using Deleted
#
# Before state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
- name: "Delete LLDP attributes of given interfaces (Note: This won't delete the interface itself)"
ios_lldp_interfaces:
config:
- name: GigabitEthernet0/1
state: deleted
# After state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# Using Deleted without any config passed
# "(NOTE: This will delete all of configured LLDP module attributes)"
#
# Before state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
- name: "Delete LLDP attributes for all configured interfaces (Note: This won't delete the interface itself)"
ios_lldp_interfaces:
state: deleted
# After state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Network Team. [network]
Red Hat Support¶
More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.
Authors¶
- Sumit Jaiswal (@justjais)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.