W3cubDocs

/Ansible 2.9

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

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:
# -------------
# [email protected]# # 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:
# -------------
# [email protected]# 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:
# -------------
# [email protected]# 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:
# -------------
# [email protected]# 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:
# -------------
# [email protected]# 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:
# -------------
# [email protected]# show protocols lldp
# management-address 10.1.1.1;
# advertisement-interval 10000;
# interface ge-0/0/2 {
#     disable;
# }

# Using deleted
# Before state:
# -------------
# [email protected]# 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:
# -------------
# [email protected]# 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

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.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/junos_lldp_interfaces_module.html