W3cubDocs

/Ansible

arista.eos.eos_lldp_global – LLDP resource module

Note

This plugin is part of the arista.eos collection (version 2.2.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install arista.eos.

To use it in a playbook, specify: arista.eos.eos_lldp_global.

New in version 1.0.0: of arista.eos

Synopsis

  • This module manages Global Link Layer Discovery Protocol (LLDP) settings on Arista EOS devices.

Note

This module has a corresponding action plugin.

Parameters

Parameter Choices/Defaults Comments
config
dictionary
The provided global LLDP configuration.
holdtime
integer
Specifies the holdtime (in sec) to be sent in packets.
reinit
integer
Specifies the delay (in sec) for LLDP initialization on any interface.
timer
integer
Specifies the rate at which LLDP packets are sent (in sec).
tlv_select
dictionary
Specifies the LLDP TLVs to enable or disable.
link_aggregation
boolean
    Choices:
  • no
  • yes
Enable or disable link aggregation TLV.
management_address
boolean
    Choices:
  • no
  • yes
Enable or disable management address TLV.
max_frame_size
boolean
    Choices:
  • no
  • yes
Enable or disable maximum frame size TLV.
port_description
boolean
    Choices:
  • no
  • yes
Enable or disable port description TLV.
system_capabilities
boolean
    Choices:
  • no
  • yes
Enable or disable system capabilities TLV.
system_description
boolean
    Choices:
  • no
  • yes
Enable or disable system description TLV.
system_name
boolean
    Choices:
  • no
  • yes
Enable or disable 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 EOS device by executing the command show running-config | section 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
    Choices:
  • merged
  • replaced
  • deleted
  • rendered
  • gathered
  • parsed
The state of the configuration after module completion.

Notes

Note

  • Tested against Arista EOS 4.20.10M
  • This module works with connection network_cli. See the EOS Platform Options.

Examples

# Using merged
#
# ------------
# Before State
# ------------
#
# veos# show run | section lldp
# lldp timer 3000
# lldp holdtime 100
# lldp reinit 5
# no lldp tlv-select management-address
# no lldp tlv-select system-description

- name: Merge provided LLDP configuration with the existing configuration
  arista.eos.eos_lldp_global:
    config:
      holdtime: 100
      tlv_select:
        management_address: false
        port_description: false
        system_description: true
    state: merged

# -----------
# After state
# -----------
#
# veos# show run | section lldp
# lldp timer 3000
# lldp holdtime 100
# lldp reinit 5
# no lldp tlv-select management-address
# no lldp tlv-select port-description


# Using replaced
#
# ------------
# Before State
# ------------
#
# veos# show run | section lldp
# lldp timer 3000
# lldp holdtime 100
# lldp reinit 5
# no lldp tlv-select management-address
# no lldp tlv-select system-description

- name: Replace existing LLDP device configuration with provided configuration
  arista.eos.eos_lldp_global:
    config:
      holdtime: 100
      tlv_select:
        management_address: false
        port_description: false
        system_description: true
    state: replaced

# -----------
# After state
# -----------
#
# veos# show run | section lldp
# lldp holdtime 100
# no lldp tlv-select management-address
# no lldp tlv-select port-description


# Using deleted
#
# ------------
# Before State
# ------------
#
# veos# show run | section lldp
# lldp timer 3000
# lldp holdtime 100
# lldp reinit 5
# no lldp tlv-select management-address
# no lldp tlv-select system-description

- name: Delete existing LLDP configurations from the device
  arista.eos.eos_lldp_global:
    state: deleted

# -----------
# After state
# -----------
#
# veos# show run | section ^lldp

# Using rendered:

- name: Use Rendered to convert the structured data to native config
  arista.eos.eos_lldp_global:
    config:
      holdtime: 100
      tlv_select:
        management_address: false
        port_description: false
        system_description: true
    state: rendered

# -----------
# Output
# -----------
#
# rendered:
#   - "lldp holdtime 100"
#   - "no lldp tlv-select management-address"
#   - "no lldp tlv-select port-description"

# Using parsed

# parsed.cfg

# lldp timer 3000
# lldp holdtime 100
# lldp reinit 5
# no lldp tlv-select management-address
# no lldp tlv-select system-description

- name: Use parsed to convert native configs to structured data
  arista.eos.lldp_global:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# -----------
# Output
# -----------

#    parsed:
#      holdtime: 100
#      timer 3000
#      reinit 5
#      tlv_select:
#        management_address: False
#        port_description: False
#        system_description: True

# Using gathered:
# native config:
# lldp timer 3000
# lldp holdtime 100
# lldp reinit 5
# no lldp tlv-select management-address
# no lldp tlv-select system-description


- name: Gather lldp_global facts from the device
  arista.eos.lldp_global:
    state: gathered

# -----------
# Output
# -----------

#    gathered:
#      holdtime: 100
#      timer 3000
#      reinit 5
#      tlv_select:
#        management_address: False
#        port_description: False
#        system_description: True

Return Values

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 100', 'no lldp timer', 'lldp tlv-select system-description']


Authors

  • Nathaniel Case (@Qalthos)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/arista/eos/eos_lldp_global_module.html