ansible.builtin.junos_vrf (v2.4.6.0-1) — module

Manage the VRF definitions on Juniper JUNOS devices

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

Authors: Ganesh Nalawade (@ganeshrn)

preview | supported by network

Install Ansible via pip

Install with pip install ansible==2.4.6.0.post1

Description

This module provides declarative management of VRF definitions on Juniper JUNOS devices. It allows playbooks to manage individual or the entire VRF collection.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure vrf configuration
  junos_vrf:
    name: test-1
    description: test-vrf-1
    interfaces:
      - ge-0/0/3
      - ge-0/0/2
    rd: 1.1.1.1:10
    target: target:65514:113
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove vrf configuration
  junos_vrf:
    name: test-1
    description: test-vrf-1
    interfaces:
      - ge-0/0/3
      - ge-0/0/2
    rd: 1.1.1.1:10
    target: target:65514:113
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Deactivate vrf configuration
  junos_vrf:
    name: test-1
    description: test-vrf-1
    interfaces:
      - ge-0/0/3
      - ge-0/0/2
    rd: 1.1.1.1:10
    target: target:65514:113
    active: False
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Activate vrf configuration
  junos_vrf:
    name: test-1
    description: test-vrf-1
    interfaces:
      - ge-0/0/3
      - ge-0/0/2
    rd: 1.1.1.1:10
    target: target:65514:113
    active: True
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create vrf using aggregate
  junos_vrf:
    aggregate:
    - name: test-1
      description: test-vrf-1
      interfaces:
        - ge-0/0/3
         - ge-0/0/2
      rd: 1.1.1.1:10
      target: target:65514:113
    - name: test-2
      description: test-vrf-2
      interfaces:
        - ge-0/0/4
        - ge-0/0/5
      rd: 2.2.2.2:10
      target: target:65515:114
  state: present

Inputs

    
rd:
    description:
    - The router-distinguisher value uniquely identifies the VRF to routing processes
      on the remote IOS system.  The RD value takes the form of C(A:B) where C(A) and
      C(B) are both numeric values.

name:
    description:
    - The name of the VRF definition to be managed on the remote IOS device.  The VRF
      definition name is an ASCII string name used to uniquely identify the VRF.  This
      argument is mutually exclusive with the C(aggregate) argument

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Configures the state of the VRF definition as it relates to the device operational
      configuration.  When set to I(present), the VRF should be configured in the device
      active configuration and when set to I(absent) the VRF should not be in the device
      active configuration

active:
    choices:
    - true
    - false
    default: true
    description:
    - Specifies whether or not the configuration is active or deactivated

target:
    description:
    - It configures VRF target community configuration. The target value takes the form
      of C(target:A:B) where C(A) and C(B) are both numeric values.

aggregate:
    description:
    - The set of VRF definition objects to be configured on the remote JUNOS device.  Ths
      list entries can either be the VRF name or a hash of VRF definitions and attributes.  This
      argument is mutually exclusive with the C(name) argument.

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.

description:
    description:
    - Provides a short description of the VRF definition in the current active configuration.  The
      VRF definition value accepts alphanumeric characters used to provide additional
      information about the VRF.

table_label:
    description:
    - Causes JUNOS to allocate a VPN label per VRF rather than per VPN FEC. This allows
      for forwarding of traffic to directly connected subnets, COS Egress filtering etc.

Outputs

diff.prepared:
  description: Configuration difference before and after applying change.
  returned: when configuration is changed and diff option is enabled.
  sample: '[edit routing-instances] +   test-1 { +       description test-vrf-1; +       instance-type
    vrf; +       interface ge-0/0/2.0; +       interface ge-0/0/3.0; +       route-distinguisher
    1.1.1.1:10; +       vrf-target target:65514:113; +   }

    '
  type: string