arista.eos.eos_ospfv2 – OSPFv2 resource module¶
Note
This plugin is part of the arista.eos collection (version 1.3.0).
To install it use: ansible-galaxy collection install arista.eos
.
To use it in a playbook, specify: arista.eos.eos_ospfv2
.
New in version 1.0.0: of arista.eos
Synopsis¶
This module configures and manages the attributes of ospfv2 on Arista EOS platforms.
Note
This module has a corresponding action plugin.
Parameters¶
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:
# ------------
# localhost#show running-config | section ospf
# localhost#
- name: replace Ospf configs
arista.eos.eos_ospfv2:
config:
- processes:
- process_id: 1
adjacency:
exchange_start:
threshold: 20045623
areas:
- filter:
address: "10.1.1.0/24"
id: "0.0.0.2"
- id: "0.0.0.50"
range:
address: "172.20.0.0/16"
cost: 34
default_information:
metric: 100
metric_type: 1
originate: True
distance:
intra_area: 85
max_lsa:
count: 8000
ignore_count: 3
ignore_time: 6
reset_time: 20
threshold: 40
networks:
- area: "0.0.0.0"
prefix: 10.10.2.0/24
- area: "0.0.0.0"
prefix: "10.10.3.0/24"
redistribute:
- routes: "static"
router_id: "170.21.0.4"
- process_id: 2
vrf: "vrf01"
areas:
- id: "0.0.0.9"
default_cost: 20
max_lsa:
count: 8000
ignore_count: 3
ignore_time: 6
reset_time: 20
threshold: 40
networks:
- area: "0.0.0.0"
prefix: 10.10.2.0/24
- area: "0.0.0.0"
prefix: "10.10.3.0/24"
redistribute:
- routes: "static"
router_id: "170.21.0.4"
- process_id: 2
vrf: "vrf01"
areas:
- id: "0.0.0.9"
default_cost: 20
max_lsa:
count: 8000
ignore_count: 3
ignore_time: 6
reset_time: 20
threshold: 40
- process_id: 3
vrf: "vrf02"
redistribute:
- routes: "connected"
# After state:
# localhost#show running-config | section ospf
# router ospf 1
# router-id 170.21.0.4
# distance ospf intra-area 85
# redistribute static
# area 0.0.0.2 filter 10.1.1.0/24
# area 0.0.0.50 range 172.20.0.0/16 cost 34
# network 10.10.2.0/24 area 0.0.0.0
# network 10.10.3.0/24 area 0.0.0.0
# max-lsa 8000 40 ignore-time 6 ignore-count 3 reset-time 20
# adjacency exchange-start threshold 20045623
# default-information originate metric 100 metric-type 1
#
# router ospf 2 vrf vrf01
# area 0.0.0.9 default-cost 20
# max-lsa 8000 40 ignore-time 6 ignore-count 3 reset-time 20
# !
# router ospf 3 vrf vrf02
# redistribute connected
# max-lsa 12000
# localhost#
#
# "processes": [
# {
# "adjacency": {
# "exchange_start": {
# "threshold": 20045623
# }
# },
# "areas": [
# {
# "filter": {
# "address": "10.1.1.0/24"
# },
# "id": "0.0.0.2"
# },
# {
# "id": "0.0.0.50",
# "range": {
# "address": "172.20.0.0/16",
# "cost": 34
# }
# }
# ],
# "default_information": {
# "metric": 100,
# "metric_type": 1,
# "originate": true
# },
# "distance": {
# "intra_area": 85
# },
# "max_lsa": {
# "count": 8000,
# "ignore_count": 3,
# "ignore_time": 6,
# "reset_time": 20,
# "threshold": 40
# },
# "networks": [
# {
# "area": "0.0.0.0",
# "prefix": "10.10.2.0/24"
# },
# {
# "area": "0.0.0.0",
# "prefix": "10.10.3.0/24"
# }
# ],
# "process_id": 1,
# "redistribute": [
# {
# "routes": "static"
# }
# ],
# "router_id": "170.21.0.4"
# },
# {
# "areas": [
# {
# "default_cost": 20,
# "id": "0.0.0.9"
# }
# ],
# "max_lsa": {
# "count": 8000,
# "ignore_count": 3,
# "ignore_time": 6,
# "reset_time": 20,
# "threshold": 40
# },
# "process_id": 2,
# "vrf": "vrf01"
# },
# {
# "max_lsa": {
# "count": 12000
# },
# "process_id": 3,
# "redistribute": [
# {
# "routes": "connected"
# }
# ],
# "vrf": "vrf02"
# }
# ]
# }
# ]
#
# Using replaced:
# --------------
# Before State:
# localhost#show running-config | section ospf
# router ospf 1
# router-id 170.21.0.4
# distance ospf intra-area 85
# redistribute static
# area 0.0.0.2 filter 10.1.1.0/24
# area 0.0.0.50 range 172.20.0.0/16 cost 34
# network 10.10.2.0/24 area 0.0.0.0
# network 10.10.3.0/24 area 0.0.0.0
# max-lsa 8000 40 ignore-time 6 ignore-count 3 reset-time 20
# adjacency exchange-start threshold 20045623
# default-information originate metric 100 metric-type 1
# !
# router ospf 2 vrf vrf01
# area 0.0.0.9 default-cost 20
# max-lsa 8000 40 ignore-time 6 ignore-count 3 reset-time 20
# !
# router ospf 3 vrf vrf02
# redistribute connected
# max-lsa 12000
# localhost#
#
# "before": [
# {
# "processes": [
# {
# "adjacency": {
# "exchange_start": {
# "threshold": 20045623
# }
# },
# "areas": [
# {
# "filter": {
# "address": "10.1.1.0/24"
# },
# "id": "0.0.0.2"
# },
# {
# "id": "0.0.0.50",
# "range": {
# "address": "172.20.0.0/16",
# "cost": 34
# }
# }
# ],
# "default_information": {
# "metric": 100,
# "metric_type": 1,
# "originate": true
# },
# "distance": {
# "intra_area": 85
# },
# "max_lsa": {
# "count": 8000,
# "ignore_count": 3,
# "ignore_time": 6,
# "reset_time": 20,
# "threshold": 40
# },
# "networks": [
# {
# "area": "0.0.0.0",
# "prefix": "10.10.2.0/24"
# },
# {
# "area": "0.0.0.0",
# "prefix": "10.10.3.0/24"
# }
# ],
# "process_id": 1,
# "redistribute": [
# {
# "routes": "static"
# }
# ],
# "router_id": "170.21.0.4"
# },
# {
# "areas": [
# {
# "default_cost": 20,
# "id": "0.0.0.9"
# }
# ],
# "max_lsa": {
# "count": 8000,
# "ignore_count": 3,
# "ignore_time": 6,
# "reset_time": 20,
# "threshold": 40
# },
# "process_id": 2,
# "vrf": "vrf01"
# },
# {
# "max_lsa": {
# "count": 12000
# },
# "process_id": 3,
# "redistribute": [
# {
# "routes": "connected"
# }
# ],
# "vrf": "vrf02"
# }
# ]
# }
# ]
#
- name: replace Ospf configs
arista.eos.eos_ospfv2:
config:
- processes:
- process_id: 2
vrf: "vrf01"
point_to_point: True
redistribute:
- routes: "isis"
isis_level: "level-1"
state: replaced
# After State:
# -----------
# "router ospf 2 vrf vrf01",
# "no area 0.0.0.9 default-cost 20",
# "no max-lsa 8000 40 ignore-time 6 ignore-count 3 reset-time 20",
# "point-to-point routes",
# "redistribute isis level-1"
#
# "after": [
# {
# "processes": [
# {
# "adjacency": {
# "exchange_start": {
# "threshold": 20045623
# }
# },
# "areas": [
# {
# "filter": {
# "address": "10.1.1.0/24"
# },
# "id": "0.0.0.2"
# },
# {
# "id": "0.0.0.50",
# "range": {
# "address": "172.20.0.0/16",
# "cost": 34
# }
# }
# ],
# "default_information": {
# "metric": 100,
# "metric_type": 1,
# "originate": true
# },
# "distance": {
# "intra_area": 85
# },
# "max_lsa": {
# "count": 8000,
# "ignore_count": 3,
# "ignore_time": 6,
# "reset_time": 20,
# "threshold": 40
# },
# "networks": [
# {
# "area": "0.0.0.0",
# "prefix": "10.10.2.0/24"
# },
# {
# "area": "0.0.0.0",
# "prefix": "10.10.3.0/24"
# }
# ],
# "process_id": 1,
# "redistribute": [
# {
# "routes": "static"
# }
# ],
# "router_id": "170.21.0.4"
# },
# {
# "max_lsa": {
# "count": 12000
# },
# "process_id": 2,
# "redistribute": [
# {
# "isis_level": "level-1",
# "routes": "isis"
# }
# ],
# "vrf": "vrf01"
# },
# {
# "max_lsa": {
# "count": 12000
# },
# "process_id": 3,
# "redistribute": [
# {
# "routes": "connected"
# }
# ],
# "vrf": "vrf02"
# }
# ]
# }
# ]
#
# Using overridden:
# ----------------
# Before State:
# localhost#show running-config | section ospf
# router ospf 1
# router-id 170.21.0.4
# distance ospf intra-area 85
# redistribute static
# area 0.0.0.2 filter 10.1.1.0/24
# area 0.0.0.50 range 172.20.0.0/16 cost 34
# network 10.10.2.0/24 area 0.0.0.0
# network 10.10.3.0/24 area 0.0.0.0
# max-lsa 8000 40 ignore-time 6 ignore-count 3 reset-time 20
# adjacency exchange-start threshold 20045623
# default-information originate metric 100 metric-type 1
# !
# router ospf 2 vrf vrf01
# redistribute isis level-1
# max-lsa 12000
# !
# router ospf 3 vrf vrf02
# redistribute connected
# max-lsa 12000
# localhost#
#
# "before": [
# {
# "processes": [
# {
# "adjacency": {
# "exchange_start": {
# "threshold": 20045623
# }
# },
# "areas": [
# {
# "filter": {
# "address": "10.1.1.0/24"
# },
# "id": "0.0.0.2"
# },
# {
# "id": "0.0.0.50",
# "range": {
# "address": "172.20.0.0/16",
# "cost": 34
# }
# }
# ],
# "default_information": {
# "metric": 100,
# "metric_type": 1,
# "originate": true
# },
# "distance": {
# "intra_area": 85
# },
# "max_lsa": {
# "count": 8000,
# "ignore_count": 3,
# "ignore_time": 6,
# "reset_time": 20,
# "threshold": 40
# },
# "networks": [
# {
# "area": "0.0.0.0",
# "prefix": "10.10.2.0/24"
# },
# {
# "area": "0.0.0.0",
# "prefix": "10.10.3.0/24"
# }
# ],
# "process_id": 1,
# "redistribute": [
# {
# "routes": "static"
# }
# ],
# "router_id": "170.21.0.4"
# },
# {
# "max_lsa": {
# "count": 12000
# },
# "process_id": 2,
# "redistribute": [
# {
# "isis_level": "level-1",
# "routes": "isis"
# }
# ],
# "vrf": "vrf01"
# },
# {
# "max_lsa": {
# "count": 12000
# },
# "process_id": 3,
# "redistribute": [
# {
# "routes": "connected"
# }
# ],
# "vrf": "vrf02"
# }
# ]
# }
# ]
- name: override Ospf configs
arista.eos.eos_ospfv2:
config:
- processes:
- process_id: 2
vrf: "vrf01"
redistribute:
- routes: "connected"
state: override
# After State:
# "no router ospf 1",
# "no router ospf 3",
# "router ospf 2 vrf vrf01",
# "no max-lsa 12000",
# "no redistribute isis level-1",
# "redistribute connected"
#
# "after": [
# {
# "processes": [
# {
# "max_lsa": {
# "count": 12000
# },
# "process_id": 2,
# "redistribute": [
# {
# "routes": "connected"
# }
# ],
# "vrf": "vrf01"
# }
# ]
# }
# ]
# Using Deleted:
# localhost#show running-config | section ospf
# router ospf 1
# router-id 170.21.0.4
# distance ospf intra-area 85
# redistribute static
# area 0.0.0.2 filter 10.1.1.0/24
# area 0.0.0.50 range 172.20.0.0/16 cost 34
# network 10.10.2.0/24 area 0.0.0.0
# network 10.10.3.0/24 area 0.0.0.0
# max-lsa 8000 40 ignore-time 6 ignore-count 3 reset-time 20
# adjacency exchange-start threshold 20045623
# default-information originate metric 100 metric-type 1
# !
# router ospf 2 vrf vrf01
# redistribute connected
# area 0.0.0.9 default-cost 20
# max-lsa 8000 40 ignore-time 6 ignore-count 3 reset-time 20
# !
# router ospf 3 vrf vrf02
# redistribute connected
# max-lsa 12000
# localhost#
#
# "before": [
# {
# "processes": [
# {
# "adjacency": {
# "exchange_start": {
# "threshold": 20045623
# }
# },
# "areas": [
# {
# "filter": {
# "address": "10.1.1.0/24"
# },
# "id": "0.0.0.2"
# },
# {
# "id": "0.0.0.50",
# "range": {
# "address": "172.20.0.0/16",
# "cost": 34
# }
# }
# ],
# "default_information": {
# "metric": 100,
# "metric_type": 1,
# "originate": true
# },
# "distance": {
# "intra_area": 85
# },
# "max_lsa": {
# "count": 8000,
# "ignore_count": 3,
# "ignore_time": 6,
# "reset_time": 20,
# "threshold": 40
# },
# "networks": [
# {
# "area": "0.0.0.0",
# "prefix": "10.10.2.0/24"
# },
# {
# "area": "0.0.0.0",
# "prefix": "10.10.3.0/24"
# }
# ],
# "process_id": 1,
# "redistribute": [
# {
# "routes": "static"
# }
# ],
# "router_id": "170.21.0.4"
# },
# {
# "areas": [
# {
# "default_cost": 20,
# "id": "0.0.0.9"
# }
# ],
# "max_lsa": {
# "count": 8000,
# "ignore_count": 3,
# "ignore_time": 6,
# "reset_time": 20,
# "threshold": 40
# },
# "process_id": 2,
# "redistribute": [
# {
# "routes": "connected"
# }
# ],
# "vrf": "vrf01"
# },
# {
# "max_lsa": {
# "count": 12000
# },
# "process_id": 3,
# "redistribute": [
# {
# "routes": "connected"
# }
# ],
# "vrf": "vrf02"
# }
# ]
# }
# ]
- name: Delete Ospf configs
arista.eos.eos_ospfv2:
config:
- processes:
- process_id: 1
state: deleted
# After State:
# Commands:
# "no router ospf 1"
# "after": [
# {
# "processes": [
# {
# "areas": [
# {
# "default_cost": 20,
# "id": "0.0.0.9"
# }
# ],
# "max_lsa": {
# "count": 8000,
# "ignore_count": 3,
# "ignore_time": 6,
# "reset_time": 20,
# "threshold": 40
# },
# "process_id": 2,
# "redistribute": [
# {
# "routes": "connected"
# }
# ],
# "vrf": "vrf01"
# },
# {
# "max_lsa": {
# "count": 12000
# },
# "process_id": 3,
# "redistribute": [
# {
# "routes": "connected"
# }
# ],
# "vrf": "vrf02"
# }
# ]
# }
# ]
# Using gathered:
# localhost#show running-config | section ospf
# router ospf 2 vrf vrf01
# redistribute connected
# area 0.0.0.9 default-cost 20
# max-lsa 8000 40 ignore-time 6 ignore-count 3 reset-time 20
# !
# router ospf 3 vrf vrf02
# redistribute connected
# max-lsa 12000
# localhost#
- name: replace Ospf configs
arista.eos.eos_ospfv2:
state: gathered
# "gathered": [
# {
# "processes": [
# {
# "areas": [
# {
# "default_cost": 20,
# "id": "0.0.0.9"
# }
# ],
# "max_lsa": {
# "count": 8000,
# "ignore_count": 3,
# "ignore_time": 6,
# "reset_time": 20,
# "threshold": 40
# },
# "process_id": 2,
# "redistribute": [
# {
# "routes": "connected"
# }
# ],
# "vrf": "vrf01"
# },
# {
# "max_lsa": {
# "count": 12000
# },
# "process_id": 3,
# "redistribute": [
# {
# "routes": "connected"
# }
# ],
# "vrf": "vrf02"
# }
# ]
# }
# ]
# Using parsed:
# ------------
# parsed.cfg
# router ospf 1
# adjacency exchange-start threshold 20045623
# area 0.0.0.2 filter 10.1.1.0/24
# area 0.0.0.50 range 172.20.0.0/16 cost 34
# default-information originate metric 100 metric-type 1
# distance ospf intra-area 85
# max-lsa 80000 40 ignore-count 3 ignore-time 6 reset-time 20
# network 10.10.2.0/24 area 0.0.0.0
# network 10.10.3.0/24 area 0.0.0.0
# redistribute static
# router-id 170.21.0.4
# router ospf 2 vrf vrf01,
# area 0.0.0.9 default-cost 20
# max-lsa 80000 40 ignore-count 3 ignore-time 6 reset-time 20
# router ospf 3 vrf vrf02
# redistribute static
- name: Parse Ospf configs
arista.eos.eos_ospfv2:
running_config: "{{ lookup('file', './parsed.cfg') }}"
state: parsed
# "parsed": [
# {
# "processes": [
# {
# "adjacency": {
# "exchange_start": {
# "threshold": 20045623
# }
# },
# "areas": [
# {
# "filter": {
# "address": "10.1.1.0/24"
# },
# "id": "0.0.0.2"
# },
# {
# "id": "0.0.0.50",
# "range": {
# "address": "172.20.0.0/16",
# "cost": 34
# }
# }
# ],
# "default_information": {
# "metric": 100,
# "metric_type": 1,
# "originate": true
# },
# "distance": {
# "intra_area": 85
# },
# "max_lsa": {
# "count": 80000,
# "ignore_count": 3,
# "ignore_time": 6,
# "reset_time": 20,
# "threshold": 40
# },
# "networks": [
# {
# "area": "0.0.0.0",
# "prefix": "10.10.2.0/24"
# },
# {
# "area": "0.0.0.0",
# "prefix": "10.10.3.0/24"
# }
# ],
# "process_id": 1,
# "redistribute": [
# {
# "routes": "static"
# }
# ],
# "router_id": "170.21.0.4"
# },
# {
# "areas": [
# {
# "default_cost": 20,
# "id": "0.0.0.9"
# }
# ],
# "max_lsa": {
# "count": 80000,
# "ignore_count": 3,
# "ignore_time": 6,
# "reset_time": 20,
# "threshold": 40
# },
# "process_id": 2,
# "vrf": "vrf01,"
# },
# {
# "process_id": 3,
# "redistribute": [
# {
# "routes": "static"
# }
# ],
# "vrf": "vrf02"
# }
# ]
# }
# ]
# Using rendered:
# --------------
- name: replace Ospf configs
arista.eos.eos_ospfv2:
config:
- processes:
- process_id: 1
adjacency:
exchange_start:
threshold: 20045623
areas:
- filter:
address: 10.1.1.0/24
id: 0.0.0.2
- id: 0.0.0.50
range:
address: 172.20.0.0/16
cost: 34
default_information:
metric: 100
metric_type: 1
originate: true
distance:
intra_area: 85
max_lsa:
count: 8000
ignore_count: 3
ignore_time: 6
reset_time: 20
threshold: 40
networks:
- area: 0.0.0.0
prefix: 10.10.2.0/24
- area: 0.0.0.0
prefix: 10.10.3.0/24
redistribute:
- routes: static
router_id: 170.21.0.4
state: rendered
# "rendered": [
# "router ospf 1",
# "adjacency exchange-start threshold 20045623",
# "area 0.0.0.2 filter 10.1.1.0/24",
# "area 0.0.0.50 range 172.20.0.0/16 cost 34",
# "default-information originate metric 100 metric-type 1",
# "distance ospf intra-area 85",
# "max-lsa 8000 40 ignore-count 3 ignore-time 6 reset-time 20",
# "network 10.10.2.0/24 area 0.0.0.0",
# "network 10.10.3.0/24 area 0.0.0.0",
# "redistribute static",
# "router-id 170.21.0.4"
# ]
#
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Gomathi Selvi Srinivasan (@GomathiselviS)