ce_evpn_bd_vni - Manages EVPN VXLAN Network Identifier (VNI) on HUAWEI CloudEngine switches.

New in version 2.4.

Synopsis

  • Manages Ethernet Virtual Private Network (EVPN) VXLAN Network Identifier (VNI) configurations on HUAWEI CloudEngine switches.

Options

parameter required default choices comments
bridge_domain_id
yes
Specify an existed bridge domain (BD).The value is an integer ranging from 1 to 16777215.
evpn
no enable
  • enable
  • disable
Create or delete an EVPN instance for a VXLAN in BD view.
route_distinguisher
no
Configures a route distinguisher (RD) for a BD EVPN instance. The format of an RD can be as follows
1) 2-byte AS number:4-byte user-defined number, for example, 1:3. An AS number is an integer ranging from 0 to 65535, and a user-defined number is an integer ranging from 0 to 4294967295. The AS and user-defined numbers cannot be both 0s. This means that an RD cannot be 0:0.
2) Integral 4-byte AS number:2-byte user-defined number, for example, 65537:3. An AS number is an integer ranging from 65536 to 4294967295, and a user-defined number is an integer ranging from 0 to 65535.
3) 4-byte AS number in dotted notation:2-byte user-defined number, for example, 0.0:3 or 0.1:0. A 4-byte AS number in dotted notation is in the format of x.y, where x and y are integers ranging from 0 to 65535.
4) A user-defined number is an integer ranging from 0 to 65535. The AS and user-defined numbers cannot be both 0s. This means that an RD cannot be 0.0:0.
5) 32-bit IP address:2-byte user-defined number. For example, 192.168.122.15:1. An IP address ranges from 0.0.0.0 to 255.255.255.255, and a user-defined number is an integer ranging from 0 to 65535.
6) 'auto' specifies the RD that is automatically generated.
state
no present
  • present
  • absent
Manage the state of the resource.
vpn_target_both
no
Add VPN targets to both the import and export VPN target lists of a BD EVPN instance. The format is the same as route_distinguisher.
vpn_target_export
no
Add VPN targets to the export VPN target list of a BD EVPN instance. The format is the same as route_distinguisher.
vpn_target_import
yes
Add VPN targets to the import VPN target list of a BD EVPN instance. The format is the same as route_distinguisher.

Examples

- name: EVPN BD VNI test
  hosts: cloudengine
  connection: local
  gather_facts: no
  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"
    ce_evpn_bd_vni:
      bridge_domain_id: 20
      evpn: enable
      provider: "{{ cli }}"

  - name: "Configure a route distinguisher (RD) for a BD EVPN instance"
    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"
    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"
    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"
    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"
    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"
    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"
    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"
    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"
    ce_evpn_bd_vni:
      bridge_domain_id: 20
      evpn: disable
      provider: "{{ cli }}"

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
changed
check to see if a change was made on the device
always boolean True
end_state
k/v pairs of end attributes on the device
always dict {'vpn_target_export': ['22:38', '22:39'], 'route_distinguisher': '22:22', 'vpn_target_both': ['22:100', '22:101'], 'evpn': 'enable', 'vpn_target_import': ['22:22', '22:23'], 'bridge_domain_id': '2'}
existing
k/v pairs of existing attributes on the device
always dict {'vpn_target_export': [], 'route_distinguisher': None, 'vpn_target_both': [], 'evpn': 'disable', 'vpn_target_import': [], 'bridge_domain_id': '2'}
proposed
k/v pairs of parameters passed into module
always dict {'vpn_target_export': ['22:38', '22:39'], 'state': 'present', 'route_distinguisher': '22:22', 'vpn_target_both': ['22:100', '22:101'], 'evpn': 'enable', 'vpn_target_import': ['22:22', '22:23'], 'bridge_domain_id': '2'}
updates
command list sent to the device
always list ['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']

Notes

Note

  • Ensure that EVPN has been configured to serve as the VXLAN control plane when state is present.
  • Ensure that a bridge domain (BD) has existed when state is present.
  • Ensure that a VNI has been created and associated with a broadcast domain (BD) when state is present.
  • If you configure evpn:false to delete an EVPN instance, all configurations in the EVPN instance are deleted.
  • After an EVPN instance has been created in the BD view, you can configure an RD using route_distinguisher parameter in BD-EVPN instance view.
  • Before configuring VPN targets for a BD EVPN instance, ensure that an RD has been configured for the BD EVPN instance
  • If you unconfigure route_distinguisher, all VPN target attributes for the BD EVPN instance will be removed at the same time.
  • When using state:absent, evpn is not supported and it will be ignored.
  • When using state:absent to delete VPN target attributes, ensure the configuration of VPN target attributes has existed and otherwise it will report an error.

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/ce_evpn_bd_vni_module.html