cisco / cisco.nxos / 7.0.0 / module / nxos_lldp_interfaces LLDP interfaces resource module | "added in version" 1.0.0 of cisco.nxos" Authors: Adharsh Srivats Rangarajan (@adharshsrivatsr)cisco.nxos.nxos_lldp_interfaces (7.0.0) — module
Install with ansible-galaxy collection install cisco.nxos:==7.0.0
collections: - name: cisco.nxos version: 7.0.0
This module manages interfaces' configuration for Link Layer Discovery Protocol (LLDP) on NX-OS platforms.
# Using merged # Before state: # ------------- # - name: Merge provided configuration with device configuration cisco.nxos.nxos_lldp_interfaces: config: - name: Ethernet1/4 receive: false transmit: true tlv_set: management_address: 192.168.122.64 vlan: 12 state: merged
# After state: # ------------- # # interface Ethernet1/4 # no lldp receive # lldp tlv-set management-address 192.168.122.64 # lldp tlv-set vlan 12 # Using replaced # Before state: # ------------ # # interface Ethernet1/4 # no lldp receive # lldp tlv-set management-address 192.168.122.64 # interface Ethernet1/5 # no lldp transmit # lldp tlv-set vlan 10 - name: Replace LLDP configuration on interfaces with given configuration cisco.nxos.nxos_lldp_interfaces: config: - name: Ethernet1/4 transmit: false tlv_set: vlan: 2 state: replaced
# After state: # ----------- # # interface Ethernet1/4 # no lldp transmit # lldp tlv_set vlan 2 # interface Ethernet1/5 # no lldp transmit # lldp tlv-set vlan 10 # Using overridden # Before state: # ------------ # # interface Ethernet1/4 # no lldp receive # lldp tlv-set management-address 192.168.122.64 # interface Ethernet1/5 # no lldp transmit # lldp tlv-set vlan 10 - name: Override LLDP configuration on all interfaces with given configuration cisco.nxos.nxos_lldp_interfaces: config: - name: Ethernet1/7 receive: false tlv_set: vlan: 12 state: overridden
# After state: # ----------- # # interface Ethernet1/7 # no lldp receive # lldp tlv_set vlan 12 # Using deleted # Before state: # ------------ # # interface Ethernet1/4 # lldp tlv-set management vlan 24 # no lldp transmit # interface mgmt0 # no lldp receive - name: Delete LLDP interfaces configuration cisco.nxos.nxos_lldp_interfaces: state: deleted
state: choices: - merged - replaced - overridden - deleted - gathered - rendered - parsed default: merged description: - The state the configuration should be left in type: str config: description: - A list of link layer discovery configurations for interfaces. elements: dict suboptions: name: description: - Name of the interface required: true type: str receive: description: - Used to enable or disable the reception of LLDP packets on that interface. By default, this is enabled after LLDP is enabled globally. type: bool tlv_set: description: - Used to configure TLV parameters on the interface suboptions: management_address: description: - Used to mention the IPv4 or IPv6 management address for the interface type: str vlan: description: - Used to mention the VLAN for the interface type: int type: dict transmit: description: - Used to enable or disable the transmission of LLDP packets on that interface. By default, this is enabled after LLDP is enabled globally. type: bool type: list running_config: description: - This option is used only with state I(parsed). - The value of this option should be the output received from the NX-OS device by executing the command B(show running-config | section ^interface). - The state I(parsed) reads the configuration from C(running_config) option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the I(parsed) key within the result. type: str
after: description: The resulting configuration model invocation. returned: when changed sample: "The configuration returned will always be in the same format\n of the parameters\ \ above.\n" type: list before: description: The configuration prior to the model invocation. returned: always sample: "The configuration returned will always be in the same format\n of the parameters\ \ above.\n" type: list commands: description: The set of commands pushed to the remote device. returned: always sample: - interface Ethernet1/2 - lldp receive - lldp tlv-set vlan 12 type: list