arista.eos.eos_vrf_global module – Resource module to configure VRF definitions.
Note
This module is part of the arista.eos collection (version 10.1.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install arista.eos
.
To use it in a playbook, specify: arista.eos.eos_vrf_global
.
New in arista.eos 10.0.0
Synopsis
This module provides declarative management of VRF definitions on Arista EOS platforms.
Parameters
Parameter |
Comments |
---|---|
A list of dictionaries containing device configurations for VRF definitions. |
|
A description for the VRF. |
|
Name of the VRF Instance. |
|
BGP Route Distinguisher (RD). |
|
This option is used only with state parsed. The value of this option should be the output received from the EOS device by executing the command show running-config vrf. The state parsed reads the configuration from |
|
The state the configuration should be left in The states rendered, gathered and parsed does not perform any change on the device. The state rendered will transform the configuration in The state gathered will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the gathered key within the result. The state parsed reads the configuration from Choices:
|
Notes
Note
Tested against Arista EOS 4.23.0F
This module works with connection
network_cli
. See the EOS Platform Options.
Examples
# Using merged
#
# Before state:
# -------------
#
# test#show running-config | section ^vrf
- name: Merge provided configuration with device configuration
arista.eos.eos_vrf_global:
config:
- name: VRF4
description: VRF4 Description
rd: "3:4"
state: merged
# Task Output:
# ------------
#
# before: []
#
# commands:
# - vrf instance VRF4
# - description VRF4 Description
# - rd 3:4
#
# after:
# - name: VRF4
# description: VRF4 Description
# rd: "3:4"
#
# After state:
# ------------
#
# test#show running-config | section ^vrf
# vrf instance VRF4
# description "VRF4 Description"
# rd "3:4"
# Using replaced
#
# Before state:
# -------------
#
# test#show running-config | section ^vrf
# vrf instance VRF4
# description "VRF4 Description"
# rd "3:4"
- name: Replace the provided configuration with the existing running configuration
arista.eos.eos_vrf_global:
config:
- name: VRF7
description: VRF7 description
rd: "67:9"
state: replaced
# Task Output:
# ------------
#
# before:
# - name: VRF4
# description: VRF4 Description
# rd: "3:4"
#
# commands:
# - vrf instance VRF7
# - description VRF7 description
# - rd 6:9
#
# after:
# - name: VRF4
# description: VRF4 Description
# rd: "3:4"
# - name: VRF7
# description: VRF7 description
# rd: "6:9"
#
# After state:
# ------------
#
# test#show running-config | section ^vrf
# vrf instance VRF4
# description VRF4 Description
# rd 3:4
# !
# vrf instance VRF7
# description VRF7 description
# rd 6:9
# !
# !
# Using overridden
#
# Before state:
# -------------
#
# test#show running-config | section ^vrf
# vrf instance VRF4
# description VRF4 Description
# rd 3:4
# !
# vrf instance VRF7
# description VRF7 description
# rd 6:9
# !
# !
- name: Override the provided configuration with the existing running configuration
arista.eos.eos_vrf_global:
state: overridden
config:
- name: VRF6
description: VRF6 Description
rd: "9:8"
# Task Output:
# ------------
#
# before:
# - name: VRF4
# description: VRF4 Description
# rd: "3:4"
# - name: VRF7
# description: VRF7 description
# rd: "6:9"
#
# commands:
# - vrf instance VRF4
# - no description VRF4 Description
# - no rd 3:4
# - vrf instance VRF7
# - no description VRF7 description
# - no rd 67:9
# - vrf instance VRF6
# - description VRF6 Description
# - rd 9:8
#
# after:
# - name: VRF4
# - name: VRF6
# description: VRF6 Description
# rd: "9:8"
# - name: VRF7
#
# After state:
# -------------
# test#show running-config | section ^vrf
# vrf instance VRF4
# vrf instance VRF6
# description VRF6 Description
# rd 9:8
# vrf instance VRF7
# Using deleted
#
# Before state:
# -------------
#
# test#show running-config | section ^vrf
# vrf instance VRF4
# vrf instance VRF6
# description VRF6 Description
# rd 9:8
# vrf instance VRF7
- name: Delete the provided configuration
arista.eos.eos_vrf_global:
config:
state: deleted
# Task Output:
# ------------
#
# before:
# - name: VRF4
# - name: VRF6
# description: VRF6 Description
# rd: "9:8"
# - name: VRF7
# commands:
# - vrf instance VRF4
# - vrf instance VRF6
# - no description VRF6 Description
# - no rd 9:8
# - vrf instance VRF7
#
# after:
# - name: VRF4
# - name: VRF6
# - name: VRF7
#
# After state:
# ------------
#
# test#show running-config | section ^vrf
# vrf instance VRF4
# vrf instance VRF6
# vrf instance VRF7
# Using purged
#
# Before state:
# -------------
#
# test#show running-config | section ^vrf
# vrf instance VRF4
# vrf instance VRF6
# vrf instance VRF7
- name: Purge all the configuration from the device
arista.eos.eos_vrf_global:
state: purged
# Task Output:
# ------------
#
# before:
# - name: VRF4
# - name: VRF6
# - name: VRF7
#
# commands:
# - no vrf instance VRF4
# - no vrf instance VRF6
# - no vrf instance VRF7
#
# after: []
#
# After state:
# -------------
# test#show running-config | section ^vrf
# -
# Using rendered
#
- name: Render provided configuration with device configuration
arista.eos.eos_vrf_global:
config:
- name: VRF4
description: VRF4 Description
rd: "3:4"
state: rendered
# Task Output:
# ------------
#
# rendered:
# - vrf instance VRF4
# - description VRF4 Description
# - rd 3:4
# Using gathered
#
# Before state:
# -------------
#
# test#show running-config | section ^vrf
# vrf instance VRF4
# description "VRF4 Description"
# rd "3:4"
- name: Gather existing running configuration
arista.eos.eos_vrf_global:
state: gathered
# Task Output:
# ------------
#
# gathered:
# - name: VRF4
# description: VRF4 Description
# rd: "3:4"
# Using parsed
#
# File: parsed.cfg
# ----------------
#
# vrf instance test
# description "This is test VRF"
# rd "testing"
# !
# !
# vrf my_vrf
# description "this is sample vrf for feature testing"
# rd "2:3"
# !
# !
- name: Parse the provided configuration
arista.eos.eos_vrf_global:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Task Output:
# ------------
#
# parsed:
# - description: This is test VRF
# name: test
# rd: testing
# - description: this is sample vrf for feature testing
# name: my_vrf
# rd: '2:3'
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The resulting configuration after module execution. Returned: when changed Sample: |
|
The configuration prior to the module execution. Returned: when state is Sample: |
|
The set of commands pushed to the remote device. Returned: when state is Sample: |
|
Facts about the network resource gathered from the remote device as structured data. Returned: when state is Sample: |
|
The device native config provided in running_config option parsed into structured data as per module argspec. Returned: when state is Sample: |
|
The provided configuration in the task rendered in device-native format (offline). Returned: when state is Sample: |