ansible.builtin.net_vrf (v2.8.19) — module

Manage VRFs on network devices

| "added in version" 2.4 of ansible.builtin"

Authors: Ricardo Carrillo Cruz (@rcarrillocruz)

preview | supported by network

Install Ansible via pip

Install with pip install ansible==2.8.19

Description

This module provides declarative management of VRFs on network devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create VRF named MANAGEMENT
  net_vrf:
    name: MANAGEMENT
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove VRF named MANAGEMENT
  net_vrf:
    name: MANAGEMENT
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create aggregate of VRFs with purge
  net_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
  net_vrf:
    aggregate:
      - name: test2
      - name: test3
      - name: test4
      - name: test5
    state: absent

Inputs

    
name:
    description:
    - Name of the VRF.

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

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

aggregate:
    description: List of VRFs definitions

interfaces:
    description:
    - List of interfaces the VRF should be configured on.

Outputs

commands:
  description: The list of configuration mode commands to send to the device
  returned: always, except for the platforms that use Netconf transport to manage
    the device.
  sample:
  - vrf definition MANAGEMENT
  type: list