Skip to content

Latest commit

 

History

History
3648 lines (3551 loc) · 144 KB

arista.eos.eos_ospfv2_module.rst

File metadata and controls

3648 lines (3551 loc) · 144 KB

arista.eos.eos_ospfv2

OSPFv2 resource module

Version added: 1.0.0

  • This module configures and manages the attributes of ospfv2 on Arista EOS platforms.
Parameter Choices/Defaults Comments
config
dictionary
A list of configurations for ospfv2.
processes
list / elements=dictionary
A list of dictionary specifying the ospfv2 processes.
adjacency
dictionary
Configure adjacency options for OSPF instance.
exchange_start
dictionary
Configure exchange-start options for OSPF instance.
threshold
integer
Number of peers to bring up simultaneously.
areas
list / elements=dictionary
Specifies the configuration for OSPF areas
area_id
string
Specifies a 32 bit number expressed in decimal or dotted-decimal notation.
default_cost
integer
Specify the cost for default summary route in stub/NSSA area.
filter
dictionary
Specify the filter for incoming summary LSAs.
address
string
IP address.
prefix_list
string
Specify list to filter for incoming LSAs.
subnet_address
string
IP address with mask length
subnet_mask
string
IP subnet mask
not_so_stubby
dictionary
Configures NSSA parameters.
default_information_originate
dictionary
Originate default Type 7 LSA.
metric
integer
Metric for default route.
metric_type
integer
Metric type for default route.
nssa_only
boolean
    Choices:
  • no
  • yes
Limit default advertisement to this NSSA area.
lsa
boolean
    Choices:
  • no
  • yes
lsa parameters
no_summary
boolean
    Choices:
  • no
  • yes
Filter all type-3 LSAs in the nssa area.
nssa_only
boolean
    Choices:
  • no
  • yes
Disable Type-7 LSA p-bit setting
set
boolean
    Choices:
  • no
  • yes
Set config up to not-so-stubby
nssa
dictionary
Configures NSSA parameters.
default_information_originate
dictionary
Originate default Type 7 LSA.
metric
integer
Metric for default route.
metric_type
integer
Metric type for default route.
nssa_only
boolean
    Choices:
  • no
  • yes
Limit default advertisement to this NSSA area.
no_summary
boolean
    Choices:
  • no
  • yes
Filter all type-3 LSAs in the nssa area.
nssa_only
boolean
    Choices:
  • no
  • yes
Disable Type-7 LSA p-bit setting
set
boolean
    Choices:
  • no
  • yes
Set config up to nssa
range
dictionary
Configure route summarization.
address
string
IP address.
advertise
boolean
    Choices:
  • no
  • yes
Enable Advertisement of the range.
cost
integer
Configures the metric.
subnet_address
string
IP address with mask length
subnet_mask
string
IP subnet mask
stub
dictionary
Stub area.
no_summary
boolean
    Choices:
  • no
  • yes
If False , Filter all type-3 LSAs in the stub area.
set
boolean
    Choices:
  • no
  • yes
When true sets the stub config alone.
auto_cost
dictionary
Set auto-cost.
reference_bandwidth
integer
reference bandwidth in megabits per sec.
bfd
dictionary
Enable BFD.
all_interfaces
boolean
    Choices:
  • no
  • yes
Enable BFD on all interfaces.
default_information
dictionary
Control distribution of default information.
always
boolean
    Choices:
  • no
  • yes
Always advertise default route.
metric
integer
Metric for default route.
metric_type
integer
Metric type for default route.
originate
boolean
    Choices:
  • no
  • yes
Distribute a default route.
route_map
string
Specify which route-map to use.
default_metric
integer
Configure the default metric for redistributed routes
distance
dictionary
Specifies the administrative distance for routes.
external
integer
Routes external to the area
inter_area
integer
Routes from other areas
intra_area
integer
Routes with in an area
distribute_list
dictionary
Specifies the list of routes to be filtered.
prefix_list
string
prefix list to be filtered
route_map
string
route map to be filtered
dn_bit_ignore
boolean
    Choices:
  • no
  • yes
If true, Disable dn-bit check for Type-3 LSAs in non-default VRFs.
fips_restrictions
string
Use FIPS compliant algorithms
graceful_restart
dictionary
Enable graceful restart mode.
grace_period
integer
Specify maximum time to wait for graceful-restart to complete.
set
boolean
    Choices:
  • no
  • yes
When true sets the grace_fulrestart config alone.
graceful_restart_helper
boolean
    Choices:
  • no
  • yes
If true, Enable graceful restart helper.
log_adjacency_changes
dictionary
To configure link-state changes and transitions of OSPFv2 neighbors.
detail
boolean
    Choices:
  • no
  • yes
If true , configures the switch to log all link-state changes.
max_lsa
dictionary
Specifies the switch behavior on reaching max lsa count.
count
integer
maximum count of lsas.
ignore_count
integer
No. of times the switch can shut down temporarily on warning
ignore_time
integer
time in minutes, for which the switch shoud be shutdown on max-lsa warning
reset_time
integer
Time in minutes, after which the shutdown counter resets.
threshold
integer
percentage of <count> , when a warning should be raised.
warning
boolean
    Choices:
  • no
  • yes
Only give warning message when limit is exceeded
max_metric
dictionary
Set maximum metric.
router_lsa
dictionary
Maximum metric in self-originated router-LSAs.
external_lsa
dictionary
Override external-lsa metric with max-metric value.
max_metric_value
integer
Set max metric value for external LSAs.
set
boolean
    Choices:
  • no
  • yes
Set external-lsa attribute.
include_stub
boolean
    Choices:
  • no
  • yes
Set maximum metric for stub links in router-LSAs.
on_startup
dictionary
Set maximum metric temporarily after reboot.
wait_period
integer
Wait period in seconds after startup.
set
boolean
    Choices:
  • no
  • yes
Set router-lsa attribute.
summary_lsa
dictionary
Override summary-lsa metric with max-metric value.
max_metric_value
integer
Set max metric value for external LSAs.
set
boolean
    Choices:
  • no
  • yes
Set external-lsa attribute.
maximum_paths
integer
Maximum number of next-hops in an ECMP route.
mpls_ldp
boolean
    Choices:
  • no
  • yes
mpls ldp sync configuration.
networks
list / elements=dictionary
Configure routing for a network.
area
string
Configure OSPF area.
mask
string
Network Wildcard Mask.
network_address
string
Network Address.
prefix
string
Prefix.
passive_interface
dictionary
Include interface but without actively running OSPF.
default
boolean
    Choices:
  • no
  • yes
If true, Set all interfaces to passive by default
interface_list
string
Interface range.
point_to_point
boolean
    Choices:
  • no
  • yes
Configure Point-to-point specific features.
process_id
integer
ID of OSPFV2 process.
redistribute
list / elements=dictionary
Specifies the routes to be redistributed
isis_level
string
ISIS levels.
route_map
string
Specify which route map to use.
routes
string
Route types (BGP,isis,connected etc)
retransmission_threshold
integer
Configure threshold for retransmission.
rfc1583compatibility
boolean
    Choices:
  • no
  • yes
Specifies different methods for calculating summary route metrics.
router_id
string
32-bit number assigned to a router running OSPFv2.
shutdown
boolean
    Choices:
  • no
  • yes
Disable the OSPF instance.
summary_address
dictionary
Summary route configuration.
address
string
IP summary address.
attribute_map
string
Set attributes of summary route.
mask
string
Summary Mask.
not_advertise
boolean
    Choices:
  • no
  • yes
Do not advertise summary route.
prefix
string
Prefix.
tag
integer
Set tag.
timers
list / elements=dictionary
Configure OSPF timers.
lsa
dictionary
Configure OSPF LSA timers.
rx
dictionary
Configure OSPF LSA receiving timers
min_interval
integer
Configure OSPF LSA arrival timer.
tx
dictionary
Configure OSPF LSA transmission timers.
delay
dictionary
Configure OSPF LSA transmission delay.
initial
integer
Delay to generate first occurrence of LSA in msecs.
max
integer
Maximum delay between originating the same LSA in msecs.
min
integer
Min delay between originating the same LSA in msecs.
out_delay
integer
Configure out-delay timer.
pacing
integer
Configure OSPF packet pacing.
spf
dictionary
Configure SPF timers
initial
integer
Initial SPF schedule delay in msecs.
max
integer
Max wait time between two SPFs in msecs.
min
integer
Min Hold time between two SPFs in msecs
seconds
integer
Seconds.
throttle
dictionary
Configure throttle timers(valid only for eos version < 4.23).
attr
string
throttle attribute.
initial
integer
Initial schedule delay in msecs.
max
integer
Max wait time
min
integer
Min Hold time
traffic_engineering
boolean
    Choices:
  • no
  • yes
Enter traffic engineering config mode
vrf
string
VRF 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 ospf.
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.

Note

  • Tested against Arista EOS 4.24.6F
  • This module works with connection network_cli. See the EOS Platform Options.
# Using merged

# Before state:
# -------------
# localhost#show running-config | section ospf
# localhost#

- name: Merge provided config into running config
  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"

# Task output:
# ------------
#  before: {}

# commands
# - 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
# - exit
# - router ospf 2 vrf vrf01
# - area 0.0.0.9 default-cost 20
# - 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
# - exit
# - router ospf 2 vrf vrf01
# - area 0.0.0.9 default-cost 20
# - max-lsa  8000 40 ignore-count 3  ignore-time 6  reset-time 20
# - exit
# - router ospf 3 vrf vrf02
# - redistribute connected
# - exit
#
# after:
#     processes:
#     - adjacency:
#         exchange_start:
#           threshold: 20045623
#       areas:
#       - area_id: 0.0.0.2
#         filter:
#           address: 10.1.1.0/24
#       - area_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:
#       - area_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: 2
#       vrf: vrf01
#     - max_lsa:
#         count: 12000
#       process_id: 3
#       redistribute:
#       - routes: connected
#       vrf: vrf02

# 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

# 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
#
- 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

# Task output:
# ------------
# before:
#     processes:
#     - adjacency:
#         exchange_start:
#           threshold: 20045623
#       areas:
#       - area_id: 0.0.0.2
#         filter:
#           address: 10.1.1.0/24
#       - area_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:
#       - area_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: 2
#       vrf: vrf01
#     - max_lsa:
#         count: 12000
#       process_id: 3
#       redistribute:
#       - routes: connected
#       vrf: vrf02
#
# commands:
# - 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:
#       - area_id: 0.0.0.2
#         filter:
#           address: 10.1.1.0/24
#       - area_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

# 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
#    redistribute isis level-1
#    max-lsa 12000
# !
# router ospf 3 vrf vrf02
#    redistribute connected
#    max-lsa 12000

# 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

- name: override running config with provided config
  arista.eos.eos_ospfv2:
    config:
      - processes:
          - process_id: 2
            vrf: "vrf01"
            redistribute:
              - routes: "connected"
    state: overriden

# Task output:
# ------------

# before:
#     processes:
#     - adjacency:
#         exchange_start:
#           threshold: 20045623
#       areas:
#       - area_id: 0.0.0.2
#         filter:
#           address: 10.1.1.0/24
#       - area_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
#
# commands:
# - 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:
#       - isis_level: level-1
#         routes: isis
#       vrf: vrf01

# After state:
# ------------
# localhost#show running-config | section ospf
# router ospf 2 vrf vrf01
#    redistribute isis level-1
#    max-lsa 12000
# !

# Using deleted

# 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 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
#
- name: Delete OSPF config
  arista.eos.eos_ospfv2:
    config:
      processes:
        - process_id: 1
    state: deleted

# Task output:
# ------------
# before:
#     processes:
#     - adjacency:
#         exchange_start:
#           threshold: 20045623
#       areas:
#       - area_id: 0.0.0.2
#         filter:
#           address: 10.1.1.0/24
#       - area_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:
#       - area_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: 2
#       redistribute:
#       - routes: connected
#       vrf: vrf01
#     - max_lsa:
#         count: 12000
#       process_id: 3
#       redistribute:
#       - routes: connected
#       vrf: vrf02
#
# commands:
# - no router ospf 1
#
# after:
#     processes:
#     - areas:
#       - area_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: 2
#       redistribute:
#       - routes: connected
#       vrf: vrf01
#     - max_lsa:
#         count: 12000
#       process_id: 3
#       redistribute:
#       - routes: connected
#       vrf: vrf02

# After state:
# ------------
# 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

# 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

- name: replace Ospf configs
  arista.eos.eos_ospfv2:
    state: gathered

# Task output:
# ------------
# gathered:
#     processes:
#     - areas:
#       - area_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: 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 running config and display structured facts
  arista.eos.eos_ospfv2:
    running_config: "{{ lookup('file', './parsed.cfg') }}"
    state: parsed

# Task output:
# ------------
# parsed:
#     processes:
#     - adjacency:
#         exchange_start:
#           threshold: 20045623
#       areas:
#       - area_id: 0.0.0.2
#         filter:
#           address: 10.1.1.0/24
#       - area_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:
#       - area_id: 0.0.0.9
#         default_cost: 20
#       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"
              area_id: "0.0.0.2"
            - area_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:
            - area_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:
            - area_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"
    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
#   - exit
#   - router ospf 2 vrf vrf01
#   - area 0.0.0.9 default-cost 20
#   - 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
#   - exit
#   - router ospf 2 vrf vrf01
#   - area 0.0.0.9 default-cost 20
#   - max-lsa  8000 40 ignore-count 3  ignore-time 6  reset-time 20
#   - exit
#   - router ospf 3 vrf vrf02
#   - redistribute connected
#   - exit

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

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

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

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

Sample:
['router ospf 1', 'adjacency exchange-start threshold 20045623', 'area 0.0.0.2 filter 10.1.1.0/24']
gathered
dictionary
when state is gathered
Facts about the network resource gathered from the remote device as structured data.

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

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

Sample:
['router ospf 1', 'adjacency exchange-start threshold 20045623', 'area 0.0.0.2 filter 10.1.1.0/24']


Authors

  • Gomathi Selvi Srinivasan (@GomathiselviS)