cisco.ios.ios_route_maps module – Resource module to configure route maps.
Note
This module is part of the cisco.ios collection (version 4.6.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 cisco.ios
.
To use it in a playbook, specify: cisco.ios.ios_route_maps
.
New in cisco.ios 2.1.0
Synopsis
This module configures and manages the attributes of Route maps on Cisco IOS.
Note
This module has a corresponding action plugin.
Parameters
Parameter |
Comments |
---|---|
A list of configurations for Route maps. |
|
A list of configurations entries for Route maps. |
|
Route map set operations Choices:
|
|
Continue on a different entry within the route-map |
|
Route-map entry sequence number Please refer vendor documentation for valid values |
|
Set continue Choices:
|
|
Route-map comment |
|
Match values from routing table |
|
BGP Add-Path match policie BGP Add-Path advertise-set policy |
|
BGP Add-Path advertise all paths Choices:
|
|
BGP Add-Path advertise best n paths (1-3) |
|
BGP Add-Path advertise best paths (range m to n) |
|
BGP Add-Path best paths to advertise (lower limit) (1-3) |
|
BGP Add-Path best paths to advertise (upper limit) (1-3) |
|
BGP Add-Path advertise group-best path Choices:
|
|
Match BGP AS path list |
|
AS path access-list Please refer vendor documentation for valid values |
|
Set AS path list Choices:
|
|
CLNS information |
|
Match address of route or match packet |
|
Match next-hop address of route |
|
Match advertising source address of route |
|
Match BGP community list |
|
Do exact matching of communities Choices:
|
|
Community-list number/Community-list name Please refer vendor documentation for valid values |
|
Match BGP/VPN extended community list Extended community-list number Please refer vendor documentation for valid values |
|
Match first hop interface of route |
|
IP specific information |
|
Match address of route or match packet |
|
Match entries of acl IP acl name/number Please refer vendor documentation for valid values |
|
Match entries of prefix-lists IP prefix-list name |
|
Match src/dest prefix component of flowspec prefix |
|
Match entries of acl IP acl name/number Please refer vendor documentation for valid values |
|
Match dest prefix component of flowspec prefix Choices:
|
|
Match entries of prefix-lists IP prefix-list name |
|
Match source prefix component of flowspec prefix Choices:
|
|
Match next-hop address of route |
|
Match entries of acl IP acl name/number Please refer vendor documentation for valid values |
|
Match entries of prefix-lists IP prefix-list name |
|
Set next-hop address Choices:
|
|
route redistribution source (EIGRP only) |
|
Match entries of acl IP acl name/number Please refer vendor documentation for valid values |
|
Match entries of prefix-lists IP prefix-list name |
|
Set redistribution-source Choices:
|
|
Match advertising source address of route |
|
Match entries of acl IP acl name/number Please refer vendor documentation for valid values |
|
Match entries of prefix-lists IP prefix-list name |
|
route redistribution source (EIGRP only) Choices:
|
|
Set redistribution-source Choices:
|
|
IPv6 specific information |
|
Match address of route or match packet |
|
IPv6 access-list name |
|
IPv6 prefix-list name |
|
Match next-hop address of route |
|
IPv6 access-list name |
|
Match dest prefix component of flowspec prefix Choices:
|
|
IPv6 prefix-list name |
|
Match source prefix component of flowspec prefix Choices:
|
|
Match next-hop address of route |
|
IPv6 access-list name |
|
IPv6 prefix-list name |
|
Match advertising source address of route |
|
IPv6 access-list name |
|
IPv6 prefix-list name |
|
Packet length |
|
Maximum packet length Please refer vendor documentation for valid values |
|
Minimum packet length Please refer vendor documentation for valid values |
|
Local preference for route |
|
Set the Local preference for route Choices:
|
|
Local preference value Please refer vendor documentation for valid values |
|
Match routes corresponding to MDT group |
|
IP access-list number/IP standard access-list name Please refer vendor documentation for valid values |
|
Set and Match routes corresponding to MDT group Choices:
|
|
Match metric of route |
|
Deviation option to match metric in a range Choices:
|
|
deviation value, 500 +- 10 creates the range 490 - 510 Please refer vendor documentation for valid values |
|
Match route using external protocol metric Choices:
|
|
Metric value Please refer vendor documentation for valid values |
|
Match routes which have MPLS labels Choices:
|
|
Match IP policy list |
|
Match route-type of route |
|
external route (BGP, EIGRP and OSPF type 1/2) |
|
Set external route Choices:
|
|
OSPF external type 1 route Choices:
|
|
OSPF external type 2 route Choices:
|
|
internal route (including OSPF intra/inter area) Choices:
|
|
IS-IS level-1 route Choices:
|
|
IS-IS level-2 route Choices:
|
|
locally generated route Choices:
|
|
nssa-external route (OSPF type 1/2) |
|
Set nssa-external route Choices:
|
|
OSPF external type 1 route Choices:
|
|
OSPF external type 2 route Choices:
|
|
Match RPKI state of route |
|
RPKI Invalid State Choices:
|
|
RPKI Not Found State Choices:
|
|
RPKI Valid State Choices:
|
|
Security Group |
|
Destination Security Group, destination Security tag Please refer vendor documentation for valid values |
|
Source Security Group, source Security tag Please refer vendor documentation for valid values |
|
Match source-protocol of route |
|
Border Gateway Protocol (BGP) Autonomous system number Please refer vendor documentation for valid values |
|
Connected Choices:
|
|
Enhanced Interior Gateway Routing Protocol (EIGRP) Autonomous system number Please refer vendor documentation for valid values |
|
ISO IS-IS Choices:
|
|
Locator ID Separation Protocol (LISP) Choices:
|
|
Mobile routes Choices:
|
|
Open Shortest Path First (OSPF) Process ID Please refer vendor documentation for valid values |
|
OSPFv3 Process ID Please refer vendor documentation for valid values |
|
Routing Information Protocol (RIP) Choices:
|
|
Static routes Choices:
|
|
Match tag of route |
|
Route Tag List/Tag list name |
|
Tag value/Tag in Dotted Decimal eg, 10.10.10.10 |
|
tracking object |
|
Sequence to insert to/delete from existing route-map entry Please refer vendor documentation for valid values |
|
Match source-protocol of route |
|
accumulated metric value |
|
metric value from rib Choices:
|
|
manual value |
|
Prepend string for a BGP AS-path attribute |
|
Prepend to the as-path |
|
AS number Please refer vendor documentation for valid values |
|
Prepend last AS to the as-path Number of last-AS prepends Please refer vendor documentation for valid values |
|
Set the tag as an AS-path attribute Choices:
|
|
Automatically compute TAG value Choices:
|
|
OSI summary address Next hop address CLNS summary prefix |
|
set BGP community list (for deletion) Community-list name/number Delete matching communities |
|
BGP community attribute |
|
Add to the existing community Choices:
|
|
Graceful Shutdown (well-known community) Choices:
|
|
Internet (well-known community) Choices:
|
|
Do not send outside local AS (well-known community) Choices:
|
|
Do not advertise to any peer (well-known community) Choices:
|
|
Do not export to next AS (well-known community) Choices:
|
|
No community attribute Choices:
|
|
community number community number in aa:nn format Please refer vendor documentation for valid values |
|
Set BGP route flap dampening parameters |
|
Maximum duration to suppress a stable route Please refer vendor documentation for valid values |
|
half-life time for the penalty Please refer vendor documentation for valid values |
|
Penalty to start reusing a route Please refer vendor documentation for valid values |
|
Penalty to start suppressing a route Please refer vendor documentation for valid values |
|
Set default information Default output interface |
|
Set BGP/VPN extended community list (for deletion) Extended community-list number/name Delete matching extended communities |
|
BGP extended community attribute |
|
Cost extended community |
|
Cost Value (No-preference Cost = 2147483647) Please refer vendor documentation for valid values |
|
Community ID Please refer vendor documentation for valid values |
|
Compare following IGP cost comparison Choices:
|
|
Compare before all other steps in bestpath calculation Choices:
|
|
Route Target extended community |
|
Add to the existing extcommunity Choices:
|
|
VPN extended community |
|
Specify a range of extended community |
|
VPN extended community |
|
VPN extended community |
|
Site-of-Origin extended community |
|
VPN Distinguisher |
|
Add to the existing extcommunity Choices:
|
|
VPN extended community |
|
Specify a range of extended community |
|
VPN extended community |
|
VPN extended community |
|
Set to global routing table Choices:
|
|
Output interface |
|
IP specific information |
|
Specify IP address Prefix-list name to set ip address |
|
Set DF bit Choices:
|
|
global routing table |
|
IP address of next hop |
|
Verify if nexthop is reachable |
|
IP address of next hop |
|
Sequence to insert into next-hop list Please refer vendor documentation for valid values |
|
Set the next hop depending on the state of a tracked object tracked object number Please refer vendor documentation for valid values |
|
Next hop address |
|
IP address of next hop |
|
application dynamically sets next hop DHCP learned next hop Choices:
|
|
Encapsulation profile for VPN nexthop L3VPN Encapsulation profile name |
|
Use peer address (for BGP only) Choices:
|
|
Recursive next-hop |
|
IP address of recursive next hop |
|
global routing table Choices:
|
|
VRF |
|
Use self address (for BGP only) Choices:
|
|
Verify if nexthop is reachable |
|
IP address of next hop |
|
Sequence to insert into next-hop list Please refer vendor documentation for valid values |
|
Set and Verify if nexthop is reachable Choices:
|
|
Set the next hop depending on the state of a tracked object tracked object number Please refer vendor documentation for valid values |
|
Set precedence field |
|
Set critical precedence (5) Choices:
|
|
Set flash precedence (3) Choices:
|
|
Set flash override precedence (4) Choices:
|
|
Set immediate precedence (2) Choices:
|
|
Set internetwork control precedence (6) Choices:
|
|
Set network control precedence (7) Choices:
|
|
Set priority precedence (1) Choices:
|
|
Set routine precedence (0) Choices:
|
|
Just set precedence field Choices:
|
|
Set QOS Group ID Please refer vendor documentation for valid values |
|
Set type of service field |
|
Set max reliable TOS (2) Choices:
|
|
Set max throughput TOS (4) Choices:
|
|
Set min delay TOS (8) Choices:
|
|
Set min monetary cost TOS (1) Choices:
|
|
Set normal TOS (0) Choices:
|
|
Just set type of service field Choices:
|
|
VRF |
|
IP address of next hop |
|
VRF name |
|
Verify if nexthop is reachable |
|
IP address of next hop |
|
Sequence to insert into next-hop list Please refer vendor documentation for valid values |
|
Set and Verify if nexthop is reachable Choices:
|
|
Set the next hop depending on the state of a tracked object tracked object number Please refer vendor documentation for valid values |
|
IPv6 specific information |
|
IPv6 address IPv6 prefix-list |
|
Set default information Choices:
|
|
global routing table |
|
Next hop address (X:X:X:X::X) |
|
Verify if nexthop is reachable |
|
Next hop address (X:X:X:X::X) |
|
Sequence to insert into next-hop list Please refer vendor documentation for valid values |
|
Set the next hop depending on the state of a tracked object tracked object number Please refer vendor documentation for valid values |
|
IPv6 Next hop |
|
Next hop address (X:X:X:X::X) |
|
Encapsulation profile for VPN nexthop L3VPN Encapsulation profile name |
|
Use peer address (for BGP only) Choices:
|
|
Recursive next-hop IPv6 address of recursive next-hop |
|
Set precedence field Precedence value Please refer vendor documentation for valid values |
|
VRF name |
|
VRF name |
|
Verify if nexthop is reachable |
|
IPv6 address of next hop |
|
Sequence to insert into next-hop list Please refer vendor documentation for valid values |
|
Set the next hop depending on the state of a tracked object tracked object number Please refer vendor documentation for valid values |
|
Where to import route |
|
Import into a level-1 area Choices:
|
|
Import into level-1 and level-2 Choices:
|
|
Import into level-2 sub-domain Choices:
|
|
Import only into OSPF NSSA areas and don’t propagate Choices:
|
|
Locator ID Separation Protocol specific information Specify a locator-set to use in LISP route-import The name of the locator set |
|
BGP local preference path attribute Please refer vendor documentation for valid values |
|
Metric value for destination routing protocol |
|
Add or subtract metric Choices:
|
|
EIGRP delay metric, in 10 microsecond units Please refer vendor documentation for valid values |
|
EIGRP Effective bandwidth metric (Loading) where 255 is 100 loaded Please refer vendor documentation for valid values |
|
EIGRP reliability metric where 255 is 100 reliable Please refer vendor documentation for valid values |
|
Metric value or Bandwidth in Kbits per second Please refer vendor documentation for valid values |
|
EIGRP MTU of the path Please refer vendor documentation for valid values |
|
Type of metric for destination routing protocol |
|
IS-IS external metric Choices:
|
|
IS-IS internal metric or Use IGP metric as the MED for BGP Choices:
|
|
OSPF external type 1 metric Choices:
|
|
OSPF external type 2 metric Choices:
|
|
Set MPLS label for prefix Choices:
|
|
BGP origin code |
|
local IGP Choices:
|
|
unknown heritage Choices:
|
|
Tag value for destination routing protocol Tag value A.B.C.D(dotted decimal format)/Tag value |
|
BGP traffic classification number for accounting Please refer vendor documentation for valid values |
|
Define VRF name VPN Routing/Forwarding instance name |
|
BGP weight for routing table Please refer vendor documentation for valid values |
|
Route map tag/name |
|
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 sh running-config | section ^route-map. 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 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
Examples
# Using deleted
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Delete provided Route maps config
cisco.ios.ios_route_maps:
config:
- route_map: test_1
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no route-map test_1"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^route-map
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
# Using deleted without any config passed (NOTE: This will delete all Route maps configuration from device)
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Delete all Route maps config
cisco.ios.ios_route_maps:
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no route-map test_1",
# "no route-map test_2"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^route-map
# router-ios#
# Using merged
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# router-ios#
- name: Merge provided Route maps configuration
cisco.ios.ios_route_maps:
config:
- route_map: test_1
entries:
- sequence: 10
action: deny
description: this is test route
match:
ip:
next_hop:
prefix_lists:
- test_1_new
- test_2_new
route_source:
acls:
- 10
security_group:
source:
- 10
- 20
local_preference:
value:
- 50
- 100
mpls_label: true
- sequence: 20
action: deny
continue_entry:
entry_sequence: 100
match:
additional_paths:
all: true
group_best: true
as_path:
acls:
- 100
- 200
ipv6:
address:
acl: test_acl_20
route_type:
level_1: true
tag:
tag_list:
- test_match_tag
track: 105
- route_map: test_2
entries:
- sequence: 10
action: deny
match:
ipv6:
address:
acl: test_ip_acl
next_hop:
prefix_list: test_new
route_source:
acl: route_src_acl
security_group:
source:
- 10
- 20
local_preference:
value:
- 55
- 105
mpls_label: true
set:
aigp_metric:
value: 100
automatic_tag: true
extcommunity:
cost:
id: 10
cost_value: 100
pre_bestpath: true
ip:
address: 192.0.2.1
df: 1
next_hop:
recursive:
global_route: true
address: 198.51.110.1
verify_availability:
address: 198.51.111.1
sequence: 100
track: 10
precedence:
critical: true
state: merged
# Commands Fired:
# ---------------
#
# "commands": [
# "route-map test_2 deny 10",
# "match security-group source tag 10 20",
# "match local-preference 55 105",
# "match mpls-label",
# "match ipv6 next-hop prefix-list test_new",
# "match ipv6 route-source route_src_acl",
# "match ipv6 address test_ip_acl",
# "set extcommunity cost pre-bestpath 10 100",
# "set ip df 1",
# "set ip next-hop recursive global 198.51.110.1",
# "set ip next-hop verify-availability 198.51.111.1 100 track 10",
# "set ip precedence critical",
# "set ip address prefix-list 192.0.2.1",
# "set automatic-tag",
# "set aigp-metric 100",
# "route-map test_1 deny 20",
# "continue 100",
# "match track 105",
# "match tag list test_match_tag",
# "match ipv6 address test_acl_20",
# "match route-type level-1",
# "match as-path 200 100",
# "match additional-paths advertise-set all group-best",
# "route-map test_1 deny 10",
# "description this is test route",
# "match security-group source tag 10 20",
# "match ip next-hop prefix-list test_2_new test_1_new",
# "match ip route-source 10",
# "match local-preference 100 50",
# "match mpls-label"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
# Using overridden
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Override provided Route maps configuration
cisco.ios.ios_route_maps:
config:
- route_map: test_1
entries:
- sequence: 10
action: deny
description: this is override route
match:
ip:
next_hop:
acls:
- 10
- test1_acl
flowspec:
dest_pfx: true
acls:
- test_acl_1
- test_acl_2
length:
minimum: 10
maximum: 100
metric:
value: 10
external: true
security_group:
source:
- 10
- 20
mpls_label: true
set:
extcommunity:
vpn_distinguisher:
address: 192.0.2.1:12
additive: true
metric:
metric_value: 100
deviation: plus
eigrp_delay: 100
metric_reliability: 10
metric_bandwidth: 20
mtu: 30
- route_map: test_override
entries:
- sequence: 10
action: deny
match:
ipv6:
address:
acl: test_acl
next_hop:
prefix_list: test_new
route_source:
acl: route_src_acl
security_group:
source:
- 15
- 20
local_preference:
value:
- 105
- 110
mpls_label: true
set:
aigp_metric:
value: 100
automatic_tag: true
extcommunity:
cost:
id: 10
cost_value: 100
pre_bestpath: true
ip:
address: 192.0.2.1
df: 1
next_hop:
recursive:
global_route: true
address: 198.110.51.1
verify_availability:
address: 198.110.51.2
sequence: 100
track: 10
precedence:
critical: true
state: overridden
# Commands Fired:
# ---------------
#
# "commands": [
# "no route-map test_2",
# "route-map test_override deny 10",
# "match security-group source tag 15 20",
# "match local-preference 110 105",
# "match mpls-label",
# "match ipv6 next-hop prefix-list test_new",
# "match ipv6 route-source route_src_acl",
# "match ipv6 address test_acl",
# "set extcommunity cost pre-bestpath 10 100",
# "set ip df 1",
# "set ip next-hop recursive global 198.110.51.1",
# "set ip next-hop verify-availability 198.110.51.2 100 track 10",
# "set ip precedence critical",
# "set ip address prefix-list 192.0.2.1",
# "set automatic-tag",
# "set aigp-metric 100",
# "route-map test_1 deny 10",
# "no description this is test route",
# "description this is override route",
# "match ip flowspec dest-pfx test_acl_1 test_acl_2",
# "no match ip next-hop prefix-list test_2_new test_1_new",
# "match ip next-hop test1_acl 10",
# "no match ip route-source 10",
# "match metric external 10",
# "match length 10 100",
# "no match local-preference 100 50",
# "set extcommunity vpn-distinguisher 192.0.2.1:12 additive",
# "set metric 100 +100 10 20 30",
# "no route-map test_1 deny 20"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_override deny 10
# match security-group source tag 15 20
# match local-preference 110 105
# match mpls-label
# match ipv6 address test_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.110.51.2 100 track 10
# set ip next-hop recursive global 198.110.51.1
# route-map test_1 deny 10
# description this is override route
# match ip flowspec dest-pfx test_acl_1 test_acl_2
# match ip next-hop test1_acl 10
# match security-group source tag 10 20
# match metric external 10
# match mpls-label
# match length 10 100
# set metric 100 +100 10 20 30
# set extcommunity vpn-distinguisher 192.0.2.1:12 additive
# Using replaced
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Replaced provided Route maps configuration
cisco.ios.ios_route_maps:
config:
- route_map: test_1
entries:
- sequence: 10
action: deny
description: this is replaced route
match:
ip:
next_hop:
acls:
- 10
- test1_acl
flowspec:
dest_pfx: true
acls:
- test_acl_1
- test_acl_2
length:
minimum: 10
maximum: 100
metric:
value: 10
external: true
security_group:
source:
- 10
- 20
mpls_label: true
set:
extcommunity:
vpn_distinguisher:
address: 192.0.2.1:12
additive: true
metric:
metric_value: 100
deviation: plus
eigrp_delay: 100
metric_reliability: 10
metric_bandwidth: 20
mtu: 30
- route_map: test_replaced
entries:
- sequence: 10
action: deny
match:
ipv6:
address:
acl: test_acl
next_hop:
prefix_list: test_new
route_source:
acl: route_src_acl
security_group:
source:
- 15
- 20
local_preference:
value:
- 105
- 110
mpls_label: true
set:
aigp_metric:
value: 100
automatic_tag: true
extcommunity:
cost:
id: 10
cost_value: 100
pre_bestpath: true
ip:
address: 192.0.2.1
df: 1
next_hop:
recursive:
global_route: true
address: 198.110.51.1
verify_availability:
address: 198.110.51.2
sequence: 100
track: 10
precedence:
critical: true
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "route-map test_replaced deny 10",
# "match security-group source tag 15 20",
# "match local-preference 110 105",
# "match mpls-label",
# "match ipv6 next-hop prefix-list test_new",
# "match ipv6 route-source route_src_acl",
# "match ipv6 address test_acl",
# "set extcommunity cost pre-bestpath 10 100",
# "set ip df 1",
# "set ip next-hop recursive global 198.110.51.1",
# "set ip next-hop verify-availability 198.110.51.2 100 track 10",
# "set ip precedence critical",
# "set ip address prefix-list 192.0.2.1",
# "set automatic-tag",
# "set aigp-metric 100",
# "route-map test_1 deny 10",
# "no description this is test route",
# "description this is replaced route",
# "match ip flowspec dest-pfx test_acl_1 test_acl_2",
# "no match ip next-hop prefix-list test_2_new test_1_new",
# "match ip next-hop test1_acl 10",
# "no match ip route-source 10",
# "match metric external 10",
# "match length 10 100",
# "no match local-preference 100 50",
# "set extcommunity vpn-distinguisher 192.0.2.1:12 additive",
# "set metric 100 +100 10 20 30",
# "no route-map test_1 deny 20"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_replaced deny 10
# match security-group source tag 15 20
# match local-preference 110 105
# match mpls-label
# match ipv6 address test_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.110.51.2 100 track 10
# set ip next-hop recursive global 198.110.51.1
# route-map test_1 deny 10
# description this is replaced route
# match ip flowspec dest-pfx test_acl_1 test_acl_2
# match ip next-hop test1_acl 10
# match security-group source tag 10 20
# match metric external 10
# match mpls-label
# match length 10 100
# set metric 100 +100 10 20 30
# set extcommunity vpn-distinguisher 192.0.2.1:12 additive
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
# Using Gathered
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Gather Route maps provided configurations
cisco.ios.ios_route_maps:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "entries": [
# {
# "action": "deny",
# "description": "this is test route",
# "match": {
# "ip": {
# "next_hop": {
# "prefix_lists": [
# "test_2_new",
# "test_1_new"
# ]
# },
# "route_source": {
# "acls": [
# "10"
# ]
# }
# },
# "local_preference": {
# "value": [
# "100",
# "50"
# ]
# },
# "mpls_label": true,
# "security_group": {
# "source": [
# 10,
# 20
# ]
# }
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_entry": {
# "entry_sequence": 100
# },
# "match": {
# "additional_paths": {
# "all": true,
# "group_best": true
# },
# "as_path": {
# "acls": [
# 200,
# 100
# ]
# },
# "ipv6": {
# "address": {
# "acl": "test_acl_20"
# }
# },
# "route_type": {
# "external": {
# "set": true
# },
# "level_1": true,
# "nssa_external": {
# "set": true
# }
# },
# "tag": {
# "tag_list": [
# "test_match_tag"
# ]
# },
# "track": 105
# },
# "sequence": 20
# }
# ],
# "route_map": "test_1"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "address": {
# "acl": "test_ip_acl"
# },
# "next_hop": {
# "prefix_list": "test_new"
# },
# "route_source": {
# "acl": "route_src_acl"
# }
# },
# "local_preference": {
# "value": [
# "55",
# "105"
# ]
# },
# "mpls_label": true,
# "security_group": {
# "source": [
# 10,
# 20
# ]
# }
# },
# "sequence": 10,
# "set": {
# "aigp_metric": {
# "value": 100
# },
# "automatic_tag": true,
# "extcommunity": {
# "cost": {
# "cost_value": 100,
# "id": "10",
# "pre_bestpath": true
# }
# },
# "ip": {
# "address": "192.0.2.1",
# "df": 1,
# "next_hop": {
# "recursive": {
# "address": "198.51.110.1",
# "global_route": true
# },
# "verify_availability": {
# "address": "198.51.111.1",
# "sequence": 100,
# "track": 10
# }
# },
# "precedence": {
# "critical": true
# }
# }
# }
# }
# ],
# "route_map": "test_2"
# }
# ]
# After state:
# ------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_route_maps:
config:
- route_map: test_1
entries:
- sequence: 10
action: deny
description: this is test route
match:
ip:
next_hop:
prefix_lists:
- test_1_new
- test_2_new
route_source:
acls:
- 10
security_group:
source:
- 10
- 20
local_preference:
value:
- 50
- 100
mpls_label: true
- sequence: 20
action: deny
continue_entry:
entry_sequence: 100
match:
additional_paths:
all: true
group_best: true
as_path:
acls:
- 100
- 200
ipv6:
address:
acl: test_acl_20
route_type:
level_1: true
tag:
tag_list:
- test_match_tag
track: 105
- route_map: test_2
entries:
- sequence: 10
action: deny
match:
ipv6:
address:
acl: test_ip_acl
next_hop:
prefix_list: test_new
route_source:
acl: route_src_acl
security_group:
source:
- 10
- 20
local_preference:
value:
- 55
- 105
mpls_label: true
set:
aigp_metric:
value: 100
automatic_tag: true
extcommunity:
cost:
id: 10
cost_value: 100
pre_bestpath: true
ip:
address: 192.0.2.1
df: 1
next_hop:
recursive:
global_route: true
address: 198.51.110.1
verify_availability:
address: 198.51.111.1
sequence: 100
track: 10
precedence:
critical: true
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "route-map test_2 deny 10",
# "match security-group source tag 10 20",
# "match local-preference 55 105",
# "match mpls-label",
# "match ipv6 next-hop prefix-list test_new",
# "match ipv6 route-source route_src_acl",
# "match ipv6 address test_ip_acl",
# "set extcommunity cost pre-bestpath 10 100",
# "set ip df 1",
# "set ip next-hop recursive global 198.51.110.1",
# "set ip next-hop verify-availability 198.51.111.1 100 track 10",
# "set ip precedence critical",
# "set ip address prefix-list 192.0.2.1",
# "set automatic-tag",
# "set aigp-metric 100",
# "route-map test_1 deny 20",
# "continue 100",
# "match track 105",
# "match tag list test_match_tag",
# "match ipv6 address test_acl_20",
# "match route-type level-1",
# "match as-path 200 100",
# "match additional-paths advertise-set all group-best",
# "route-map test_1 deny 10",
# "description this is test route",
# "match security-group source tag 10 20",
# "match ip next-hop prefix-list test_2_new test_1_new",
# "match ip route-source 10",
# "match local-preference 100 50",
# "match mpls-label"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_route_maps:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "entries": [
# {
# "action": "deny",
# "description": "this is test route",
# "match": {
# "ip": {
# "next_hop": {
# "prefix_lists": [
# "test_2_new",
# "test_1_new"
# ]
# },
# "route_source": {
# "acls": [
# "10"
# ]
# }
# },
# "local_preference": {
# "value": [
# "100",
# "50"
# ]
# },
# "mpls_label": true,
# "security_group": {
# "source": [
# 10,
# 20
# ]
# }
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_entry": {
# "entry_sequence": 100
# },
# "match": {
# "additional_paths": {
# "all": true,
# "group_best": true
# },
# "as_path": {
# "acls": [
# 200,
# 100
# ]
# },
# "ipv6": {
# "address": {
# "acl": "test_acl_20"
# }
# },
# "route_type": {
# "external": {
# "set": true
# },
# "level_1": true,
# "nssa_external": {
# "set": true
# }
# },
# "tag": {
# "tag_list": [
# "test_match_tag"
# ]
# },
# "track": 105
# },
# "sequence": 20
# }
# ],
# "route_map": "test_1"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "address": {
# "acl": "test_ip_acl"
# },
# "next_hop": {
# "prefix_list": "test_new"
# },
# "route_source": {
# "acl": "route_src_acl"
# }
# },
# "local_preference": {
# "value": [
# "55",
# "105"
# ]
# },
# "mpls_label": true,
# "security_group": {
# "source": [
# 10,
# 20
# ]
# }
# },
# "sequence": 10,
# "set": {
# "aigp_metric": {
# "value": 100
# },
# "automatic_tag": true,
# "extcommunity": {
# "cost": {
# "cost_value": 100,
# "id": "10",
# "pre_bestpath": true
# }
# },
# "ip": {
# "address": "192.0.2.1",
# "df": 1,
# "next_hop": {
# "recursive": {
# "address": "198.51.110.1",
# "global_route": true
# },
# "verify_availability": {
# "address": "198.51.111.1",
# "sequence": 100,
# "track": 10
# }
# },
# "precedence": {
# "critical": true
# }
# }
# }
# }
# ],
# "route_map": "test_2"
# }
# ]
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The resulting configuration model invocation. Returned: when changed Sample: |
|
The configuration prior to the model invocation. Returned: always Sample: |
|
The set of commands pushed to the remote device. Returned: always Sample: |