community.network.ce_evpn_bgp_rr 模块 – 管理华为CloudEngine交换机上VXLAN网络的RR。

注意

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

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

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

要在剧本中使用它,请指定: community.network.ce_evpn_bgp_rr

注意

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

已弃用

在以下版本中移除:

版本 6.0.0

原因:

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

替代方案:

未知。

概要

  • 在华为CloudEngine交换机上的BGP-EVPN地址族视图中配置RR。

别名:network.cloudengine.ce_evpn_bgp_rr

参数

参数

注释

as_number

字符串 / 必需

指定AS编号,以整数格式表示。值为范围从1到4294967295的整数。

bgp_evpn_enable

字符串

启用或禁用BGP-EVPN地址族。

选项

  • "enable" ← (默认)

  • "disable"

bgp_instance

字符串

指定BGP实例的名称。instance-name的值可以是整数1或1到31的字符串。

peer

字符串

指定对等体的IPv4地址或组名。

peer_type

字符串

指定对等体类型。

选项

  • "group_name"

  • "ipv4_address"

policy_vpn_target

字符串

启用或禁用VPN-Target过滤。

选项

  • "enable"

  • "disable"

reflect_client

字符串

将本地设备配置为路由反射器,并将对等体或对等体组配置为路由反射器的客户端。

选项

  • "enable"

  • "disable"

备注

注意

  • 确保BGP视图已存在。

  • peer、peer_type和reflect_client参数必须全部存在或全部不存在。

  • 推荐的连接是 network_cli

  • 此模块也适用于旧版剧本的 local 连接。

示例

- name: BGP RR 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 BGP-EVPN address family view and ensure that BGP view has existed."
    community.network.ce_evpn_bgp_rr:
      as_number: 20
      bgp_evpn_enable: enable
      provider: "{{ cli }}"

  - name: "Configure reflect client and ensure peer has existed."
    community.network.ce_evpn_bgp_rr:
      as_number: 20
      peer_type: ipv4_address
      peer: 192.8.3.3
      reflect_client: enable
      provider: "{{ cli }}"

  - name: "Configure the VPN-Target filtering."
    community.network.ce_evpn_bgp_rr:
      as_number: 20
      policy_vpn_target: enable
      provider: "{{ cli }}"

  - name: "Configure an RR in BGP-EVPN address family view."
    community.network.ce_evpn_bgp_rr:
      as_number: 20
      bgp_evpn_enable: enable
      peer_type: ipv4_address
      peer: 192.8.3.3
      reflect_client: enable
      policy_vpn_target: disable
      provider: "{{ cli }}"

返回值

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

描述

changed

布尔值

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

返回:始终

示例: true

end_state

字典

设备上最终属性的键值对

返回:始终

示例: {"as_number": "20", "bgp_evpn_enable": "enable", "bgp_instance": null, "peer": "192.8.3.3", "peer_type": "ipv4_address", "policy_vpn_target": "disable", "reflect_client": "enable"}

existing

字典

设备上现有属性的键值对

返回:始终

示例: {"as_number": "20", "bgp_evpn_enable": "disable", "bgp_instance": null, "peer": null, "peer_type": null, "policy_vpn_target": "disable", "reflect_client": "disable"}

proposed

字典

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

返回:始终

示例: {"as_number": "20", "bgp_evpn_enable": "enable", "bgp_instance": null, "peer": "192.8.3.3", "peer_type": "ipv4_address", "policy_vpn_target": "disable", "reflect_client": "enable"}

updates

列表 / 元素=字符串

发送到设备的命令列表

返回:始终

示例: ["bgp 20", "  l2vpn-family evpn", "    peer 192.8.3.3 enable", "    peer 192.8.3.3 reflect-client", "    undo policy vpn-target"]

状态

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

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

作者

  • 周志金 (@QijunPan)