junipernetworks.junos.junos_lldp_interfaces – LLDP interfaces resource module¶
Note
This plugin is part of the junipernetworks.junos collection (version 1.3.0).
To install it use: ansible-galaxy collection install junipernetworks.junos
.
To use it in a playbook, specify: junipernetworks.junos.junos_lldp_interfaces
.
New in version 1.0.0: of junipernetworks.junos
Synopsis¶
This module manages link layer discovery protocol (LLDP) attributes of interfaces on Juniper JUNOS devices.
Note
This module has a corresponding action plugin.
Parameters¶
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
junipernetworks.junos.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
junipernetworks.junos.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
junipernetworks.junos.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)
junipernetworks.junos.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;
# 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
# 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
# Task Output (redacted)
# -----------------------
# "rendered": "<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>"
# Using parsed
# parsed.cfg
# ------------
#
# <?xml version="1.0" encoding="UTF-8"?>
# <rpc-reply message-id="urn:uuid:0cadb4e8-5bba-47f4-986e-72906227007f">
# <configuration changed-seconds="1590139550" changed-localtime="2020-05-22 09:25:50 UTC">
# <protocols>
# <ospf>
# <area>
# <name>0.0.0.0</name>
# <interface>
# <name>ge-0/0/0.0</name>
# </interface>
# </area>
# </ospf>
# <lldp>
# <interface>
# <name>ge-0/0/1</name>
# </interface>
# <interface>
# <name>ge-0/0/2</name>
# <disable/>
# </interface>
# </lldp>
# </protocols>
# </configuration>
# </rpc-reply>
# - name: Convert lldp interfaces config to argspec without connecting to the appliance
# junipernetworks.junos.junos_lldp_interfaces:
# running_config: "{{ lookup('file', './parsed.cfg') }}"
# state: parsed
# Task Output (redacted)
# -----------------------
# "parsed": [
# {
# "name": "ge-0/0/1"
# },
# {
# "enabled": false,
# "name": "ge-0/0/2"
# }
# ]
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Ganesh Nalawade (@ganeshrn)