arista.eos.eos_route_maps – Manages Route Maps resource module

Note

This plugin is part of the arista.eos collection (version 2.2.0).

To install it use: ansible-galaxy collection install arista.eos.

To use it in a playbook, specify: arista.eos.eos_route_maps.

New in version 2.1.0: of arista.eos

Synopsis

  • This module configures and manages the attributes of Route Mapd on Arista EOS platforms.

Note

This module has a corresponding action plugin.

Parameters

Parameter Choices/Defaults Comments
config
list / elements=dictionary
A list of route-map options
entries
list / elements=dictionary
Route Map entries.
action
string
    Choices:
  • deny
  • permit
Action for matching routes
continue_sequence
integer
Route map entry sequence number.
description
string
Description for the route map.
match
dictionary
Route map match rules.
aggregate_role
dictionary
Role in BGP contributor-aggregate relation.
contributor
boolean
    Choices:
  • no
  • yes
BGP aggregate's contributor.
route_map
string
Route map to apply against the aggregate route.
as
integer
BGP AS number.
as_path
dictionary
Set as-path.
length
string
Specify as-path length ( with comparison operators like <= 60 and >= 40 ).
path_list
string
AS path list name.
community
dictionary
BGP community attribute.
community_list
string
list of community names (in csv format).
exact_match
boolean
    Choices:
  • no
  • yes
Do exact matching of communities.
instances
string
Match number of community instances ( with comparison operators like <= 60 and >= 40 ).
extcommunity
dictionary
extended community list name.
community_list
string
list of community names (in csv format).
exact_match
boolean
    Choices:
  • no
  • yes
Do exact matching of communities.
interface
string
interface name.
invert_result
dictionary
Invert match result.
aggregate_role
dictionary
Role in BGP contributor-aggregate relation.
contributor
boolean
    Choices:
  • no
  • yes
BGP aggregate's contributor.
route_map
string
Route map to apply against the aggregate route.
as_path
dictionary
Set as-path.
length
string
Specify as-path length ( with comparison operators like <= 60 and >= 40 ).
path_list
string
AS path list name.
community
dictionary
BGP community attribute.
community_list
string
list of community names (in csv format).
exact_match
boolean
    Choices:
  • no
  • yes
Do exact matching of communities.
instances
string
Match number of community instances ( with comparison operators like <= 60 and >= 40 ).
extcommunity
dictionary
extended community list name.
community_list
string
list of community names (in csv format).
exact_match
boolean
    Choices:
  • no
  • yes
Do exact matching of communities.
large_community
dictionary
extended community list name.
community_list
string
list of community names (in csv format).
exact_match
boolean
    Choices:
  • no
  • yes
Do exact matching of communities.
ip
dictionary
Set IP specific information.
address
dictionary
next hop destination.
access_list
string
ip access-list.
dynamic
boolean
    Choices:
  • no
  • yes
Configure dynamic prefix-list.
prefix_list
string
Prefix list.
next_hop
string
next hop prefix list.
resolved_next_hop
string
Route resolved prefix list.
ipv6
dictionary
Set IPv6 specific information.
address
dictionary
next hop destination.
access_list
string
ip access-list.
dynamic
boolean
    Choices:
  • no
  • yes
Configure dynamic prefix-list.
prefix_list
string
Prefix list.
next_hop
string
next hop prefix list.
resolved_next_hop
string
Route resolved prefix list.
isis_level
string
IS-IS level.
large_community
dictionary
extended community list name.
community_list
string
list of community names (in csv format).
exact_match
boolean
    Choices:
  • no
  • yes
Do exact matching of communities.
local_preference
integer
BGP local preference.
metric
integer
Route metric.
metric_type
string
    Choices:
  • type-1
  • type-2
Route metric type.
route_type
string
Route type
router_id
string
Router ID.
source_protocol
string
Source routing protocol,
tag
integer
Route tag
sequence
integer
Index in the sequence.
set
dictionary
set route attributes.
as_path
dictionary
Set as-path.
match
dictionary
Match the entire as-path.
as_number
string
as number to use (includes auto;in csv format)
none
boolean
    Choices:
  • no
  • yes
Remove matching AS numbers
prepend
dictionary
Prepend to the as-path.
as_number
string
as number to prepend (includes auto;in csv format)
last_as
integer
The number of times to prepend the last AS number.
bgp
integer
BGP AS path multipath weight.
community_attributes
dictionary
BGP community attribute.
community
dictionary
community attributes.
additive
boolean
    Choices:
  • no
  • yes
Add to existing community.
delete
boolean
    Choices:
  • no
  • yes
Delete matching communities.
graceful_shutdown
boolean
    Choices:
  • no
  • yes
Gracefully shutdown.
internet
boolean
    Choices:
  • no
  • yes
Internet community
list
string
community list name.
local_as
boolean
    Choices:
  • no
  • yes
Do not send outside local AS.
no_advertise
boolean
    Choices:
  • no
  • yes
Do not advertise to any peer.
no_export
boolean
    Choices:
  • no
  • yes
Do not export to next AS.
number
string
community number (in csv format).
graceful_shutdown
boolean
    Choices:
  • no
  • yes
Graceful shutdown
none
boolean
    Choices:
  • no
  • yes
No community attribute.
distance
integer
Set protocol independent distance.
evpn
boolean
    Choices:
  • no
  • yes
Keep the next hop when advertising to eBGP peers.
extcommunity
dictionary
BGP extended community attribute.
lbw
dictionary
Link bandwith values.
aggregate
boolean
    Choices:
  • no
  • yes
Aggregate Link Bandwidth.
divide
string
    Choices:
  • equal
  • ration
Divide Link Bandwidth.
value
string
Link Bandwidth extended community value.
none
boolean
    Choices:
  • no
  • yes
No attribute.
rt
dictionary
Route target extended community
additive
boolean
    Choices:
  • no
  • yes
Add to the existing community.
delete
boolean
    Choices:
  • no
  • yes
Delete matching communities.
vpn
string
VPN extended community.
soo
dictionary
Site-of-Origin extended community.
additive
boolean
    Choices:
  • no
  • yes
Add to the existing community.
delete
boolean
    Choices:
  • no
  • yes
Delete matching communities.
vpn
string
VPN extended community.
ip
dictionary
Set IP specific information.
address
string
next hop address.
peer_address
boolean
    Choices:
  • no
  • yes
Use BGP peering addr as next-hop.
unchanged
boolean
    Choices:
  • no
  • yes
Keep the next hop when advertising to eBGP peer
ipv6
dictionary
Set IPv6 specific information.
address
string
next hop address.
peer_address
boolean
    Choices:
  • no
  • yes
Use BGP peering addr as next-hop.
unchanged
boolean
    Choices:
  • no
  • yes
Keep the next hop when advertising to eBGP peer
isis_level
string
IS-IS level.
local_preference
integer
BGP local preference.
metric
dictionary
Route metric.
add
string
    Choices:
  • igp-metric
  • igp-nexthop-cost
Add igp-metric / igp-nexthop-cost
igp_param
string
    Choices:
  • igp-metric
  • igp-nexthop-cost
IGP parameter
value
string
metric value to add or subtract(with +/- sign).
metric_type
string
    Choices:
  • type-1
  • type-2
Route metric type.
nexthop
dictionary
Route next hop.
max_metric
boolean
    Choices:
  • no
  • yes
Set IGP max metric value.
value
integer
IGP metric value.
origin
string
    Choices:
  • egp
  • igp
  • incomplete
Set bgp origin.
segment_index
integer
MPLS Segment-routing Segment Index.
tag
integer
Route tag
weight
integer
BGP weight.
source
dictionary
Rename/Copy configuration
action
string
    Choices:
  • rename
  • copy
rename or copy configuration
overwrite
boolean
    Choices:
  • no
  • yes
if True, overwrite existing config.
source_map_name
string
Source route map name.
statement
string
statement name
sub_route_map
dictionary
Sub route map
invert_result
boolean
    Choices:
  • no
  • yes
Invert sub route map result
name
string
sub route map name
route_map
string
Route map name.
running_config
string
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 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:
  • deleted
  • merged ←
  • overridden
  • replaced
  • gathered
  • rendered
  • parsed
The state the configuration should be left in.

Notes

Note

  • Tested against Arista EOS 4.23.0F

  • This module works with connection network_cli. See the EOS Platform Options.

Examples

# Using merged
# Before state
# 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"
#         }
#     ]

Authors

  • Gomathi Selvi Srinivasan (@GomathiselviS)