# iosxr_lldp_global – Manage Global Link Layer Discovery Protocol (LLDP) settings on IOS-XR devices

New in version 2.9.

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

## Synopsis

- This module manages Global Link Layer Discovery Protocol (LLDP) settings on IOS-XR devices.

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

subinterfaces
boolean

Choices:
- no
- yes

Enable or disable LLDP over sub-interfaces.

| timer integer |  | Specifies the rate at which LLDP packets are sent (in sec).
| tlv_select dictionary |  | Specifies the LLDP TLVs to enable or disable.

management_address
boolean

Choices:
- no
- yes

Enable or disable management address 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.

state
string

Choices:
- merged ←
- replaced
- deleted

The state of the configuration after module completion.

## Notes

Note

- Tested against IOS-XR 6.1.3.
- This module works with connection `network_cli`. See the IOS-XR Platform Options.

## Examples

    # Using merged
    #
    #
    # -------------
    # Before State
    # -------------
    #
    #
    # RP/0/0/CPU0:an-iosxr#sh run lldp
    # Tue Aug  6 19:27:54.933 UTC
    # % No such configuration item(s)
    #
    #

    - name: Merge provided LLDP configuration with the existing configuration
      iosxr_lldp_global:
        config:
          holdtime: 100
          reinit: 2
          timer: 3000
          subinterfaces: True
          tlv_select:
            management_address: False
            system_description: False
        state: merged

    #
    #
    # ------------------------
    # Module Execution Result
    # ------------------------
    #
    #  "before": {}
    #
    #  "commands": [
    #        "lldp subinterfaces enable",
    #        "lldp holdtime 100",
    #        "lldp reinit 2",
    #        "lldp tlv-select system-description disable",
    #        "lldp tlv-select management-address disable",
    #        "lldp timer 3000"
    #  ]
    #
    #  "after": {
    #        "holdtime": 100,
    #        "reinit": 2,
    #        "subinterfaces": true,
    #        "timer": 3000,
    #        "tlv_select": {
    #            "management_address": false,
    #            "system_description": false
    #        }
    #  }
    #
    #
    # ------------
    # After state
    # ------------
    #
    #
    # RP/0/0/CPU0:an-iosxr#sh run lldp
    # Tue Aug  6 21:31:10.587 UTC
    # lldp
    #  timer 3000
    #  reinit 2
    #  subinterfaces enable
    #  holdtime 100
    #  tlv-select
    #   management-address disable
    #   system-description disable
    #  !
    # !
    #
    #

    # Using replaced
    #
    #
    # -------------
    # Before State
    # -------------
    #
    # RP/0/0/CPU0:an-iosxr#sh run lldp
    # Tue Aug  6 21:31:10.587 UTC
    # lldp
    #  timer 3000
    #  reinit 2
    #  subinterfaces enable
    #  holdtime 100
    #  tlv-select
    #   management-address disable
    #   system-description disable
    #  !
    # !
    #
    #

    - name: Replace existing LLDP device configuration with provided configuration
      iosxr_lldp_global:
        config:
          holdtime: 100
          tlv_select:
            port_description: False
            system_description: True
            management_description: True
        state: replaced

    #
    #
    # ------------------------
    # Module Execution Result
    # ------------------------
    #
    #  "before": {
    #        "holdtime": 100,
    #        "reinit": 2,
    #        "subinterfaces": true,
    #        "timer": 3000,
    #        "tlv_select": {
    #            "management_address": false,
    #            "system_description": false
    #        }
    #  }
    #
    #  "commands": [
    #        "no lldp reinit 2",
    #        "no lldp subinterfaces enable",
    #        "no lldp timer 3000",
    #        "no lldp tlv-select management-address disable",
    #        "no lldp tlv-select system-description disable",
    #        "lldp tlv-select port-description disable"
    #  ]
    #
    #  "after": {
    #        "holdtime": 100,
    #        "tlv_select": {
    #            "port_description": false
    #        }
    #  }
    #
    #
    # ------------
    # After state
    # ------------
    #
    # RP/0/0/CPU0:an-iosxr#sh run lldp
    # Tue Aug  6 21:53:08.407 UTC
    # lldp
    #  holdtime 100
    #  tlv-select
    #   port-description disable
    #  !
    # !
    #
    #

    # Using deleted
    #
    # ------------
    # Before state
    # ------------
    #
    #
    # RP/0/0/CPU0:an-iosxr#sh run lldp
    # Tue Aug  6 21:31:10.587 UTC
    # lldp
    #  timer 3000
    #  reinit 2
    #  subinterfaces enable
    #  holdtime 100
    #  tlv-select
    #   management-address disable
    #   system-description disable
    #  !
    # !
    #
    #

    - name: Deleted existing LLDP configurations from the device
      iosxr_lldp_global:
        state: deleted

    #
    #
    # ------------------------
    # Module Execution Result
    # ------------------------
    #
    #  "before": {
    #        "holdtime": 100,
    #        "reinit": 2,
    #        "subinterfaces": true,
    #        "timer": 3000,
    #        "tlv_select": {
    #            "management_address": false,
    #            "system_description": false
    #        }
    #  },
    #
    #  "commands": [
    #        "no lldp holdtime 100",
    #        "no lldp reinit 2",
    #        "no lldp subinterfaces enable",
    #        "no lldp timer 3000",
    #        "no lldp tlv-select management-address disable",
    #        "no lldp tlv-select system-description disable"
    #  ]
    #
    #  "after": {}
    #
    #
    # -----------
    # After state
    # -----------
    #
    # RP/0/0/CPU0:an-iosxr#sh run lldp
    # Tue Aug  6 21:38:31.187 UTC
    # lldp
    # !
    #
    #

## 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 subinterfaces enable', 'lldp holdtime 100', 'no lldp tlv-select management-address disable']

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

- Nilashish Chakraborty (@NilashishC)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.