ios_lldp_global – Configure and manage Link Layer Discovery Protocol(LLDP) attributes on IOS platforms — Ansible Documentation

- AnsibleFest
- Products
- Community
- Webinars & Training
- Blog

Documentation

# ios_lldp_global – Configure and manage Link Layer Discovery Protocol(LLDP) attributes on IOS platforms

New in version 2.9.

- Synopsis
- Parameters
- Notes
- Examples
- Return Values
- Status

## Synopsis

- This module configures and manages the Link Layer Discovery Protocol(LLDP) attributes on IOS platforms.

## Parameters

Parameter | Choices/Defaults | Comments
--- | --- | ---
config dictionary |  | A dictionary of LLDP options
| enabled boolean | Choices: no yes | Enable LLDP
| holdtime integer |  | LLDP holdtime (in sec) to be sent in packets. Refer to vendor documentation for valid values.
| reinit integer |  | Specify the delay (in secs) for LLDP to initialize. Refer to vendor documentation for valid values. NOTE, if LLDP reinit is configured with a starting value, idempotency won't be maintained as the Cisco device doesn't record the starting reinit configured value. As such, Ansible cannot verify if the respective starting reinit value is already configured or not from the device side. If you try to apply starting reinit value in every play run, Ansible will show changed as True. For any other reinit value, idempotency will be maintained since any other reinit value is recorded in the Cisco device.
| timer integer |  | Specify the rate at which LLDP packets are sent (in sec). Refer to vendor documentation for valid values.
| tlv_select dictionary |  | Selection of LLDP TLVs i.e. type-length-value to send NOTE, if tlv-select is configured idempotency won't be maintained as Cisco device doesn't record configured tlv-select options. As such, Ansible cannot verify if the respective tlv-select options is already configured or not from the device side. If you try to apply tlv-select option in every play run, Ansible will show changed as True.
|  | four_wire_power_management boolean | Choices: no yes | Cisco 4-wire Power via MDI TLV
|  | mac_phy_cfg boolean | Choices: no yes | IEEE 802.3 MAC/Phy Configuration/status TLV
|  | management_address boolean | Choices: no yes | Management Address TLV
|  | port_description boolean | Choices: no yes | Port Description TLV
|  | port_vlan boolean | Choices: no yes | Port VLAN ID TLV
|  | power_management boolean | Choices: no yes | IEEE 802.3 DTE Power via MDI TLV
|  | system_capabilities boolean | Choices: no yes | System Capabilities TLV
|  | system_description boolean | Choices: no yes | System Description TLV
|  | system_name boolean | Choices: no yes | System Name TLV
state string | Choices: merged ← replaced deleted | The state of the configuration after module completion

## 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 running-config | section ^lldp
    # vios1#

    - name: Merge provided configuration with device configuration
      ios_lldp_global:
        config:
          holdtime: 10
          enabled: True
          reinit: 3
          timer: 10
        state: merged

    # After state:
    # ------------
    # vios#sh running-config | section ^lldp
    #  lldp timer 10
    #  lldp holdtime 10
    #  lldp reinit 3
    #  lldp run

    # Using replaced

    # Before state:
    # -------------
    # vios#sh running-config | section ^lldp
    #  lldp timer 10
    #  lldp holdtime 10
    #  lldp reinit 3
    #  lldp run

    - name: Replaces LLDP device configuration with provided configuration
      ios_lldp_global:
        config:
          holdtime: 20
          reinit: 5
        state: replaced

    # After state:
    # -------------
    # vios#sh running-config | section ^lldp
    #  lldp holdtime 20
    #  lldp reinit 5

    # Using Deleted without any config passed
    #"(NOTE: This will delete all of configured LLDP module attributes)"

    # Before state:
    # -------------
    # vios#sh running-config | section ^lldp
    #  lldp timer 10
    #  lldp holdtime 10
    #  lldp reinit 3
    #  lldp run

    - name: "Delete LLDP attributes (Note: This won't delete the interface itself)"
      ios_lldp_global:
        state: deleted

    # After state:
    # -------------
    # vios#sh running-config | section ^lldp
    # vios1#

## 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 | always | The set of commands pushed to the remote device Sample: ['lldp holdtime 10', 'lldp run', 'lldp timer 10']

## 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.