community.general.ce_vrf_interface (0.1.1) — module

Manages interface specific VPN configuration on HUAWEI CloudEngine switches.

Authors: Zhijin Zhou (@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 interface specific VPN configuration of HUAWEI CloudEngine switches.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: VRF interface 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 a VPN instance for the interface"
    ce_vrf_interface:
      vpn_interface: 40GE1/0/2
      vrf: test
      state: present
      provider: "{{ cli }}"

  - name: "Disable the association between a VPN instance and an interface"
    ce_vrf_interface:
      vpn_interface: 40GE1/0/2
      vrf: test
      state: absent
      provider: "{{ cli }}"

Inputs

    
vrf:
    description:
    - VPN instance, the length of vrf name is 1 ~ 31, i.e. "test", but can not be C(_public_).
    required: true

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Manage the state of the resource.
    required: false

vpn_interface:
    description:
    - An interface that can binding VPN instance, i.e. 40GE1/0/22, Vlanif10. Must be fully
      qualified interface name. Interface types, such as 10GE, 40GE, 100GE, LoopBack,
      MEth, Tunnel, Vlanif....
    required: true

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 end attributes on the interface
  returned: verbose mode
  sample:
    vpn_interface: 40GE2/0/17
    vrf: jss
  type: dict
existing:
  description: k/v pairs of existing attributes on the interface
  returned: verbose mode
  sample:
    vpn_interface: 40GE2/0/17
    vrf: null
  type: dict
proposed:
  description: k/v pairs of parameters passed into module
  returned: verbose mode
  sample:
    state: present
    vpn_interface: 40GE2/0/17
    vrf: jss
  type: dict
updates:
  description: command list sent to the device
  returned: always
  sample:
  - ip binding vpn-instance jss
  type: list