junipernetworks.junos.junos_lldp_global (8.0.0) — module

LLDP 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 on Juniper JUNOS devices.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Using merged
# Before state:
# -------------
# user@junos01# # show protocols lldp
#
- name: Merge provided configuration with device configuration
  junipernetworks.junos.junos_lldp_global:
    config:
      interval: 10000
      address: 10.1.1.1
      transmit_delay: 400
      hold_multiplier: 10
    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;
# transmit-delay 400;
# hold-multiplier 10;

# Using replaced
# Before state:
# -------------
# user@junos01# show protocols lldp
# management-address 10.1.1.1;
# advertisement-interval 10000;
# transmit-delay 400;
# hold-multiplier 10;

- name: Replace provided configuration with device configuration
  junipernetworks.junos.junos_lldp_global:
    config:
      address: 20.2.2.2
      hold_multiplier: 30
      enabled: false
    state: replaced
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# -------------
# user@junos01# show protocols lldp
# disable;
# management-address 20.2.2.2;
# hold-multiplier 30;

# Using deleted
# Before state:
# -------------
# user@junos01# show protocols lldp
# management-address 20.2.2.2;
# hold-multiplier 30;

- name: Delete lldp configuration (this will by default remove all lldp configuration)
  junipernetworks.junos.junos_lldp_global:
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# -------------
# user@junos01# # show protocols lldp
#
#
# Using gathered
# Before state:
# ------------
#
# ansible@cm123456tr21# show protocols lldp
# management-address 10.1.1.1;
# advertisement-interval 10000;
# transmit-delay 400;
# hold-multiplier 10;
# interface ge-0/0/1;
# interface ge-0/0/2 {
#     disable;
# }
- name: Gather junos lldp_global as in given arguments
  junipernetworks.junos.junos_lldp_global:
    state: gathered
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task Output (redacted)
# -----------------------
#
# "gathered": {
#         "address": "10.1.1.1",
#         "hold_multiplier": 10,
#         "interval": 10000,
#         "transmit_delay": 400
#     }
# After state:
# ------------
#
# ansible@cm123456tr21# show protocols lldp
# management-address 10.1.1.1;
# advertisement-interval 10000;
# transmit-delay 400;
# hold-multiplier 10;
# 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_global:
    config:
      interval: 10000
      address: 10.1.1.1
      transmit_delay: 400
      hold_multiplier: 10
    state: rendered

Inputs

    
state:
    choices:
    - merged
    - replaced
    - 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 attribute configurations
    suboptions:
      address:
        description:
        - This argument sets the management address from LLDP.
        type: str
      enabled:
        description:
        - This argument is a boolean value to enabled or disable LLDP.
        type: bool
      hold_multiplier:
        description:
        - Specify the number of seconds that LLDP information is held before it is discarded.
          The multiplier value is used in combination with the C(interval) value.
        type: int
      interval:
        description:
        - Frequency at which LLDP advertisements are sent (in seconds).
        type: int
      transmit_delay:
        description:
        - Specify the number of seconds the device waits before sending advertisements
          to neighbors after a change is made in local system.
        type: int
    type: dict

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: dict
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: dict
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:management-address>10.1.1.1</nc:management-address>
    <nc:advertisement-interval>10000</nc:advertisement-interval> <nc:transmit-delay>400</nc:transmit-delay>
    <nc:hold-multiplier>10</nc:hold-multiplier> <nc:disable delete="delete"/> </nc:lldp>
    </nc:protocols>
  - xml 2
  - xml 3
  type: list