Note
This plugin is part of the cisco.nxos collection.
To install it use: ansible-galaxy collection install cisco.nxos.
To use it in a playbook, specify: cisco.nxos.nxos_lldp_interfaces.
New in version 1.0.0: of cisco.nxos
Note
This module has a corresponding action plugin.
| Parameter | Choices/Defaults | Comments | ||
|---|---|---|---|---|
| config list / elements=dictionary | A list of link layer discovery configurations for interfaces. | |||
| name string / required | Name of the interface | |||
| receive boolean |
| Used to enable or disable the reception of LLDP packets on that interface. By default, this is enabled after LLDP is enabled globally. | ||
| tlv_set dictionary | Used to configure TLV parameters on the interface | |||
| management_address string | Used to mention the IPv4 or IPv6 management address for the interface | |||
| vlan integer | Used to mention the VLAN for the interface | |||
| transmit boolean |
| Used to enable or disable the transmission of LLDP packets on that interface. By default, this is enabled after LLDP is enabled globally. | ||
| running_config string | This option is used only with state parsed. The value of this option should be the output received from the NX-OS device by executing the command show running-config | section ^interface. The state parsed reads the configuration from 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 parsed key within the result. | |||
| state string |
| The state the configuration should be left in | ||
Note
# 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: no
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: no
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
# After state:
# ------------
#
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
| after list / elements=string | when changed | The resulting configuration model invocation. Sample: The configuration returned will always be in the same format of the parameters above. |
| before list / elements=string | always | The configuration prior to the model invocation. Sample: The configuration returned will always be in the same format of the parameters above. |
| commands list / elements=string | always | The set of commands pushed to the remote device. Sample: ['interface Ethernet1/2', 'lldp receive', 'lldp tlv-set vlan 12'] |
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/cisco/nxos/nxos_lldp_interfaces_module.html