community.general.ce_vrf_af (0.1.1) — module

Manages VPN instance address family on HUAWEI CloudEngine switches.

Authors: Yang yang (@QijunPan)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Manages VPN instance address family of HUAWEI CloudEngine switches.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: vrf af module 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: Config vpna, set address family is ipv4
    ce_vrf_af:
      vrf: vpna
      vrf_aftype: v4
      state: present
      provider: "{{ cli }}"
  - name: Config vpna, delete address family is ipv4
    ce_vrf_af:
      vrf: vpna
      vrf_aftype: v4
      state: absent
      provider: "{{ cli }}"
  - name: Config vpna, set address family is ipv4,rd=1:1,set vpn_target_type=export_extcommunity,vpn_target_value=2:2
    ce_vrf_af:
      vrf: vpna
      vrf_aftype: v4
      route_distinguisher: 1:1
      vpn_target_type: export_extcommunity
      vpn_target_value: 2:2
      vpn_target_state: present
      state: present
      provider: "{{ cli }}"
  - name: Config vpna, set address family is ipv4,rd=1:1,delete vpn_target_type=export_extcommunity,vpn_target_value=2:2
    ce_vrf_af:
      vrf: vpna
      vrf_aftype: v4
      route_distinguisher: 1:1
      vpn_target_type: export_extcommunity
      vpn_target_value: 2:2
      vpn_target_state: absent
      state: present
      provider: "{{ cli }}"

Inputs

    
vrf:
    description:
    - VPN instance.
    required: true

evpn:
    default: 'no'
    description:
    - Is extend vpn or normal vpn.
    type: bool

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Manage the state of the af.

vrf_aftype:
    choices:
    - v4
    - v6
    default: v4
    description:
    - VPN instance address family.

vpn_target_type:
    choices:
    - export_extcommunity
    - import_extcommunity
    description:
    - VPN instance vpn target type.

vpn_target_state:
    choices:
    - present
    - absent
    description:
    - Manage the state of the vpn target.

vpn_target_value:
    description:
    - VPN instance target value. Such as X.X.X.X:number<0-65535> or number<0-65535>:number<0-4294967295>
      or number<0-65535>.number<0-65535>:number<0-65535> or number<65536-4294967295>:number<0-65535>
      but not support 0:0 and 0.0:0.

route_distinguisher:
    description:
    - VPN instance route distinguisher,the RD used to distinguish same route prefix from
      different vpn. The RD must be setted before setting vpn_target_value.

Outputs

changed:
  description: check to see if a change was made on the device
  returned: always
  sample: true
  type: bool
end_state:
  description: k/v pairs of switchport after module execution
  returned: always
  sample:
    route_distinguisher:
    - '1:1'
    - '2:2'
    vpn_target_type:
    - import_extcommunity
    - '3:3'
    vpn_target_value: []
    vrf: vpna
    vrf_aftype:
    - ipv4uni
    - ipv6uni
  type: dict
existing:
  description: k/v pairs of existing switchport
  returned: always
  sample:
    route_distinguisher:
    - '1:1'
    - '2:2'
    vpn_target_type: []
    vpn_target_value: []
    vrf: vpna
    vrf_aftype:
    - ipv4uni
    - ipv6uni
  type: dict
proposed:
  description: k/v pairs of parameters passed into module
  returned: always
  sample:
    evpn: none
    state: present
    vpn_targe_state: absent
    vpn_target_type: none
    vpn_target_value: none
    vrf: vpna
    vrf_aftype: v4
  type: dict
updates:
  description: command list sent to the device
  returned: always
  sample:
  - ip vpn-instance vpna
  - vpn-target 3:3 import_extcommunity
  type: list