junos_lldp_interfaces – Manage link layer discovery protocol (LLDP) attributes of interfaces on Juniper JUNOS devices — Ansible Documentation

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

Documentation

# junos_lldp_interfaces – Manage link layer discovery protocol (LLDP) attributes of interfaces on Juniper JUNOS devices

New in version 2.9.

- Synopsis
- Parameters
- Examples
- Return Values
- Status

## Synopsis

- This module manages link layer discovery protocol (LLDP) attributes of interfaces on Juniper JUNOS devices.

## Parameters

Parameter | Choices/Defaults | Comments
--- | --- | ---
config list / elements=dictionary |  | The list of link layer discovery protocol interface attribute configurations
| enabled boolean | Choices: no yes | This is a boolean value to control disabling of LLDP on the interface `name`
| name string / required |  | Name of the interface LLDP needs to be configured on.
state string | Choices: merged ← replaced overridden deleted | The state of the configuration after module completion.

## Examples

    # Using merged
    # Before state:
    # -------------
    # user@junos01# # show protocols lldp
    # management-address 10.1.1.1;
    # advertisement-interval 10000;

    - name: Merge provided configuration with device configuration
      junos_lldp_interfaces:
        config:
          - name: ge-0/0/1
          - name: ge-0/0/2
            enabled: False
        state: merged

    # After state:
    # -------------
    # user@junos01# show protocols lldp
    # management-address 10.1.1.1;
    # advertisement-interval 10000;
    # interface ge-0/0/1;
    # interface ge-0/0/2 {
    #     disable;
    # }

    # Using replaced
    # Before state:
    # -------------
    # user@junos01# show protocols lldp
    # management-address 10.1.1.1;
    # advertisement-interval 10000;
    # interface ge-0/0/1;
    # interface ge-0/0/2 {
    #     disable;
    # }

    - name: Replace provided configuration with device configuration
      junos_lldp_interfaces:
        config:
          - name: ge-0/0/2
            disable: False
          - name: ge-0/0/3
            enabled: False
        state: replaced

    # After state:
    # -------------
    # user@junos01# show protocols lldp
    # management-address 10.1.1.1;
    # advertisement-interval 10000;
    # interface ge-0/0/1;
    # interface ge-0/0/2;
    # interface ge-0/0/3 {
    #     disable;
    # }

    # Using overridden
    # Before state:
    # -------------
    # user@junos01# show protocols lldp
    # management-address 10.1.1.1;
    # advertisement-interval 10000;
    # interface ge-0/0/1;
    # interface ge-0/0/2 {
    #     disable;
    # }

    - name: Override provided configuration with device configuration
      junos_lldp_interfaces:
        config:
          - name: ge-0/0/2
            enabled: False
        state: overridden

    # After state:
    # -------------
    # user@junos01# show protocols lldp
    # management-address 10.1.1.1;
    # advertisement-interval 10000;
    # interface ge-0/0/2 {
    #     disable;
    # }

    # Using deleted
    # Before state:
    # -------------
    # user@junos01# show protocols lldp
    # management-address 10.1.1.1;
    # advertisement-interval 10000;
    # interface ge-0/0/1;
    # interface ge-0/0/2;
    # interface ge-0/0/3 {
    #     disable;
    # }
    - name: Delete lldp interface configuration (this will not delete other lldp configuration)
      junos_lldp_interfaces:
        config:
        - name: ge-0/0/1
        - name: ge-0/0/3
        state: deleted

    # After state:
    # -------------
    # user@junos01# show protocols lldp
    # management-address 10.1.1.1;
    # advertisement-interval 10000;
    # interface ge-0/0/2;
    # interface ge-0/0/1;

## Return Values

Common return values are documented here, the following are the fields unique to this module:

Key | Returned | Description
--- | --- | ---
after list | 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 list | 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: ['xml 1', 'xml 2', 'xml 3']

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

- Ganesh Nalawade (@ganeshrn)

Hint

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