junipernetworks.junos.junos_lldp_interfaces (8.0.0) — module

LLDP interfaces resource module

| "added in version" 1.0.0 of junipernetworks.junos"

Authors: Ganesh Nalawade (@ganeshrn)

Install collection

Install with ansible-galaxy collection install junipernetworks.junos:==8.0.0


Add to requirements.yml

  collections:
    - name: junipernetworks.junos
      version: 8.0.0

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  junipernetworks.junos.junos_lldp_interfaces:
    config:
      - name: ge-0/0/1
      - name: ge-0/0/2
        enabled: false
    state: merged
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  junipernetworks.junos.junos_lldp_interfaces:
    config:
      - name: ge-0/0/2
        disable: false
      - name: ge-0/0/3
        enabled: false
    state: replaced
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  junipernetworks.junos.junos_lldp_interfaces:
    config:
      - name: ge-0/0/2
        enabled: false
    state: overridden
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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)
  junipernetworks.junos.junos_lldp_interfaces:
    config:
      - name: ge-0/0/1
      - name: ge-0/0/3
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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;
# Using gathered
# Before state:
# ------------
#
# ansible@cm123456tr21# show protocols lldp
# interface ge-0/0/1;
# interface ge-0/0/2 {
#     disable;
# }
- name: Gather junos lldp interfaces as in given arguments
  junipernetworks.junos.junos_lldp_interfaces:
    state: gathered
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task Output (redacted)
# -----------------------
#
# "gathered": [
#         {
#             "name": "ge-0/0/1"
#         },
#         {
#             "enabled": false,
#             "name": "ge-0/0/2"
#         }
#     ]
# After state:
# ------------
#
# ansible@cm123456tr21# show protocols lldp
# interface ge-0/0/1;
# interface ge-0/0/2 {
#     disable;
# }
# Using rendered
- name: Render platform specific xml from task input using rendered state
  junipernetworks.junos.junos_lldp_interfaces:
    config:
      - name: ge-0/0/1
      - name: ge-0/0/2
        enabled: false
    state: rendered

Inputs

    
state:
    choices:
    - merged
    - replaced
    - overridden
    - deleted
    - gathered
    - rendered
    - parsed
    default: merged
    description:
    - The state of the configuration after module completion.
    type: str

config:
    description: The list of link layer discovery protocol interface attribute configurations
    elements: dict
    suboptions:
      enabled:
        description:
        - This is a boolean value to control disabling of LLDP on the interface C(name)
        type: bool
      name:
        description:
        - Name of the interface LLDP needs to be configured on.
        required: true
        type: str
    type: list

running_config:
    description:
    - This option is used only with state I(parsed).
    - The value of this option should be the output received from the Junos device by
      executing the command B(show protocols lldp).
    - The state I(parsed) reads the configuration from C(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 I(parsed) key within the result
    type: str

Outputs

after:
  description: The configuration as structured data after module completion.
  returned: when changed
  sample: "The configuration returned will always be in the same format\n of the parameters\
    \ above.\n"
  type: list
before:
  description: The configuration as structured data prior to module invocation.
  returned: always
  sample: "The configuration returned will always be in the same format\n of the parameters\
    \ above.\n"
  type: list
commands:
  description: The set of commands pushed to the remote device.
  returned: always
  sample:
  - <nc:protocols xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <nc:lldp> <nc:interface>
    <nc:name>ge-0/0/1</nc:name> <nc:disable delete="delete"/> </nc:interface> <nc:interface>
    <nc:name>ge-0/0/2</nc:name> <nc:disable/> </nc:interface> </nc:lldp> </nc:protocols>
  - xml 2
  - xml 3
  type: list