arista.eos.eos_route_maps module – Manages Route Maps resource module
Note
This module is part of the arista.eos collection (version 6.0.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_route_maps
.
New in arista.eos 2.1.0
Synopsis
This module configures and manages the attributes of Route Mapd on Arista EOS platforms.
Parameters
Parameter |
Comments |
---|---|
A list of route-map options |
|
Route Map entries. |
|
Action for matching routes Choices:
|
|
Route map entry sequence number. |
|
Description for the route map. |
|
Route map match rules. |
|
Role in BGP contributor-aggregate relation. |
|
BGP aggregate’s contributor. Choices:
|
|
Route map to apply against the aggregate route. |
|
BGP AS number. |
|
Set as-path. |
|
Specify as-path length ( with comparison operators like <= 60 and >= 40 ). |
|
AS path list name. |
|
BGP community attribute. |
|
list of community names (in csv format). |
|
Do exact matching of communities. Choices:
|
|
Match number of community instances ( with comparison operators like <= 60 and >= 40 ). |
|
extended community list name. |
|
list of community names (in csv format). |
|
Do exact matching of communities. Choices:
|
|
interface name. |
|
Invert match result. |
|
Role in BGP contributor-aggregate relation. |
|
BGP aggregate’s contributor. Choices:
|
|
Route map to apply against the aggregate route. |
|
Set as-path. |
|
Specify as-path length ( with comparison operators like <= 60 and >= 40 ). |
|
AS path list name. |
|
BGP community attribute. |
|
list of community names (in csv format). |
|
Do exact matching of communities. Choices:
|
|
Match number of community instances ( with comparison operators like <= 60 and >= 40 ). |
|
extended community list name. |
|
list of community names (in csv format). |
|
Do exact matching of communities. Choices:
|
|
extended community list name. |
|
list of community names (in csv format). |
|
Do exact matching of communities. Choices:
|
|
Set IP specific information. |
|
next hop destination. |
|
ip access-list. |
|
Configure dynamic prefix-list. Choices:
|
|
Prefix list. |
|
next hop prefix list. |
|
Route resolved prefix list. |
|
Set IPv6 specific information. |
|
next hop destination. |
|
ip access-list. |
|
Configure dynamic prefix-list. Choices:
|
|
Prefix list. |
|
next hop prefix list. |
|
Route resolved prefix list. |
|
IS-IS level. |
|
extended community list name. |
|
list of community names (in csv format). |
|
Do exact matching of communities. Choices:
|
|
BGP local preference. |
|
Route metric. |
|
Route metric type. Choices:
|
|
Route type |
|
Router ID. |
|
Source routing protocol, |
|
Route tag |
|
Index in the sequence. |
|
set route attributes. |
|
Set as-path. |
|
Match the entire as-path. |
|
as number to use (includes auto;in csv format) |
|
Remove matching AS numbers Choices:
|
|
Prepend to the as-path. |
|
as number to prepend (includes auto;in csv format) |
|
The number of times to prepend the last AS number. |
|
BGP AS path multipath weight. |
|
BGP community attribute. |
|
community attributes. |
|
Add to existing community. Choices:
|
|
Delete matching communities. Choices:
|
|
Gracefully shutdown. Choices:
|
|
Internet community Choices:
|
|
community list name. |
|
Do not send outside local AS. Choices:
|
|
Do not advertise to any peer. Choices:
|
|
Do not export to next AS. Choices:
|
|
community number (in csv format). |
|
Graceful shutdown Choices:
|
|
No community attribute. Choices:
|
|
Set protocol independent distance. |
|
Keep the next hop when advertising to eBGP peers. Choices:
|
|
BGP extended community attribute. |
|
Link bandwith values. |
|
Aggregate Link Bandwidth. Choices:
|
|
Divide Link Bandwidth. Choices:
|
|
Link Bandwidth extended community value. |
|
No attribute. Choices:
|
|
Route target extended community |
|
Add to the existing community. Choices:
|
|
Delete matching communities. Choices:
|
|
VPN extended community. |
|
Site-of-Origin extended community. |
|
Add to the existing community. Choices:
|
|
Delete matching communities. Choices:
|
|
VPN extended community. |
|
Set IP specific information. |
|
next hop address. |
|
Use BGP peering addr as next-hop. Choices:
|
|
Keep the next hop when advertising to eBGP peer Choices:
|
|
Set IPv6 specific information. |
|
next hop address. |
|
Use BGP peering addr as next-hop. Choices:
|
|
Keep the next hop when advertising to eBGP peer Choices:
|
|
IS-IS level. |
|
BGP local preference. |
|
Route metric. |
|
Add igp-metric / igp-nexthop-cost Choices:
|
|
IGP parameter Choices:
|
|
metric value to add or subtract(with +/- sign). |
|
Route metric type. Choices:
|
|
Route next hop. |
|
Set IGP max metric value. Choices:
|
|
IGP metric value. |
|
Set bgp origin. Choices:
|
|
MPLS Segment-routing Segment Index. |
|
Route tag |
|
BGP weight. |
|
Rename/Copy configuration |
|
rename or copy configuration Choices:
|
|
if True, overwrite existing config. Choices:
|
|
Source route map name. |
|
statement name |
|
Sub route map |
|
Invert sub route map result Choices:
|
|
sub route map name |
|
Route map name. |
|
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 | section route-map. The state parsed reads the configuration from |
|
The state the configuration should be left in. Choices:
|
Notes
Note
Tested against Arista EOS 4.24.6F
This module works with connection
network_cli
. See the EOS Platform Options.
Examples
# Using merged
# Before state
# veos#show running-config | section route-map
# veos#
- name: Merge provided configuration with device configuration
arista.eos.eos_route_maps:
config:
- route_map: "mapmerge"
entries:
- description: "merged_map"
action: "permit"
sequence: 10
match:
router_id: 22
- description: "newmap"
action: "deny"
sequence: 25
continue_sequence: 45
match:
interface: "Ethernet1"
- route_map: "mapmerge2"
entries:
- sub_route_map:
name: "mapmerge"
action: "deny"
sequence: 45
set:
metric:
value: 25
add: "igp-metric"
as_path:
prepend:
last_as: 2
match:
ipv6:
resolved_next_hop: "list1"
state: merged
# After State:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# description merged_map
# match router-id prefix-list 22
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# !
# route-map test permit 10
# veos#
# Module Execution:
# "after": [
# {
# "entries": [
# {
# "action": "permit",
# "description": "merged_map",
# "match": {
# "router_id": "22"
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_sequence": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ],
# "before": {},
# "changed": true,
# "commands": [
# "route-map mapmerge permit 10",
# "match router-id prefix-list 22",
# "description merged_map",
# "route-map mapmerge deny 25",
# "match interface Ethernet1",
# "description newmap",
# "continue 45",
# "route-map mapmerge2 deny 45",
# "match ipv6 resolved-next-hop prefix-list list1",
# "set metric 25 +igp-metric",
# "set as-path prepend last-as 2",
# "sub-route-map mapmerge"
# ],
#
# Using replaced:
# Before State:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# description merged_map
# match router-id prefix-list 22
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# !
# veos#
- name: Replace
arista.eos.eos_route_maps:
config:
- route_map: "mapmerge"
entries:
- action: "permit"
sequence: 10
match:
ipv6:
resolved_next_hop: "listr"
- action: "deny"
sequence: 90
set:
extcommunity:
rt:
vpn: "22:11"
delete: True
ip:
unchanged: True
state: replaced
# After State:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# match ipv6 resolved-next-hop prefix-list listr
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge deny 90
# set ip next-hop unchanged
# set extcommunity rt 22:11 delete
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# !
#
# Module Execution:
#
# "after": [
# {
# "entries": [
# {
# "action": "permit",
# "match": {
# "ipv6": {
# "resolved_next_hop": "listr"
# }
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_sequence": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# },
# {
# "action": "deny",
# "sequence": 90,
# "set": {
# "extcommunity": {
# "rt": {
# "delete": true,
# "vpn": "22:11"
# }
# },
# "ip": {
# "unchanged": true
# }
# }
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# },
# {
# "entries": [
# {
# "action": "permit",
# "sequence": 10
# }
# ],
# "route_map": "test"
# }
# ],
# "before": [
# {
# "entries": [
# {
# "action": "permit",
# "description": "merged_map",
# "match": {
# "router_id": "22"
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_sequence": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ],
# "changed": true,
# "commands": [
# "route-map mapmerge permit 10",
# "match ipv6 resolved-next-hop prefix-list listr",
# "no match router-id prefix-list 22",
# "no description",
# "route-map mapmerge deny 90",
# "set extcommunity rt 22:11 delete",
# "set ip next-hop unchanged"
# ],
#
#
# Using Overridden:
# Before state:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# match ipv6 resolved-next-hop prefix-list listr
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge deny 90
# set ip next-hop unchanged
# set extcommunity rt 22:11 delete
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# !
# route-map test permit 10
# veos#
- name: Override
arista.eos.eos_route_maps:
config:
- route_map: "mapmerge"
entries:
- action: "permit"
sequence: 10
match:
ipv6:
resolved_next_hop: "listr"
- action: "deny"
sequence: 90
set:
metric:
igp_param: "igp-nexthop-cost"
state: overridden
# After State:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# match ipv6 resolved-next-hop prefix-list listr
# !
# route-map mapmerge deny 90
# set metric igp-nexthop-cost
# veos#
#
#
# "after": [
# {
# "entries": [
# {
# "action": "permit",
# "match": {
# "ipv6": {
# "resolved_next_hop": "listr"
# }
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "sequence": 90,
# "set": {
# "metric": {
# "igp_param": "igp-nexthop-cost"
# }
# }
# }
# ],
# "route_map": "mapmerge"
# }
# ],
# "before": [
# {
# "entries": [
# {
# "action": "permit",
# "match": {
# "ipv6": {
# "resolved_next_hop": "listr"
# }
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_sequence": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# },
# {
# "action": "deny",
# "sequence": 90,
# "set": {
# "extcommunity": {
# "rt": {
# "delete": true,
# "vpn": "22:11"
# }
# },
# "ip": {
# "unchanged": true
# }
# }
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# },
# {
# "entries": [
# {
# "action": "permit",
# "sequence": 10
# }
# ],
# "route_map": "test"
# }
# ],
# "changed": true,
# "commands": [
# "no route-map mapmerge deny 25",
# "no route-map mapmerge2 deny 45",
# "no route-map test permit 10",
# "route-map mapmerge deny 90",
# "set metric igp-nexthop-cost",
# "no set ip next-hop unchanged",
# "no set extcommunity rt 22:11 delete"
# ],
#
# Using deleted:
# Before State:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# description merged_map
# match router-id prefix-list 22
# match ipv6 resolved-next-hop prefix-list listr
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge deny 90
# set metric igp-nexthop-cost
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# veos#
- name: Delete route-map
arista.eos.eos_route_maps:
config:
- route_map: "mapmerge"
state: deleted
become: yes
tags:
- deleted1
# After State:
# veos#show running-config | section route-map
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# veos#
#
# Module Execution:
#
# "after": [
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ],
# "before": [
# {
# "entries": [
# {
# "action": "permit",
# "description": "merged_map",
# "match": {
# "ipv6": {
# "resolved_next_hop": "listr"
# },
# "router_id": "22"
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# },
# {
# "action": "deny",
# "sequence": 90,
# "set": {
# "metric": {
# "igp_param": "igp-nexthop-cost"
# }
# }
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ],
# "changed": true,
# "commands": [
# "no route-map mapmerge"
# ],
# Using deleted to delete all route-maps:
# Before State:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# description merged_map
# match router-id prefix-list 22
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# veos#
- name: Delete all route-maps
arista.eos.eos_route_maps:
state: deleted
# After State:
# veos#show running-config | section route-map
# veos#
#
# Module Execution:
#
# "after": {},
# "before": [
# {
# "entries": [
# {
# "action": "permit",
# "description": "merged_map",
# "match": {
# "router_id": "22"
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ],
# "changed": true,
# "commands": [
# "no route-map mapmerge",
# "no route-map mapmerge2"
# ],
# Using gathered:
# Device configs:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# description merged_map
# match router-id prefix-list 22
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# veos#
- name: gather configs
arista.eos.eos_route_maps:
state: gathered
# Module Execution:
# "gathered": [
# {
# "entries": [
# {
# "action": "permit",
# "description": "merged_map",
# "match": {
# "router_id": "22"
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_sequence": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ],
# Using rendered:
- name: Render provided configuration
arista.eos.eos_route_maps:
config:
- route_map: "mapmerge"
entries:
- description: "merged_map"
action: "permit"
sequence: 10
match:
router_id: 22
set:
bgp: 20
- description: "newmap"
action: "deny"
sequence: 25
continue_sequence: 45
match:
interface: "Ethernet1"
- route_map: "mapmerge2"
entries:
- sub_route_map:
name: "mapmerge"
action: "deny"
sequence: 45
set:
metric:
value: 25
add: "igp-metric"
as_path:
prepend:
last_as: 2
match:
ipv6:
resolved_next_hop: "list1"
state: rendered
# Module Execution:
# "rendered": [
# "route-map mapmerge permit 10",
# "match router-id prefix-list 22",
# "set bgp bestpath as-path weight 20",
# "description merged_map",
# "route-map mapmerge deny 25",
# "match interface Ethernet1",
# "description newmap",
# "continue 45",
# "route-map mapmerge2 deny 45",
# "match ipv6 resolved-next-hop prefix-list list1",
# "set metric 25 +igp-metric",
# "set as-path prepend last-as 2",
# "sub-route-map mapmerge"
# ]
# Using parsed:
# parsed.cfg
# route-map mapmerge permit 10
# description merged_map
# match router-id prefix-list 22
# set bgp bestpath as-path weight 20
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
- name: parse configs
arista.eos.eos_route_maps:
running_config: "{{ lookup('file', './parsed.cfg') }}"
state: parsed
# Module Execution:
# "parsed": [
# {
# "entries": [
# {
# "action": "permit",
# "description": "merged_map",
# "match": {
# "router_id": "22"
# },
# "sequence": 10,
# "set": {
# "bgp": 20
# }
# },
# {
# "action": "deny",
# "continue_sequence": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ]