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_global.
New in version 1.0.0: of cisco.nxos
Note
This module has a corresponding action plugin.
| Parameter | Choices/Defaults | Comments | |||
|---|---|---|---|---|---|
| config dictionary | A list of link layer discovery configurations | ||||
| holdtime integer | Amount of time the receiving device should hold the information (in seconds) | ||||
| port_id integer |
| This attribute defines if the interface names should be advertised in the long(0) or short(1) form. | |||
| reinit integer | Amount of time to delay the initialization of LLDP on any interface (in seconds) | ||||
| timer integer | Frequency at which LLDP updates need to be transmitted (in seconds) | ||||
| tlv_select dictionary | This attribute can be used to specify the TLVs that need to be sent and received in the LLDP packets. By default, all TLVs are advertised | ||||
| dcbxp boolean |
| Used to specify the Data Center Bridging Exchange Protocol TLV | |||
| management_address dictionary | Used to specify the management address in TLV messages | ||||
| v4 boolean |
| Management address with TLV v4 | |||
| v6 boolean |
| Management address with TLV v6 | |||
| port dictionary | Used to manage port based attributes in TLV messages | ||||
| description boolean |
| Used to specify the port description TLV | |||
| vlan boolean |
| Used to specify the port VLAN ID TLV | |||
| power_management boolean |
| Used to specify IEEE 802.3 DTE Power via MDI TLV | |||
| system dictionary | Used to manage system based attributes in TLV messages | ||||
| capabilities boolean |
| Used to specify the system capabilities TLV | |||
| description boolean |
| Used to specify the system description TLV | |||
| name boolean |
| Used to specify the system name TLV | |||
| 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 | include lldp. 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 of the configuration after module completion | |||
Note
# Using merged
# Before state:
# -------------
#
# user(config)# show running-config | include lldp
# feature lldp
- name: Merge provided configuration with device configuration
cisco.nxos.nxos_lldp_global:
config:
timer: 35
holdtime: 100
state: merged
# After state:
# ------------
#
# user(config)# show running-config | include lldp
# feature lldp
# lldp timer 35
# lldp holdtime 100
# Using replaced
# Before state:
# -------------
#
# user(config)# show running-config | include lldp
# feature lldp
# lldp holdtime 100
# lldp reinit 5
# lldp timer 35
- name: Replace device configuration of specific LLDP attributes with provided configuration
cisco.nxos.nxos_lldp_global:
config:
timer: 40
tlv_select:
system:
description: true
name: false
management_address:
v4: true
state: replaced
# After state:
# ------------
#
# user(config)# show running-config | include lldp
# feature lldp
# lldp timer 40
# no lldp tlv-select system-name
# Using deleted
# Before state:
# -------------
#
# user(config)# show running-config | include lldp
# feature lldp
# lldp holdtime 5
# lldp reinit 3
- name: Delete LLDP configuration (this will by default remove all lldp configuration)
cisco.nxos.nxos_lldp_global:
state: deleted
# After state:
# ------------
#
# user(config)# show running-config | include lldp
# feature lldp
# Using rendered
- name: Use rendered state to convert task input to device specific commands
cisco.nxos.nxos_lldp_global:
config:
holdtime: 130
port_id: 1
reinit: 5
tlv_select:
dcbxp: yes
power_management: yes
state: rendered
# Task Output (redacted)
# -----------------------
# rendered:
# - "lldp tlv-select dcbxp"
# - "lldp tlv-select power-management"
# - "lldp portid-subtype 1"
# - "lldp reinit 5"
# - "lldp holdtime 130"
# Using parsed
# parsed.cfg
# ------------
# lldp holdtime 131
# lldp reinit 7
# no lldp tlv-select system-name
# no lldp tlv-select system-description
# Task output (redacted)
# -----------------------
# parsed:
# holdtime: 131
# reinit: 7
# tlv_select:
# system:
# description: false
# name: false
# Using gathered
# Existing device config state
# -------------------------------
# feature lldp
# lldp holdtime 129
# lldp reinit 5
# lldp timer 35
# no lldp tlv-select system-name
# Task output (redacted)
# -----------------------
# gathered:
# reinit: 5
# timer: 35
# tlv_select:
# system:
# name: False
# holdtime: 129
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
| after dictionary | when changed | The configuration as structured data after module completion. Sample: The configuration returned will always be in the same format of the parameters above. |
| before dictionary | always | The configuration as structured data prior to module 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: ['lldp holdtime 125', 'lldp reinit 4', 'no lldp tlv-select system-name'] |
© 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_global_module.html