community.general.cnos_vrf (0.1.1) — module

Manage VRFs on Lenovo CNOS network devices

Authors: Anil Kumar Muraleedharan (@amuraleedhar)

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

This module provides declarative management of VRFs on Lenovo CNOS network devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create vrf
  cnos_vrf:
    name: test
    rd: 1:200
    interfaces:
      - Ethernet1/33
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete VRFs
  cnos_vrf:
    name: test
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create aggregate of VRFs with purge
  cnos_vrf:
    aggregate:
      - { name: test4, rd: "1:204" }
      - { name: test5, rd: "1:205" }
    state: present
    purge: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete aggregate of VRFs
  cnos_vrf:
    aggregate:
      - name: test2
      - name: test3
      - name: test4
      - name: test5
    state: absent

Inputs

    
rd:
    description:
    - Route distinguisher of the VRF

name:
    description:
    - Name of the VRF.
    required: true

delay:
    default: 10
    description:
    - Time in seconds to wait before checking for the operational state on remote device.
      This wait is applicable for operational state arguments.

purge:
    default: false
    description:
    - Purge VRFs not defined in the I(aggregate) parameter.
    type: bool

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the VRF configuration.

aggregate:
    description: List of VRFs contexts

interfaces:
    description:
    - Identifies the set of interfaces that should be configured in the VRF. Interfaces
      must be routed interfaces in order to be placed into a VRF. The name of interface
      should be in expanded format and not abbreviated.

associated_interfaces:
    description:
    - This is a intent option and checks the operational state of the for given vrf C(name)
      for associated interfaces. If the value in the C(associated_interfaces) does not
      match with the operational state of vrf interfaces on device it will result in failure.

Outputs

commands:
  description: The list of configuration mode commands to send to the device
  returned: always
  sample:
  - vrf context test
  - rd 1:100
  - interface Ethernet1/44
  - vrf member test
  type: list