community.network.ce_lldp 模块 – 管理华为 CloudEngine 交换机上的 LLDP 配置。

注意

此模块是 community.network 集合(版本 5.1.0)的一部分。

如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install community.network

要在 playbook 中使用它,请指定:community.network.ce_lldp

注意

community.network 集合已弃用,并将从 Ansible 12 中删除。有关更多信息,请参阅讨论主题

community.network 0.2.0 版本中的新增功能

已弃用

在以下版本中移除:

版本 6.0.0

原因:

此集合及其中的所有内容均未维护并已弃用。

替代方案:

未知。

概要

  • 管理华为 CloudEngine 交换机上的 LLDP 配置。

别名:network.cloudengine.ce_lldp

参数

参数

注释

bind_name

字符串

绑定接口名称。

fast_count

整数

指定设备向相邻节点发送的 LLDP 消息的数量。

hold_multiplier

整数

邻居设备中设备信息的时间乘数。

interval

整数

发送 LLDP 广播的频率(以秒为单位)。

lldpenable

字符串

设置全局 LLDP 启用状态。

选择

  • "enabled"

  • "disabled"

management_address

字符串

LLDP 的管理 IP 地址。

mdn_notification_interval

整数

发送 MDN 邻居信息更改告警的延迟时间。

mdnstatus

字符串

设置全局 MDN 启用状态。

选择

  • "rxOnly"

  • "disabled"

notification_interval

整数

发送 LLDP 告警的抑制时间。

restart_delay

整数

指定接口 LLDP 模块从禁用状态重新启用之前的延迟时间。

state

字符串

管理资源的状态。

选择

  • "present" ←(默认)

  • "absent"

transmit_delay

整数

发送 LLDP 消息的延迟时间。

说明

注意

  • 此模块要求在被管理的远程设备上启用 netconf 系统服务。

  • 建议的连接是 netconf

  • 此模块也适用于传统 playbook 的 local 连接。

示例

- name: "Configure global LLDP enable state"
  community.network.ce_lldp:
    lldpenable: enabled

- name: "Configure global MDN enable state"
  community.network.ce_lldp:
    mdnstatus: rxOnly

- name: "Configure LLDP transmit interval and ensure global LLDP state is already enabled"
  community.network.ce_lldp:
    enable: enable
    interval: 32

- name: "Configure LLDP transmit multiplier hold and ensure global LLDP state is already enabled"
  community.network.ce_lldp:
    enable: enable
    hold_multiplier: 5

- name: "Configure the delay time of the interface LLDP module from disabled state to re enable"
  community.network.ce_lldp:
    enable: enable
    restart_delay: 3

- name: "Reset the delay time for sending LLDP messages"
  community.network.ce_lldp:
    enable: enable
    transmit_delay: 4

- name: "Configure device to send neighbor device information change alarm delay time"
  community.network.ce_lldp:
    lldpenable: enabled
    notification_interval: 6

- name: "Configure the number of LLDP messages sent to the neighbor nodes by the specified device"
  community.network.ce_lldp:
    enable: enable
    fast_count: 5

- name: "Configure the delay time for sending MDN neighbor information change alarm"
  community.network.ce_lldp:
    enable: enable
    mdn_notification_interval: 6
- name: "Configuring the management IP address of LLDP"
  community.network.ce_lldp:
    enable: enable
    management_address: 10.1.0.1

- name: "Configuring LLDP to manage the binding relationship between IP addresses and interfaces"
  community.network.ce_lldp:
    enable: enable
    bind_name: LoopBack2

返回值

常见返回值记录在此处,以下是此模块特有的字段

描述

changed

布尔值

检查设备上是否进行了更改

返回: 始终

示例: true

end_state

字典

模块执行后,全局 LLDP 配置的键/值对。

返回: 始终

示例: {"bind_name": "LoopBack2", "fast_count": "5", "hold_multiplier": "5", "interval": "32", "lldpenable": "enabled", "management_address": "10.1.0.1", "mdn_notification_interval": "6", "mdnstatus": "rxOnly", "notification_interval": "6", "restart_delay": "3", "transmit_delay": "4"}

existing

字典

现有全局 LLDP 配置的键/值对。

返回: 始终

示例: {"lldpenable": "disabled", "mdnstatus": "disabled"}

提议

字典

传递到模块的参数的键/值对

返回: 始终

示例: {"bind_name": "LoopBack2", "fast_count": "5", "hold_multiplier": "5", "interval": "32", "lldpenable": "enabled", "management_address": "10.1.0.1", "mdn_notification_interval": "6", "mdnstatus": "rxOnly", "notification_interval": "6", "restart_delay": "3", "state": "present", "transmit_delay": "4"}

更新

列表 / 元素=字符串

发送到设备的命令

返回: 始终

示例: ["lldp enable", "lldp mdn enable", "lldp transmit interval 32", "lldp transmit multiplier 5", "lldp restart 3", "lldp transmit delay 4", "lldp trap-interval 6", "lldp fast-count 5", "lldp mdn trap-interval 6", "lldp management-address 10.1.0.1", "lldp management-address bind interface LoopBack 2"]

状态

  • 此模块将在 6.0.0 版本中移除。[已弃用]

  • 更多信息请参见已弃用

作者

  • xuxiaowei0512 (@CloudEngine-Ansible)