cisco.nxos.nxos_lldp_global 模块 – LLDP 资源模块
注意
此模块是 cisco.nxos 集合(版本 9.2.1)的一部分。
如果您使用的是 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install cisco.nxos。
要在 playbook 中使用它,请指定:cisco.nxos.nxos_lldp_global。
cisco.nxos 1.0.0 中的新增功能
概要
- 此模块在 NX-OS 平台上配置和管理链路层发现协议 (LLDP) 属性。 
参数
| 参数 | 注释 | 
|---|---|
| 链路层发现配置的列表 | |
| 接收设备应保留信息的时间量(以秒为单位) | |
| 此属性定义是否应以长(0)或短(1)形式通告接口名称。 选择 
 | |
| 在任何接口上延迟 LLDP 初始化所需的时间量(以秒为单位) | |
| 需要传输 LLDP 更新的频率(以秒为单位) | |
| 此属性可用于指定需要在 LLDP 数据包中发送和接收的 TLV。默认情况下,会通告所有 TLV | |
| 用于指定数据中心桥接交换协议 TLV 选择 
 | |
| 用于在 TLV 消息中指定管理地址 | |
| 具有 TLV v4 的管理地址 选择 
 | |
| 具有 TLV v6 的管理地址 选择 
 | |
| 用于管理 TLV 消息中基于端口的属性 | |
| 用于指定端口描述 TLV 选择 
 | |
| 用于指定端口 VLAN ID TLV 选择 
 | |
| 用于指定 IEEE 802.3 DTE 通过 MDI TLV 供电 选择 
 | |
| 用于管理 TLV 消息中基于系统的属性 | |
| 用于指定系统功能 TLV 选择 
 | |
| 用于指定系统描述 TLV 选择 
 | |
| 用于指定系统名称 TLV 选择 
 | |
| 此选项仅与状态 parsed 一起使用。 此选项的值应该是通过执行命令 show running-config | include lldp 从 NX-OS 设备接收的输出。 状态 parsed 从  | |
| 模块完成后配置的状态。 对于此模块,状态  选择 
 | 
说明
注意
- 在 VIRL 上针对 NxOS 7.3.(0)D1(1) 进行了测试 
- 不支持 Cisco MDS 
- 在使用此模块之前,需要启用 LLDP 功能 
示例
# Using merged
# Before state:
# -------------
#
# user(config)# show running-config | include lldp
# feature lldp
- name: Merge provided configuration with device configuration
  cisco.nxos.nxos_lldp_global:
    config:
      timer: 35
      holdtime: 100
    state: merged
# After state:
# ------------
#
# user(config)# show running-config | include lldp
# feature lldp
# lldp timer 35
# lldp holdtime 100
# Using replaced
# Before state:
# -------------
#
# user(config)# show running-config | include lldp
# feature lldp
# lldp holdtime 100
# lldp reinit 5
# lldp timer 35
- name: Replace device configuration of specific LLDP attributes with provided configuration
  cisco.nxos.nxos_lldp_global:
    config:
      timer: 40
      tlv_select:
        system:
          description: true
          name: false
        management_address:
          v4: true
    state: replaced
# After state:
# ------------
#
# user(config)# show running-config | include lldp
# feature lldp
# lldp timer 40
# no lldp tlv-select system-name
# Using deleted
# Before state:
# -------------
#
# user(config)# show running-config | include lldp
# feature lldp
# lldp holdtime 5
# lldp reinit 3
- name: Delete LLDP configuration (this will by default remove all lldp configuration)
  cisco.nxos.nxos_lldp_global:
    state: deleted
# After state:
# ------------
#
# user(config)# show running-config | include lldp
# feature lldp
# Using rendered
- name: Use rendered state to convert task input to device specific commands
  cisco.nxos.nxos_lldp_global:
    config:
      holdtime: 130
      port_id: 1
      reinit: 5
      tlv_select:
        dcbxp: true
        power_management: true
    state: rendered
# Task Output (redacted)
# -----------------------
# rendered:
#   - "lldp tlv-select dcbxp"
#   - "lldp tlv-select power-management"
#   - "lldp portid-subtype 1"
#   - "lldp reinit 5"
#   - "lldp holdtime 130"
# Using parsed
# parsed.cfg
# ------------
# lldp holdtime 131
# lldp reinit 7
# no lldp tlv-select system-name
# no lldp tlv-select system-description
# Task output (redacted)
# -----------------------
# parsed:
#   holdtime: 131
#   reinit: 7
#   tlv_select:
#     system:
#       description: false
#       name: false
# Using gathered
# Existing device config state
# -------------------------------
# feature lldp
# lldp holdtime 129
# lldp reinit 5
# lldp timer 35
# no lldp tlv-select system-name
# Task output (redacted)
# -----------------------
# gathered:
#   reinit: 5
#   timer: 35
#   tlv_select:
#     system:
#       name: False
#   holdtime: 129
返回值
常见的返回值记录在此处,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 模块完成后作为结构化数据的配置。 返回:当更改时 示例:  | |
| 调用模块之前作为结构化数据的配置。 返回:始终 示例:  | |
| 推送到远程设备的命令集。 返回:始终 示例:  | 
