Skip to content

Latest commit

 

History

History
7459 lines (7271 loc) · 315 KB

cisco.ios.ios_vrf_address_family_module.rst

File metadata and controls

7459 lines (7271 loc) · 315 KB

cisco.ios.ios_vrf_address_family

Resource module to configure VRF definitions.

Version added: 7.0.0

  • This module provides declarative management of VRF definitions on Cisco IOS.
Parameter Choices/Defaults Comments
config
list / elements=dictionary
A list of device configurations for VRF.
address_families
list / elements=dictionary
Enable address family and enter its config mode - AFI/SAFI configuration
afi
string
    Choices:
  • ipv4
  • ipv6
Address Family Identifier (AFI)
bgp
dictionary
Commands pertaining to BGP configuration.
next_hop
dictionary
Next-hop for the routes of a VRF in the backbone.
loopback
integer
Loopback interface for next-hop
export
dictionary
VRF export
ipv4
dictionary
Address family based VRF export
multicast
dictionary
Export prefixes to IPv4 Multicast table
map
string
Route-map name
prefix
integer
Upper limit on export prefixes without hogging memory
unicast
dictionary
Export prefixes to IPv4 Unicast table
allow_evpn
boolean
    Choices:
  • no
  • yes
Allow EVPN routes into global table
map
string
Route-map name
prefix
integer
Upper limit on export prefixes without hogging memory
map
string
Route-map name
import_config
dictionary
VRF import
ipv4
dictionary
Address family based VRF import
multicast
dictionary
Import prefixes from IPv4 Multicast table
map
string
Route-map name
prefix
integer
Upper limit on import prefixes without hogging memory
unicast
dictionary
Import prefixes from IPv4 Unicast table
allow_evpn
boolean
    Choices:
  • no
  • yes
allow Global->VRF routes into EVPN
limit
integer
Upper limit on import prefixes without hogging memory
map
string
Route-map based VRF import
map
string
Route-map name
inter_as_hybrid
dictionary
Inter AS hybrid mode
csc
dictionary
Carrier Supporting Carrier
next_hop
string
Next-hop for the routes of a VRF in the backbone.
next_hop
string
Next-hop for the routes of a VRF in the backbone.
mdt
dictionary
Backbone Multicast Distribution Tree
auto_discovery
dictionary
BGP auto-discovery for MVPN
ingress_replication
dictionary
BGP auto-discovery for Ingress-Replication
inter_as
dictionary
Enable Inter-AS BGP auto-discovery
mdt_hello_enable
boolean
    Choices:
  • no
  • yes
Enable PIM Hellos over MDT interface
mdt_hello_enable
boolean
    Choices:
  • no
  • yes
Enable PIM Hellos over MDT interface
pim
dictionary
BGP auto-discovery for PIM
inter_as
dictionary
Enable Inter-AS BGP auto-discovery
mdt_hello_enable
boolean
    Choices:
  • no
  • yes
Enable PIM Hellos over MDT interface
pim_tlv_announce
dictionary
Announce PIM TLV for data MDT
mdt_hello_enable
boolean
    Choices:
  • no
  • yes
Enable PIM Hellos over MDT interface
mdt_hello_enable
boolean
    Choices:
  • no
  • yes
Enable PIM Hellos over MDT interface
pim_tlv_announce
dictionary
Announce PIM TLV for data MDT
mdt_hello_enable
boolean
    Choices:
  • no
  • yes
Enable PIM Hellos over MDT interface
receiver_site
boolean
    Choices:
  • no
  • yes
BGP receiver only site for MVPN
data
dictionary
MDT data trees
ingress_replication
dictionary
Use Ingress-Replication to create the data MDT
immediate_switch
boolean
    Choices:
  • no
  • yes
Switch immediately to Data MDT tree
list
dictionary
Access-list
access_list_name
string
IP Named Extended Access list
access_list_number
integer
Access-list number
number
integer
Number of data MDT
list
dictionary
Access-list
access_list_name
string
IP Named Extended Access list
access_list_number
integer
Access-list number
threshold
integer
MDT switching threshold
default
dictionary
Default MDT configuration
ingress_replication
boolean
    Choices:
  • no
  • yes
Use Ingress-Replication for the default MDT
direct
boolean
    Choices:
  • no
  • yes
Direct MDT's
log_reuse
boolean
    Choices:
  • no
  • yes
Event logging for data MDT reuse
mode
dictionary
The type of encapsulation
gre
boolean
    Choices:
  • no
  • yes
GRE encapsulation
mtu
integer
The MTU
overlay
dictionary
MDT overlay Protocol
bgp
dictionary
BGP Overlay signalling
shared_tree_prune_delay
integer
Delay before shared tree is pruned at C-RP PE
source_tree_prune_delay
integer
Delay before source tree is pruned at C-S PE
use_bgp
dictionary
Use BGP for MDT overlay signaling
spt_only
boolean
    Choices:
  • no
  • yes
Enable SPT-only ASM mode
partitioned
dictionary
Partitioned Multicast Distribution Tree
ingress_replication
boolean
    Choices:
  • no
  • yes
Use Ingress-Replication for the partitioned MDT
strict_rpf
dictionary
Enable strict RPF check
interface
boolean
    Choices:
  • no
  • yes
Interface based strict RPF check
protection
dictionary
Configure local repair
local_prefixes
boolean
    Choices:
  • no
  • yes
Enable protection for local prefixes
route_replicate
dictionary
Replicate (import) routes from another topology (and another VRF)
from_config
dictionary
Replicate routes from another VRF
multicast
dictionary
Multicast SAFI
all
dictionary
All routes
route_map
string
Route-map reference
bgp
dictionary
Border Gateway Protocol (BGP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
eigrp
dictionary
Enhanced Interior Gateway Routing Protocol (EIGRP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
isis
dictionary
Intermediate System-to-Intermediate System (ISIS)
iso_tag
string
ISO routing area tag
route_map
string
Route-map reference
mobile
dictionary
Mobile routes
route_map
string
Route-map reference
odr
dictionary
On-Demand Stub routes
route_map
string
Route-map reference
ospf
dictionary
Open Shortest Path First (OSPF)
process_id
integer
OSPF process ID
route_map
string
Route-map reference
rip
dictionary
Routing Information Protocol (RIP)
route_map
string
Route-map reference
static
dictionary
Static routes
route_map
string
Route-map reference
topology
dictionary
Topology name
base
dictionary
Base topology
all
dictionary
All routes
route_map
string
Route-map reference
bgp
dictionary
Border Gateway Protocol (BGP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
eigrp
dictionary
Enhanced Interior Gateway Routing Protocol (EIGRP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
isis
dictionary
Intermediate System-to-Intermediate System (ISIS)
iso_tag
string
ISO routing area tag
route_map
string
Route-map reference
mobile
dictionary
Mobile routes
route_map
string
Route-map reference
odr
dictionary
On-Demand Stub routes
route_map
string
Route-map reference
ospf
dictionary
Open Shortest Path First (OSPF)
process_id
integer
OSPF process ID
route_map
string
Route-map reference
rip
dictionary
Routing Information Protocol (RIP)
route_map
string
Route-map reference
static
dictionary
Static routes
route_map
string
Route-map reference
unicast
dictionary
Unicast SAFI
all
dictionary
All routes
route_map
string
Route-map reference
bgp
dictionary
Border Gateway Protocol (BGP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
connected
dictionary
Connected routes
route_map
string
Route-map reference
eigrp
dictionary
Enhanced Interior Gateway Routing Protocol (EIGRP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
isis
dictionary
Intermediate System-to-Intermediate System (ISIS)
iso_tag
string
ISO routing area tag
route_map
string
Route-map reference
mobile
dictionary
Mobile routes
route_map
string
Route-map reference
odr
dictionary
On-Demand Stub routes
route_map
string
Route-map reference
ospf
dictionary
Open Shortest Path First (OSPF)
process_id
integer
OSPF process ID
route_map
string
Route-map reference
rip
dictionary
Routing Information Protocol (RIP)
route_map
string
Route-map reference
static
dictionary
Static routes
route_map
string
Route-map reference
vrf
dictionary
Specify a source VRF
global
dictionary
global VRF
multicast
dictionary
Multicast SAFI
all
dictionary
All routes
route_map
string
Route-map reference
bgp
dictionary
Border Gateway Protocol (BGP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
eigrp
dictionary
Enhanced Interior Gateway Routing Protocol (EIGRP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
isis
dictionary
Intermediate System-to-Intermediate System (ISIS)
iso_tag
string
ISO routing area tag
route_map
string
Route-map reference
mobile
dictionary
Mobile routes
route_map
string
Route-map reference
odr
dictionary
On-Demand Stub routes
route_map
string
Route-map reference
ospf
dictionary
Open Shortest Path First (OSPF)
process_id
integer
OSPF process ID
route_map
string
Route-map reference
rip
dictionary
Routing Information Protocol (RIP)
route_map
string
Route-map reference
static
dictionary
Static routes
route_map
string
Route-map reference
topology
dictionary
Topology name
base
dictionary
Base topology
all
dictionary
All routes
route_map
string
Route-map reference
bgp
dictionary
Border Gateway Protocol (BGP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
eigrp
dictionary
Enhanced Interior Gateway Routing Protocol (EIGRP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
isis
dictionary
Intermediate System-to-Intermediate System (ISIS)
iso_tag
string
ISO routing area tag
route_map
string
Route-map reference
mobile
dictionary
Mobile routes
route_map
string
Route-map reference
odr
dictionary
On-Demand Stub routes
route_map
string
Route-map reference
ospf
dictionary
Open Shortest Path First (OSPF)
process_id
integer
OSPF process ID
route_map
string
Route-map reference
rip
dictionary
Routing Information Protocol (RIP)
route_map
string
Route-map reference
static
dictionary
Static routes
route_map
string
Route-map reference
unicast
dictionary
Unicast SAFI
all
dictionary
All routes
route_map
string
Route-map reference
bgp
dictionary
Border Gateway Protocol (BGP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
connected
dictionary
Connected routes
route_map
string
Route-map reference
eigrp
dictionary
Enhanced Interior Gateway Routing Protocol (EIGRP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
isis
dictionary
Intermediate System-to-Intermediate System (ISIS)
iso_tag
string
ISO routing area tag
route_map
string
Route-map reference
mobile
dictionary
Mobile routes
route_map
string
Route-map reference
odr
dictionary
On-Demand Stub routes
route_map
string
Route-map reference
ospf
dictionary
Open Shortest Path First (OSPF)
process_id
integer
OSPF process ID
route_map
string
Route-map reference
rip
dictionary
Routing Information Protocol (RIP)
route_map
string
Route-map reference
static
dictionary
Static routes
route_map
string
Route-map reference
multicast
dictionary
Multicast SAFI
all
dictionary
All routes
route_map
string
Route-map reference
bgp
dictionary
Border Gateway Protocol (BGP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
eigrp
dictionary
Enhanced Interior Gateway Routing Protocol (EIGRP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
isis
dictionary
Intermediate System-to-Intermediate System (ISIS)
iso_tag
string
ISO routing area tag
route_map
string
Route-map reference
mobile
dictionary
Mobile routes
route_map
string
Route-map reference
odr
dictionary
On-Demand Stub routes
route_map
string
Route-map reference
ospf
dictionary
Open Shortest Path First (OSPF)
process_id
integer
OSPF process ID
route_map
string
Route-map reference
rip
dictionary
Routing Information Protocol (RIP)
route_map
string
Route-map reference
static
dictionary
Static routes
route_map
string
Route-map reference
topology
dictionary
Topology name
base
dictionary
Base topology
all
dictionary
All routes
route_map
string
Route-map reference
bgp
dictionary
Border Gateway Protocol (BGP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
eigrp
dictionary
Enhanced Interior Gateway Routing Protocol (EIGRP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
isis
dictionary
Intermediate System-to-Intermediate System (ISIS)
iso_tag
string
ISO routing area tag
route_map
string
Route-map reference
mobile
dictionary
Mobile routes
route_map
string
Route-map reference
odr
dictionary
On-Demand Stub routes
route_map
string
Route-map reference
ospf
dictionary
Open Shortest Path First (OSPF)
process_id
integer
OSPF process ID
route_map
string
Route-map reference
rip
dictionary
Routing Information Protocol (RIP)
route_map
string
Route-map reference
static
dictionary
Static routes
route_map
string
Route-map reference
name
string
Source VRF name
unicast
dictionary
Unicast SAFI
all
dictionary
All routes
route_map
string
Route-map reference
bgp
dictionary
Border Gateway Protocol (BGP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
connected
dictionary
Connected routes
route_map
string
Route-map reference
eigrp
dictionary
Enhanced Interior Gateway Routing Protocol (EIGRP)
as_number
integer
Autonomous System Number
route_map
string
Route-map reference
isis
dictionary
Intermediate System-to-Intermediate System (ISIS)
iso_tag
string
ISO routing area tag
route_map
string
Route-map reference
mobile
dictionary
Mobile routes
route_map
string
Route-map reference
odr
dictionary
On-Demand Stub routes
route_map
string
Route-map reference
ospf
dictionary
Open Shortest Path First (OSPF)
process_id
integer
OSPF process ID
route_map
string
Route-map reference
rip
dictionary
Routing Information Protocol (RIP)
route_map
string
Route-map reference
static
dictionary
Static routes
route_map
string
Route-map reference
recursion_policy
dictionary
Route replication recursion policy
destination
boolean
    Choices:
  • no
  • yes
Recurse in destination topology
route_target
dictionary
Specify Target VPN Extended Communities.
both
string
Both export and import Target-VPN community
export
string
Export Target-VPN community.
import_config
string
Export Target-VPN community.
safi
string
    Choices:
  • multicast
  • unicast
Address Family modifier
name
string / required
Name of the VRF.
running_config
string
This option is used only with state parsed.
The value of this option should be the output received from the IOS device by executing the command show running-config vrf.
The state parsed reads the configuration from running_config option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the parsed key within the result.
state
string
    Choices:
  • parsed
  • gathered
  • deleted
  • merged ←
  • replaced
  • rendered
  • overridden
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 config option to platform specific CLI commands which will be returned in the rendered key within the result. For state rendered active connection to remote host is not required.
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 running_config option and transforms it into JSON format as per the resource module parameters and the value is returned in the parsed key within the result. The value of running_config option should be the same format as the output of command show running-config vrf. connection to remote host is not required.

Note

# Using merged
#
# Before state:
# -------------
#
# RP/0/0/CPU0:ios#show running-config | section ^vrf
# vrf defnition test
#

- name: Merge provided configuration with device configuration
  cisco.ios.ios_vrf_address_family:
    config:
      - name: test1
        address_families:
          - afi: "ipv4"
            safi: "unicast"
            bgp:
              next_hop:
                loopback: 40
            export:
              ipv4:
                multicast:
                  map: "single"
                  prefix: 345
                unicast:
                  allow_evpn: true
                  map: "test-map"
                  prefix: 67
              map: "testing-map"
            import_config:
              ipv4:
                multicast:
                  map: "import-map"
                  prefix: 89
                unicast:
                  allow_evpn: true
                  limit: 12
                  map: "ran-map"
              map: "import-map"
    state: merged

# Task Output:
# ------------
#
# before: []
#
# commands:
# - vrf definition test1
# - address-family ipv4 unicast
# - bgp next-hop loopback 40
# - export map "testing-map"
# - export ipv4 multicast 345 map "single"
# - export ipv4 unicast 67 map "test-map" allow-evpn
# - import map "import-map"
# - import ipv4 multicast 89 map "import-map"
# - import ipv4 unicast 12 map "ran-map" allow-evpn
#
# after:
# - name: test1
#   address_families:
#     - afi: "ipv4"
#       safi: "unicast"
#       bgp:
#         next_hop:
#           loopback: 40
#       export:
#         ipv4:
#           multicast:
#             map: "single"
#             prefix: 345
#           unicast:
#             allow_evpn: true
#             map: "test-map"
#             prefix: 67
#         map: "testing-map"
#       import_config:
#         ipv4:
#           multicast:
#             map: "import-map"
#             prefix: 89
#           unicast:
#             allow_evpn: true
#             limit: 12
#             map: "ran-map"
#       map: "import-map"
#
# After state:
# ------------
#
# RP/0/0/CPU0:ios#show running-config | section ^vrf
# vrf definition test1
#  address-family ipv4 unicast
#   bgp next-hop loopback 40
#   export map "testing-map"
#   export ipv4 multicast 345 map "single"
#   export ipv4 unicast 67 map "test-map" allow-evpn
#   import map "import-map"
#   import ipv4 multicast 89 map "import-map"
#   import ipv4 unicast 12 map "ran-map" allow-evpn

# Using replaced
#
# Before state:
# -------------
#
# RP/0/0/CPU0:ios#show running-config | section ^vrf
# vrf definition test1
#  address-family ipv4 unicast
#   bgp next-hop loopback 40
#   export map "testing-map"
#   export ipv4 multicast 345 map "single"
#   export ipv4 unicast 67 map "test-map" allow-evpn
#   import map "import-map"
#   import ipv4 multicast 89 map "import-map"
#   import ipv4 unicast 12 map "ran-map" allow-evpn

- name: Replace the provided configuration with the existing running configuration
  cisco.ios.ios_vrf_address_family:
    config:
      - name: test1
        address_families:
          - afi: "ipv4"
            safi: "unicast"
            bgp:
              next_hop:
                loopback: 40
            export:
              ipv4:
                multicast:
                  map: "single"
                  prefix: 345
                unicast:
                  allow_evpn: true
                  map: "test-map"
                  prefix: 67
              map: "testing-map"
            import_config:
              ipv4:
                multicast:
                  map: "import-map"
                  prefix: 89
                unicast:
                  allow_evpn: true
                  limit: 12
                  map: "ran-map"
              map: "import-map"
    state: replaced

# Task Output:
# ------------
#
# before:
# - name: test1
#   address_families:
#     - afi: "ipv4"
#       safi: "unicast"
#       bgp:
#         next_hop:
#           loopback: 40
#       export:
#         ipv4:
#           multicast:
#             map: "single"
#             prefix: 345
#           unicast:
#             allow_evpn: true
#             map: "test-map"
#             prefix: 67
#         map: "testing-map"
#       import_config:
#         ipv4:
#           multicast:
#             map: "import-map"
#             prefix: 89
#           unicast:
#             allow_evpn: true
#             limit: 12
#             map: "ran-map"
#       map: "import-map"
#
# commands:
# - vrf definition test1
# - address-family ipv4 unicast
# - bgp next-hop loopback 40
# - export map "testing-map"
# - export ipv4 multicast 345 map "single"
# - export ipv4 unicast 67 map "test-map" allow-evpn
# - import map "import-map"
# - import ipv4 multicast 89 map "import-map"
# - import ipv4 unicast 12 map "ran-map" allow-evpn
#
# after:
# - name: VRF1
#   address_families:
#     - afi: "ipv4"
#       safi: "unicast"
#       bgp:
#         next_hop:
#           loopback: 23
#       export:
#         ipv4:
#           multicast:
#             map: "single"
#             prefix: 33
#           unicast:
#             allow_evpn: true
#             map: "test-map1"
#             prefix: 7
#         map: "testing-map"
#       import_config:
#         ipv4:
#           multicast:
#             map: "import-map1"
#             prefix: 89
#           unicast:
#             allow_evpn: true
#             limit: 12
#             map: "ran-map"
#       map: "import-map"
#
# After state:
# ------------
#
# RP/0/RP0/CPU0:ios(config)#show running-config vrf
# vrf definition VRF1
#  address-family ipv4 unicast
#   bgp next-hop loopback 23
#   export map "testing-map"
#   export ipv4 multicast 345 map "single"
#   export ipv4 unicast 67 map "test-map1" allow-evpn
#   import map "import-map"
#   import ipv4 multicast 89 map "import-map1"
#   import ipv4 unicast 12 map "ran-map" allow-evpn

# Using overridden
#
# Before state:
# -------------
#
# RP/0/RP0/CPU0:ios(config)#show running-config | section ^vrf
# vrf definition test1
#  address-family ipv4 unicast
#   bgp next-hop loopback 40
#   export map "testing-map"
#   export ipv4 multicast 345 map "single"
#   export ipv4 unicast 67 map "test-map" allow-evpn
#   import map "import-map"
#   import ipv4 multicast 89 map "import-map"
#   import ipv4 unicast 12 map "ran-map" allow-evpn

- name: Override the provided configuration with the existing running configuration
  cisco.ios.ios_vrf_address_family:
    state: overridden
    config:
      - name: VRF7
        address_families:
          - afi: "ipv4"
            safi: "unicast"
            bgp:
              next_hop:
                loopback: 89
            export:
              ipv4:
                multicast:
                  map: "single"
                  prefix: 345
                unicast:
                  allow_evpn: true
                  map: "test-map"
                  prefix: 67
              map: "testing-map"
            import_config:
              ipv4:
                multicast:
                  map: "import-map"
                  prefix: 89
                unicast:
                  allow_evpn: true
                  limit: 12
                  map: "ran-map"
              map: "import-map"
# Task Output:
# ------------
#
# before:
# - name: test1
#   address_families:
#     - afi: "ipv4"
#       safi: "unicast"
#       bgp:
#         next_hop:
#           loopback: 40
#       export:
#         ipv4:
#           multicast:
#             map: "single"
#             prefix: 345
#           unicast:
#             allow_evpn: true
#             map: "test-map"
#             prefix: 67
#         map: "testing-map"
#       import_config:
#         ipv4:
#           multicast:
#             map: "import-map"
#             prefix: 89
#           unicast:
#             allow_evpn: true
#             limit: 12
#             map: "ran-map"
#       map: "import-map"
#
# commands:
# - vrf definition VRF7
# - address-family ipv4 unicast
# - bgp next-hop loopback 89
# - export map "testing-map"
# - export ipv4 multicast 345 map "single"
# - export ipv4 unicast 67 map "test-map" allow-evpn
# - import map "import-map"
# - import ipv4 multicast 89 map "import-map"
# - import ipv4 unicast 12 map "ran-map" allow-evpn

#
# After state:
# -------------
# RP/0/RP0/CPU0:ios(config)#show running-config vrf
# vrf definition VRF4
# vrf definition VRF7
#  address-family ipv4 unicast
#   bgp next-hop loopback 89
#   export map "testing-map"
#   export ipv4 multicast 345 map "single"
#   export ipv4 unicast 67 map "test-map" allow-evpn
#   import map "import-map"
#   import ipv4 multicast 89 map "import-map1"
#   import ipv4 unicast 12 map "ran-map" allow-evpn

# Using deleted
#
# Before state:
# -------------
#
# RP/0/RP0/CPU0:ios(config)#show running-config | section ^vrf
# vrf definition VRF4
# vrf definition VRF6
# address-family ipv4 unicast
#  bgp next-hop loopback 40
#  import map "import-map"
#  import ipv4 multicast 89 map "import-map"
#  import ipv4 unicast 12 map "ran-map" allow-evpn
#  export map "testing-map"
#  export ipv4 multicast 345 map "single"
#  export ipv4 unicast 67 map "test-map" allow-evpn
# vrf definition VRF7

- name: Delete the provided configuration
  cisco.ios.ios_vrf_address_family:
    config:
    state: deleted

# Task Output:
# ------------
#
# before:
# - name: VRF4
# - name: VRF6
#   address_families:
#     - afi: "ipv4"
#       safi: "unicast"
#       bgp:
#         next_hop:
#           loopback: 23
#       import_config:
#         ipv4:
#           multicast:
#             map: "import-map"
#             prefix: 89
#           unicast:
#             map: "ran-map"
#             limit: 12
#             allow_evpn: true
#         map: "import-map"
#       export:
#         ipv4:
#           multicast:
#             map: "single"
#             prefix: 345
#           unicast:
#             map: "test-map"
#             prefix: 67
#             allow_evpn: true
#         map: "testing-map"
# - name: VRF7

# commands:
# - vrf definition VRF4
# - vrf definition VRF6
# - no address-family ipv4 unicast
# - vrf definition VRF7
#
# after:
# - name: VRF4
# - name: VRF6
# - name: VRF7
#
# After state:
# ------------
#
# RP/0/RP0/CPU0:ios(config)#show running-config | section ^vrf
# vrf definition VRF4
# vrf definition VRF6
# vrf definition VRF7

# Using rendered
#
- name: Render provided configuration with device configuration
  cisco.ios.ios_vrf_address_family:
    config:
      - name: test
        address_families:
          - afi: "ipv4"
            safi: "unicast"
            bgp:
              next_hop:
                loopback: 23
            import_config:
              ipv4:
                multicast:
                  map: "import-map"
                  prefix: 89
                unicast:
                  map: "ran-map"
                  limit: 12
                  allow_evpn: true
              map: "import-map"
            export:
              ipv4:
                multicast:
                  map: "single"
                  prefix: 345
                unicast:
                  map: "test-map"
                  prefix: 67
                  allow_evpn: true
              map: "testing-map"
    state: rendered

# Task Output:
# ------------
#
# rendered:
# - vrf definition test
# - address-family ipv4 unicast
# - bgp next-hop loopback 23
# - import map "import-map"
# - import ipv4 multicast 89 map "import-map"
# - import ipv4 unicast 12 map "ran-map" allow-evpn
# - export map "testing-map"
# - export ipv4 multicast 345 map "single"
# - export ipv4 unicast 67 map "test-map" allow-evpn

# Using gathered
#
# Before state:
# -------------
#
# RP/0/RP0/CPU0:ios(config)#show running-config | section ^vrf
# vrf definition test1
# address-family ipv4 unicast
#  bgp next-hop loopback 40
#  import map "import-map"
#  import ipv4 multicast 89 map "import-map"
#  import ipv4 unicast 12 map "ran-map" allow-evpn
#  export map "testing-map"
#  export ipv4 multicast 345 map "single"
#  export ipv4 unicast 67 map "test-map" allow-evpn

- name: Gather existing running configuration
  cisco.ios.ios_vrf_address_family:
    state: gathered

# Task Output:
# ------------
#
# gathered:
# - name: test1
#   address_families:
#    - afi: "ipv4"
#      safi: "unicast"
#      bgp:
#        next_hop:
#          loopback: 40
#      export:
#        ipv4:
#          multicast:
#            map: "single"
#            prefix: 345
#          unicast:
#            allow_evpn: true
#            map: "test-map"
#            prefix: 67
#        map: "testing-map"
#      import_config:
#        ipv4:
#          multicast:
#            map: "import-map"
#            prefix: 89
#          unicast:
#            allow_evpn: true
#            limit: 12
#            map: "ran-map"
#        map: "import-map"

# Using parsed
#
# File: parsed.cfg
# ----------------
#
# vrf definition test
# address-family ipv4 unicast
#  bgp next-hop loopback 23
#  import map "import-map"
#  import ipv4 multicast 89 map "import-map"
#  import ipv4 unicast 12 map "ran-map" allow-evpn
#  export map "testing-map"
#  export ipv4 multicast 345 map "single"
#  export ipv4 unicast 67 map "test-map" allow-evpn

- name: Parse the provided configuration
  cisco.ios.ios_vrf_address_family:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# Task Output:
# ------------
#
# parsed:
#   - address_families:
#     - afi: ipv4
#       bgp:
#         next_hop:
#           loopback: 40
#        export:
#          ipv4:
#            multicast:
#              map: "single"
#              prefix: 345
#            unicast:
#              allow_evpn: true
#              map: "test-map"
#              prefix: 67
#          map: "testing-map"
#        import_config:
#          ipv4:
#            multicast:
#              map: "import-map"
#              prefix: 89
#            unicast:
#              allow_evpn: true
#              limit: 12
#              map: "ran-map"
#       safi: unicast
#     name: test

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
after
list
when changed
The resulting configuration after module execution.

Sample:
This output will always be in the same format as the module argspec.
before
list
when state is merged, replaced, overridden, deleted or purged
The configuration prior to the module execution.

Sample:
This output will always be in the same format as the module argspec.
commands
list
when state is merged, replaced, overridden, deleted
The set of commands pushed to the remote device.

Sample:
['vrf definition test1', 'address-family ipv4 unicast', 'bgp next-hop loopback 40', 'export map "testing-map"', 'export ipv4 multicast 345 map "testmap"']
gathered
list
when state is gathered
Facts about the network resource gathered from the remote device as structured data.

Sample:
This output will always be in the same format as the module argspec.
parsed
list
when state is parsed
The device native config provided in running_config option parsed into structured data as per module argspec.

Sample:
This output will always be in the same format as the module argspec.
rendered
list
when state is rendered
The provided configuration in the task rendered in device-native format (offline).

Sample:
['vrf definition test1', 'address-family ipv4 unicast', 'bgp next-hop loopback 40', 'import map "testing-map"', 'export ipv4 multicast 345 map "testmap"']


Authors

  • Ruchi Pakhle (@Ruchip16)