community.network.ce_evpn_bd_vni 模块 – 管理华为 CloudEngine 交换机上的 EVPN VXLAN 网络标识符 (VNI)。

注意

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

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

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

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

注意

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

已弃用

中删除

版本 6.0.0

原因

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

替代

未知。

概要

  • 管理华为 CloudEngine 交换机上的以太网虚拟专用网络 (EVPN) VXLAN 网络标识符 (VNI) 配置。

别名:network.cloudengine.ce_evpn_bd_vni

参数

参数

注释

bridge_domain_id

字符串 / 必需

指定一个已存在的桥接域 (BD)。该值是 1 到 16777215 之间的整数。

evpn

字符串

在 BD 视图中为 VXLAN 创建或删除 EVPN 实例。

选择

  • "enable" ← (默认)

  • "disable"

route_distinguisher

字符串

为 BD EVPN 实例配置路由区分符 (RD)。RD 的格式可以如下所示

  1. 2 字节 AS 号:4 字节用户定义的数字,例如,1:3。AS 号是 0 到 65535 之间的整数,用户定义的数字是 0 到 4294967295 之间的整数。AS 和用户定义的数字不能都为 0。这意味着 RD 不能为 0:0。

  2. 整数 4 字节 AS 号:2 字节用户定义的数字,例如,65537:3。AS 号是 65536 到 4294967295 之间的整数,用户定义的数字是 0 到 65535 之间的整数。

  3. 点分表示的 4 字节 AS 号:2 字节用户定义的数字,例如,0.0:3 或 0.1:0。点分表示的 4 字节 AS 号的格式为 x.y,其中 x 和 y 是 0 到 65535 之间的整数。

  4. 用户定义的数字是 0 到 65535 之间的整数。AS 和用户定义的数字不能都为 0。这意味着 RD 不能为 0.0:0。

  5. 32 位 IP 地址:2 字节用户定义的数字。例如,192.168.122.15:1。IP 地址范围为 0.0.0.0 到 255.255.255.255,用户定义的数字是 0 到 65535 之间的整数。

  6. “auto” 指定自动生成的 RD。

state

字符串

管理资源的状态。

选择

  • "present" ← (默认)

  • "absent"

vpn_target_both

字符串

将 VPN 目标添加到 BD EVPN 实例的导入和导出 VPN 目标列表。格式与 route_distinguisher 相同。

vpn_target_export

字符串

将 VPN 目标添加到 BD EVPN 实例的导出 VPN 目标列表。格式与 route_distinguisher 相同。

vpn_target_import

字符串 / 必需

将 VPN 目标添加到 BD EVPN 实例的导入 VPN 目标列表。格式与 route_distinguisher 相同。

注意

注意

  • 当状态为 present 时,确保已配置 EVPN 作为 VXLAN 控制平面。

  • 当状态为 present 时,确保已存在桥接域 (BD)。

  • 当状态为 present 时,确保已创建 VNI 并将其与广播域 (BD) 相关联。

  • 如果配置 evpn:false 以删除 EVPN 实例,则会删除 EVPN 实例中的所有配置。

  • 在 BD 视图中创建 EVPN 实例后,可以使用 BD-EVPN 实例视图中的 route_distinguisher 参数配置 RD。

  • 在为 BD EVPN 实例配置 VPN 目标之前,请确保已为 BD EVPN 实例配置 RD

  • 如果取消配置 route_distinguisher,则会同时删除 BD EVPN 实例的所有 VPN 目标属性。

  • 当使用 state:absent 时,不支持 evpn,它将被忽略。

  • 当使用 state:absent 删除 VPN 目标属性时,请确保已存在 VPN 目标属性的配置,否则会报告错误。

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

  • 建议的连接是 netconf

  • 此模块也适用于遗留 playbook 的 local 连接。

示例

- name: EVPN BD VNI test
  hosts: cloudengine
  connection: local
  gather_facts: false
  vars:
    cli:
      host: "{{ inventory_hostname }}"
      port: "{{ ansible_ssh_port }}"
      username: "{{ username }}"
      password: "{{ password }}"
      transport: cli

  tasks:

  - name: "Configure an EVPN instance for a VXLAN in BD view"
    community.network.ce_evpn_bd_vni:
      bridge_domain_id: 20
      evpn: enable
      provider: "{{ cli }}"

  - name: "Configure a route distinguisher (RD) for a BD EVPN instance"
    community.network.ce_evpn_bd_vni:
      bridge_domain_id: 20
      route_distinguisher: '22:22'
      provider: "{{ cli }}"

  - name: "Configure VPN targets to both the import and export VPN target lists of a BD EVPN instance"
    community.network.ce_evpn_bd_vni:
      bridge_domain_id: 20
      vpn_target_both: 22:100,22:101
      provider: "{{ cli }}"

  - name: "Configure VPN targets to the import VPN target list of a BD EVPN instance"
    community.network.ce_evpn_bd_vni:
      bridge_domain_id: 20
      vpn_target_import: 22:22,22:23
      provider: "{{ cli }}"

  - name: "Configure VPN targets to the export VPN target list of a BD EVPN instance"
    community.network.ce_evpn_bd_vni:
      bridge_domain_id: 20
      vpn_target_export: 22:38,22:39
      provider: "{{ cli }}"

  - name: "Unconfigure VPN targets to both the import and export VPN target lists of a BD EVPN instance"
    community.network.ce_evpn_bd_vni:
      bridge_domain_id: 20
      vpn_target_both: '22:100'
      state: absent
      provider: "{{ cli }}"

  - name: "Unconfigure VPN targets to the import VPN target list of a BD EVPN instance"
    community.network.ce_evpn_bd_vni:
      bridge_domain_id: 20
      vpn_target_import: '22:22'
      state: absent
      provider: "{{ cli }}"

  - name: "Unconfigure VPN targets to the export VPN target list of a BD EVPN instance"
    community.network.ce_evpn_bd_vni:
      bridge_domain_id: 20
      vpn_target_export: '22:38'
      state: absent
      provider: "{{ cli }}"

  - name: "Unconfigure a route distinguisher (RD) of a BD EVPN instance"
    community.network.ce_evpn_bd_vni:
      bridge_domain_id: 20
      route_distinguisher: '22:22'
      state: absent
      provider: "{{ cli }}"

  - name: "Unconfigure an EVPN instance for a VXLAN in BD view"
    community.network.ce_evpn_bd_vni:
      bridge_domain_id: 20
      evpn: disable
      provider: "{{ cli }}"

返回值

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

描述

changed

布尔值

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

返回: 始终

示例: true

end_state

字典

设备上结束属性的 k/v 对

返回: 始终

示例: {"bridge_domain_id": "2", "evpn": "enable", "route_distinguisher": "22:22", "vpn_target_both": ["22:100", "22:101"], "vpn_target_export": ["22:38", "22:39"], "vpn_target_import": ["22:22", "22:23"]}

现有配置

字典

设备上现有属性的键/值对

返回: 始终

示例: {"bridge_domain_id": "2", "evpn": "disable", "route_distinguisher": null, "vpn_target_both": [], "vpn_target_export": [], "vpn_target_import": []}

建议配置

字典

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

返回: 始终

示例: {"bridge_domain_id": "2", "evpn": "enable", "route_distinguisher": "22:22", "state": "present", "vpn_target_both": ["22:100", "22:101"], "vpn_target_export": ["22:38", "22:39"], "vpn_target_import": ["22:22", "22:23"]}

更新

列表 / 元素=字符串

发送到设备的命令列表

返回: 始终

示例: ["bridge-domain 2", "  evpn", "    route-distinguisher 22:22", "    vpn-target 22:38 export-extcommunity", "    vpn-target 22:39 export-extcommunity", "    vpn-target 22:100 export-extcommunity", "    vpn-target 22:101 export-extcommunity", "    vpn-target 22:22 import-extcommunity", "    vpn-target 22:23 import-extcommunity", "    vpn-target 22:100 import-extcommunity", "    vpn-target 22:101 import-extcommunity"]

状态

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

  • 有关更多信息,请参阅 已弃用

作者

  • Zhijin Zhou (@QijunPan)