Module to configure VRF definitions.
Version added: 1.0.0
- This module provides declarative management of VRF definitions on Cisco IOS devices. It allows playbooks to manage individual or the entire VRF collection. It also supports purging VRF definitions from the configuration that are not explicitly defined.
Note
- Tested against Cisco IOSXE Version 17.3 on CML.
- This module works with connection
network_cli
. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>`
- For more information on using Ansible to manage Cisco devices see the Cisco integration page.
- name: Configure a vrf named management
cisco.ios.ios_vrf:
name: management
description: oob mgmt vrf
interfaces:
- Management1
- name: Remove a vrf named test
cisco.ios.ios_vrf:
name: test
state: absent
- name: Configure set of VRFs and purge any others
cisco.ios.ios_vrf:
vrfs:
- red
- blue
- green
purge: true
- name: Creates a list of import RTs for the VRF with the same parameters
cisco.ios.ios_vrf:
name: test_import
rd: 1:100
route_import:
- 1:100
- 3:100
- name:
Creates a list of import RTs in address-family configuration submode for the
VRF with the same parameters
cisco.ios.ios_vrf:
name: test_import_ipv4
rd: 1:100
route_import_ipv4:
- 1:100
- 3:100
- name:
Creates a list of import RTs in address-family configuration submode for the
VRF with the same parameters
cisco.ios.ios_vrf:
name: test_import_ipv6
rd: 1:100
route_import_ipv6:
- 1:100
- 3:100
- name: Creates a list of export RTs for the VRF with the same parameters
cisco.ios.ios_vrf:
name: test_export
rd: 1:100
route_export:
- 1:100
- 3:100
- name:
Creates a list of export RTs in address-family configuration submode for the
VRF with the same parameters
cisco.ios.ios_vrf:
name: test_export_ipv4
rd: 1:100
route_export_ipv4:
- 1:100
- 3:100
- name:
Creates a list of export RTs in address-family configuration submode for the
VRF with the same parameters
cisco.ios.ios_vrf:
name: test_export_ipv6
rd: 1:100
route_export_ipv6:
- 1:100
- 3:100
- name:
Creates a list of import and export route targets for the VRF with the same
parameters
cisco.ios.ios_vrf:
name: test_both
rd: 1:100
route_both:
- 1:100
- 3:100
- name:
Creates a list of import and export route targets in address-family configuration
submode for the VRF with the same parameters
cisco.ios.ios_vrf:
name: test_both_ipv4
rd: 1:100
route_both_ipv4:
- 1:100
- 3:100
- name:
Creates a list of import and export route targets in address-family configuration
submode for the VRF with the same parameters
cisco.ios.ios_vrf:
name: test_both_ipv6
rd: 1:100
route_both_ipv6:
- 1:100
- 3:100
Common return values are documented here, the following are the fields unique to this module:
- Peter Sprygada (@privateip)