cisco.iosxr.iosxr_lldp_interfaces 模块 – 配置LLDP接口的资源模块。
注意
此模块是 cisco.iosxr 集合 (版本 10.2.2) 的一部分。
如果您使用的是 ansible
软件包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install cisco.iosxr
。
要在 playbook 中使用它,请指定: cisco.iosxr.iosxr_lldp_interfaces
。
cisco.iosxr 1.0.0 中的新增功能
概要
此模块管理 IOS-XR 设备上接口的链路层发现协议 (LLDP) 属性。
参数
参数 |
注释 |
---|---|
LLDP 接口选项的字典。 |
|
指定接口上的 LLDP 目标配置。 |
|
指定接口上的 LLDP 目标 MAC 地址。 选项
|
|
接口或以太网捆绑的名称/标识符。 |
|
启用/禁用接口上的 LLDP RX。 选项
|
|
启用/禁用接口上的 LLDP TX。 选项
|
|
此选项仅与 state _parsed_ 一起使用。 此选项的值应是从 IOS-XR 设备通过执行命令 **show running-config int** 收到的输出。 state _parsed_ 从 |
|
模块完成后的配置状态。 选项
|
备注
注意
此模块与连接
network_cli
配合使用。请参阅 IOS-XR 平台选项。
示例
# Using merged
#
#
# ------------
# Before state
# ------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 12:40:23.104 UTC
# interface TenGigE0/0/0/0
# ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
# !
# interface preconfigure GigabitEthernet0/0/0/2
# !
#
#
- name: Merge provided configuration with running configuration
cisco.iosxr.iosxr_lldp_interfaces:
config:
- name: GigabitEthernet0/0/0/1
destination:
mac_address: ieee-nearest-non-tmpr-bridge
transmit: false
- name: GigabitEthernet0/0/0/2
destination:
mac_address: ieee-nearest-bridge
receive: false
state: merged
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
#
# "before": [
# {
# "name": "TenGigE0/0/0/0"
# },
# {
# "name": "GigabitEthernet0/0/0/1"
# },
# {
# "name": "GigabitEthernet0/0/0/2"
# }
# ]
#
# "commands": [
# "interface GigabitEthernet0/0/0/2",
# "lldp destination mac-address ieee-nearest-non-tmpr-bridge",
# "lldp transmit disable",
# "interface GigabitEthernet0/0/0/1",
# "lldp receive disable",
# "lldp destination mac-address ieee-nearest-bridge"
# ]
#
# "after": [
# {
# "name": "TenGigE0/0/0/0"
# },
# {
# "destination": {
# "mac_address": "ieee-nearest-bridge"
# },
# "name": "GigabitEthernet0/0/0/1",
# "receive": false
# },
# {
# "destination": {
# "mac_address": "ieee-nearest-non-tmpr-bridge"
# },
# "name": "GigabitEthernet0/0/0/2",
# "transmit": false
# }
# ]
#
#
# ------------
# After state
# ------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 12:49:51.517 UTC
# interface TenGigE0/0/0/0
# ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
# lldp
# receive disable
# destination mac-address
# ieee-nearest-bridge
# !
# !
# !
# interface preconfigure GigabitEthernet0/0/0/2
# lldp
# transmit disable
# destination mac-address
# ieee-nearest-non-tmpr-bridge
# !
# !
# !
#
#
# Using replaced
#
#
# -------------
# Before state
# -------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 12:49:51.517 UTC
# interface TenGigE0/0/0/0
# ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
# lldp
# receive disable
# destination mac-address
# ieee-nearest-bridge
# !
# !
# !
# interface preconfigure GigabitEthernet0/0/0/2
# lldp
# transmit disable
# destination mac-address
# ieee-nearest-non-tmpr-bridge
# !
# !
# !
#
#
- name: >-
Replace existing LLDP configurations of specified interfaces with provided
configuration
cisco.iosxr.iosxr_lldp_interfaces:
config:
- name: GigabitEthernet0/0/0/1
destination:
mac_address: ieee-nearest-non-tmpr-bridge
state: replaced
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
# "before": [
# {
# "name": "TenGigE0/0/0/0"
# },
# {
# "destination": {
# "mac_address": "ieee-nearest-bridge"
# },
# "name": "GigabitEthernet0/0/0/1",
# "receive": false
# },
# {
# "destination": {
# "mac_address": "ieee-nearest-non-tmpr-bridge"
# },
# "name": "GigabitEthernet0/0/0/2",
# "transmit": false
# }
# ]
#
#
# "commands": [
# "interface GigabitEthernet0/0/0/1",
# "no lldp receive disable",
# "lldp destination mac-address ieee-nearest-non-tmpr-bridge"
# ]
#
#
# "after": [
# {
# "name": "TenGigE0/0/0/0"
# },
# {
# "destination": {
# "mac_address": "ieee-nearest-non-tmpr-bridge"
# },
# "name": "GigabitEthernet0/0/0/1"
# },
# {
# "destination": {
# "mac_address": "ieee-nearest-non-tmpr-bridge"
# },
# "name": "GigabitEthernet0/0/0/2",
# "transmit": false
# }
# ]
#
#
# ------------
# After state
# ------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 13:02:57.062 UTC
# interface TenGigE0/0/0/0
# ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
# lldp
# destination mac-address
# ieee-nearest-non-tmpr-bridge
# !
# !
# !
# interface preconfigure GigabitEthernet0/0/0/2
# lldp
# transmit disable
# destination mac-address
# ieee-nearest-non-tmpr-bridge
# !
# !
# !
#
#
# Using overridden
#
#
# -------------
# Before state
# -------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 13:15:40.465 UTC
# interface TenGigE0/0/0/0
# ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
# lldp
# receive disable
# destination mac-address
# ieee-nearest-bridge
# !
# !
# !
# interface preconfigure GigabitEthernet0/0/0/2
# lldp
# transmit disable
# destination mac-address
# ieee-nearest-non-tmpr-bridge
# !
# !
# !
#
#
- name: >-
Override the LLDP configurations of all the interfaces with provided
configurations
cisco.iosxr.iosxr_lldp_interfaces:
config:
- name: GigabitEthernet0/0/0/1
transmit: false
state: overridden
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
#
# "before": [
# {
# "name": "TenGigE0/0/0/0"
# },
# {
# "destination": {
# "mac_address": "ieee-nearest-bridge"
# },
# "name": "GigabitEthernet0/0/0/1",
# "receive": false
# },
# {
# "destination": {
# "mac_address": "ieee-nearest-non-tmpr-bridge"
# },
# "name": "GigabitEthernet0/0/0/2",
# "transmit": false
# }
# ]
#
# "commands": [
# "interface GigabitEthernet0/0/0/2",
# "no lldp destination mac-address ieee-nearest-non-tmpr-bridge",
# "no lldp transmit disable",
# "interface GigabitEthernet0/0/0/1",
# "no lldp destination mac-address ieee-nearest-bridge",
# "no lldp receive disable",
# "lldp transmit disable"
# ]
#
#
# "after": [
# {
# "name": "TenGigE0/0/0/0"
# },
# {
# "name": "GigabitEthernet0/0/0/1",
# "transmit": false
# },
# {
# "name": "GigabitEthernet0/0/0/2"
# }
# ]
#
#
# ------------
# After state
# ------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 13:22:25.604 UTC
# interface TenGigE0/0/0/0
# ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
# lldp
# transmit disable
# !
# !
# interface preconfigure GigabitEthernet0/0/0/2
# !
#
#
# Using deleted
#
#
# -------------
# Before state
# -------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 13:26:21.498 UTC
# interface TenGigE0/0/0/0
# ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
# lldp
# receive disable
# destination mac-address
# ieee-nearest-bridge
# !
# !
# !
# interface preconfigure GigabitEthernet0/0/0/2
# lldp
# transmit disable
# destination mac-address
# ieee-nearest-non-tmpr-bridge
# !
# !
# !
#
#
- name: Delete LLDP configurations of all interfaces (Note - This won't delete the
interfaces themselves)
cisco.iosxr.iosxr_lldp_interfaces:
state: deleted
#
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
#
# "before": [
# {
# "name": "TenGigE0/0/0/0"
# },
# {
# "destination": {
# "mac_address": "ieee-nearest-bridge"
# },
# "name": "GigabitEthernet0/0/0/1",
# "receive": false
# },
# {
# "destination": {
# "mac_address": "ieee-nearest-non-tmpr-bridge"
# },
# "name": "GigabitEthernet0/0/0/2",
# "transmit": false
# }
# ]
#
#
# "commands": [
# "interface GigabitEthernet0/0/0/1",
# "no lldp destination mac-address ieee-nearest-bridge",
# "no lldp receive disable",
# "interface GigabitEthernet0/0/0/2",
# "no lldp destination mac-address ieee-nearest-non-tmpr-bridge",
# "no lldp transmit disable"
# ]
#
#
# "after": [
# {
# "name": "TenGigE0/0/0/0"
# },
# {
# "name": "GigabitEthernet0/0/0/1"
# },
# {
# "name": "GigabitEthernet0/0/0/2"
# }
# ]
#
#
# ------------
# After state
# ------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 13:30:14.618 UTC
# interface TenGigE0/0/0/0
# ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
# !
# interface preconfigure GigabitEthernet0/0/0/2
# !
#
#
# Using parsed:
# parsed.cfg
# interface TenGigE0/0/0/0
# ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
# lldp
# receive disable
# destination mac-address
# ieee-nearest-bridge
# !
# !
# !
# interface preconfigure GigabitEthernet0/0/0/2
# lldp
# transmit disable
# destination mac-address
# ieee-nearest-non-tmpr-bridge
- name: Convert lacp interfaces config to argspec without connecting to the appliance
cisco.iosxr.iosxr_lldp_interfaces:
running_config: "{{ lookup('file', './parsed.cfg') }}"
state: parsed
# ------------------------
# Module Execution Result
# ------------------------
# parsed: [
# - name: GigabitEthernet0/0/0/1
# destination:
# mac_address: ieee-nearest-non-tmpr-bridge
# transmit: False
# - name: GigabitEthernet0/0/0/2
# destination:
# mac_address: ieee-nearest-bridge
# receive: False
# ]
# Using gathered:
# Device config:
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 12:49:51.517 UTC
# interface TenGigE0/0/0/0
# ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
# lldp
# receive disable
# destination mac-address
# ieee-nearest-bridge
# !
# !
# !
# interface preconfigure GigabitEthernet0/0/0/2
# lldp
# transmit disable
# destination mac-address
# ieee-nearest-non-tmpr-bridge
- name: Gather IOSXR lldp interfaces configuration
cisco.iosxr.iosxr_lldp_interfaces:
config:
state: gathered
# ------------------------
# Module Execution Result
# ------------------------
# gathered:
# - name: GigabitEthernet0/0/0/1
# destination:
# mac_address: ieee-nearest-non-tmpr-bridge
# transmit: False
# - name: GigabitEthernet0/0/0/2
# destination:
# mac_address: ieee-nearest-bridge
# receive: False
# Using rendred:
- name: Render platform specific commands from task input using rendered state
cisco.iosxr.iosxr_lldp_interfaces:
config:
- name: GigabitEthernet0/0/0/1
destination:
mac_address: ieee-nearest-non-tmpr-bridge
transmit: false
- name: GigabitEthernet0/0/0/2
destination:
mac_address: ieee-nearest-bridge
receive: false
state: rendered
# ------------------------
# Module Execution Result
# ------------------------
# "rendered": [
# "interface GigabitEthernet0/0/0/2",
# "lldp destination mac-address ieee-nearest-non-tmpr-bridge",
# "lldp transmit disable",
# "interface GigabitEthernet0/0/0/1",
# "lldp receive disable",
# "lldp destination mac-address ieee-nearest-bridge"
# ]
返回值
公共返回值已在 此处 记录,以下是此模块独有的字段
键 |
描述 |
---|---|
模块完成后的配置作为结构化数据。 返回:发生更改时 示例: |
|
模块调用之前的配置作为结构化数据。 返回:始终 示例: |
|
推送到远程设备的命令集。 返回:始终 示例: |