cisco.ios.ios_ospfv2 module – Resource module to configure OSPFv2.
Note
This module is part of the cisco.ios collection (version 8.0.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install cisco.ios
.
To use it in a playbook, specify: cisco.ios.ios_ospfv2
.
New in cisco.ios 1.0.0
Synopsis
This module configures and manages the Open Shortest Path First (OSPF) version 2 on IOS platforms.
Aliases: ospfv2
Parameters
Parameter |
Comments |
---|---|
A dictionary of OSPF options. |
|
List of OSPF instance configurations. |
|
Router Address Family configuration mode |
|
Set a command to its defaults Choices:
|
|
Modify snmp parameters Configure SNMP context name |
|
Associate the routing protocol to a topology instance |
|
Entering router topology sub mode Choices:
|
|
Routing topology instance name |
|
Configuring the routing protocol topology tid Note, please refer vendor documentation for valid values Choices:
|
|
To configure control adjacency formation |
|
Maximum number of adjacencies allowed to be forming Please refer vendor documentation for valid values |
|
Initial number of adjacencies allowed to be forming in an area Please refer vendor documentation for valid values |
|
No initial Choices:
|
|
OSPF area parameters |
|
OSPF area ID as a decimal value. Please refer vendor documentation of Valid values. OSPF area ID in IP address format(e.g. A.B.C.D) |
|
Area authentication |
|
Enable area authentication Choices:
|
|
Use IPsec authentication Choices:
|
|
Enable area specific capability Enable exclusion of links from base topology Choices:
|
|
Set the summary default-cost of a NSSA/stub area Stub’s advertised external route metric Note, please refer vendor documentation for respective valid values |
|
Filter networks between OSPF areas |
|
The direction to apply on the filter networks sent to and from this area. Choices:
|
|
Name of an IP prefix-list |
|
Specify a NSSA area |
|
Originate Type 7 default into NSSA area |
|
OSPF default metric |
|
OSPF metric type for default routes OSPF Link State type Choices:
|
|
Limit default advertisement to this NSSA area Choices:
|
|
Do not send domain specific capabilities into NSSA Choices:
|
|
No redistribution into this NSSA area Choices:
|
|
Do not send summary LSA into NSSA Choices:
|
|
Enable a NSSA area Choices:
|
|
Translate LSA Always translate LSAs on this ABR Suppress forwarding address in translated LSAs Choices:
|
|
Summarize routes matching address/mask (border routers only) |
|
IP address to match |
|
Advertise this range (default) Since, advertise when enabled is not shown in running-config idempotency won’t be maintained for the play in the second or next run of the play. Choices:
|
|
User specified metric for this range |
|
IP mask for address |
|
DoNotAdvertise this range Choices:
|
|
Define a sham link and its parameters |
|
Associate a cost with the sham-link Cost of the sham-link Note, please refer vendor documentation for respective valid values |
|
IP addr associated with sham-link destination (A.B.C.D) |
|
IP addr associated with sham-link source (A.B.C.D) |
|
TTL security check Maximum number of IP hops allowed |
|
Specify a stub area Backbone can not be configured as stub area |
|
Do not send domain specific capabilities into stub area Choices:
|
|
Do not send summary LSA into stub area Choices:
|
|
Enable a stub area Choices:
|
|
Calculate OSPF interface cost according to bandwidth |
|
Use reference bandwidth method to assign OSPF cost Note, refer vendor documentation for respective valid values |
|
Enable OSPF auto-cost Choices:
|
|
BFD configuration commands Enable BFD on all interfaces Choices:
|
|
Enable specific OSPF feature |
|
Link-local Signaling (LLS) support Choices:
|
|
Opaque LSA Choices:
|
|
Transit Area Choices:
|
|
Do not perform PE specific checks Choices:
|
|
OSPF router compatibility list |
|
compatible with RFC 1583 Choices:
|
|
compatible with RFC 1587 Choices:
|
|
supports DBD exchange optimization Choices:
|
|
Control distribution of default information |
|
Always advertise default route Choices:
|
|
OSPF default metric Note, refer vendor documentation for respective valid values |
|
OSPF metric type for default routes Note, please refer vendor documentation for respective valid range |
|
Distribute a default route Choices:
|
|
Route-map reference name |
|
Set metric of redistributed routes |
|
Enable or disable discard-route installation |
|
Discard route for redistributed summarised routes Administrative distance for redistributed summarised routes Note, please refer vendor documentation for respective valid range |
|
Discard route for summarised internal routes Administrative distance for summarised internal routes Note, please refer vendor documentation for respective valid range |
|
Enable discard-route installation Choices:
|
|
Define an administrative distance |
|
OSPF Administrative distance |
|
Access-list name/number |
|
IP Source address |
|
Administrative distance |
|
Wildcard bits |
|
OSPF distance |
|
External type 5 and type 7 routes |
|
Inter-area routes |
|
Intra-area routes |
|
Filter networks in routing updates |
|
IP access list |
|
Filter incoming and outgoing routing updates. Choices:
|
|
Interface configuration (GigabitEthernet A/B) Valid with incoming traffic |
|
IP access list name/number |
|
Protocol config (bgp 1). Valid with outgoing traffic |
|
Filter prefixes in routing updates |
|
Filter incoming and outgoing routing updates. Choices:
|
|
Gateway name for filtering incoming updates based on gateway |
|
Interface configuration (GigabitEthernet A/B) Valid with incoming traffic |
|
Name of an IP prefix-list |
|
Protocol config (bgp 1). Valid with outgoing traffic |
|
Filter prefixes in routing updates |
|
Route-map name |
|
OSPF domain-id |
|
IP address |
|
OSPF domain ID in IP address format |
|
Secondary Domain-ID Choices:
|
|
Null Domain-ID Choices:
|
|
OSPF domain-tag which is OSPF domain tag - 32-bit value Note, please refer vendor documentation for respective valid range |
|
Event Logging |
|
Enable event Logging Choices:
|
|
Disable Logging When Log Buffer Becomes Full Choices:
|
|
Pause Event Logging Choices:
|
|
Maximum Number of Events Stored in the Event Log Note, refer vendor documentation for respective valid values |
|
Description of the interactive help system Choices:
|
|
Do not complain about specific event Do not complain upon receiving LSA of the specified type, MOSPF Type 6 LSA Choices:
|
|
Source of the interface ID SNMP MIB ifIndex Choices:
|
|
Enable incremental SPF computation Choices:
|
|
Limit a specific OSPF feature and LS update, DBD, and LS request retransmissions |
|
Demand circuit retransmissions |
|
Disble the feature Choices:
|
|
The maximum number of retransmissions |
|
Non-demand-circuit retransmissions |
|
Disble the feature Choices:
|
|
The maximum number of retransmissions |
|
Enable or disable usage of local RIB as route criteria |
|
Enable usage of local RIB as route criteria Choices:
|
|
Local RIB used to validate external/NSSA forwarding addresses Choices:
|
|
Local RIB used as criteria for inter-area summaries Choices:
|
|
Local RIB used as criteria for NSSA translation Choices:
|
|
Log changes in adjacency state |
|
Log all state changes Choices:
|
|
Log changes in adjacency state Choices:
|
|
Maximum number of non self-generated LSAs to accept |
|
Maximum number of times adjacencies can be suppressed Note, refer vendor documentation for respective valid values |
|
Number of minutes during which all adjacencies are suppressed Note, refer vendor documentation for respective valid values |
|
Maximum number of non self-generated LSAs to accept Note, refer vendor documentation for respective valid values |
|
Number of minutes after which ignore-count is reset to zero Note, refer vendor documentation for respective valid values |
|
Threshold value (%) at which to generate a warning msg Note, refer vendor documentation for respective valid values |
|
Only give a warning message when limit is exceeded Choices:
|
|
Set maximum metric |
|
Override external-lsa metric with max-metric value Overriding metric in external-LSAs Note, refer vendor documentation for respective valid values |
|
Set maximum metric for stub links in router-LSAs Choices:
|
|
Set maximum metric temporarily after reboot |
|
Time, in seconds, router-LSAs are originated with max-metric Note, please refer vendor documentation for respective valid range |
|
Let BGP decide when to originate router-LSA with normal metric Choices:
|
|
Maximum metric in self-originated router-LSAs Choices:
|
|
Override summary-lsa metric with max-metric value Note, please refer vendor documentation for respective valid range |
|
Forward packets over multiple paths Number of paths |
|
Configure MPLS routing protocol parameters |
|
routing protocol commands for MPLS LDP |
|
routing protocol commands for MPLS LDP |
|
Configure an OSPF area to run MPLS LDP |
|
Configure LDP automatic configuration and set the config Choices:
|
|
Configure LDP-IGP Synchronization Choices:
|
|
Let BGP decide when to originate router-LSA with normal metric |
|
Configure an ospf area to run MPLS Traffic Engineering OSPF area ID as a decimal value or in IP address format |
|
MPLS TE autoroute exclude Filter prefixes based on name of an IP prefix-list |
|
MPLS TE interface configuration for this OSPF process |
|
Advertise MPLS TE information for this interface into area OSPF area ID as a decimal value |
|
TE Interface configuration (GigabitEthernet A/B) |
|
Traffic Engineering Mesh-Group advertisement |
|
configure flooding scope as area |
|
Mesh Group Id |
|
Interface configuration (GigabitEthernet A/B) |
|
MPLS TE and PIM interaction Choices:
|
|
Router Interface configuration (GigabitEthernet A/B) |
|
Specify a neighbor router |
|
Neighbor address (A.B.C.D) |
|
OSPF cost for point-to-multipoint neighbor metric Note, please refer vendor documentation for respective valid range |
|
Filter OSPF LSA during synchronization and flooding for point-to-multipoint neighbor Filter all outgoing LSA Choices:
|
|
OSPF dead-router polling interval of non-broadcast neighbor in Seconds |
|
OSPF priority of non-broadcast neighbor priority |
|
Enable routing on an IP network |
|
Network number |
|
Set the OSPF area ID |
|
OSPF wild card bits |
|
Non-stop forwarding |
|
Cisco Non-stop forwarding |
|
disable helper support Choices:
|
|
helper support Choices:
|
|
IETF graceful restart |
|
disable helper support Choices:
|
|
helper support Choices:
|
|
enable helper strict LSA checking Choices:
|
|
Suppress routing updates on an interface (GigabitEthernet A/B) Interface name with respective interface number passive_interface param is DEPRECATED and a newer param passive_interfaces with added functionality’s is introduced, this attribute will be removed after 2026-07-18. |
|
Suppress routing updates on an interface |
|
Suppress routing updates on all interfaces Choices:
|
|
Suppress/Un-Suppress routing updates on interface |
|
Name of interface (GigabitEthernet A/B) |
|
Suppress/Un-Suppress routing updates Choices:
|
|
Enable prefix suppression Choices:
|
|
OSPF topology priority Note, refer vendor documentation for respective valid values |
|
Process ID |
|
Hello/Router process queue depth |
|
OSPF Hello process queue depth |
|
maximum number of packets in the queue |
|
Unlimited queue depth Choices:
|
|
OSPF Router process queue depth |
|
maximum number of packets in the queue |
|
Unlimited queue depth Choices:
|
|
Router-id address for this OSPF process OSPF router-id in IP address format (A.B.C.D) |
|
Shutdown the router process Choices:
|
|
Configure IP address summaries |
|
IP summary address |
|
IP Summary mask |
|
Do not advertise or translate Choices:
|
|
Limit summary to NSSA areas Choices:
|
|
Set tag |
|
Adjust routing timers |
|
OSPF LSA timers, arrival timer The minimum interval in milliseconds between accepting the same LSA Note, refer vendor documentation for respective valid values |
|
OSPF pacing timers |
|
OSPF flood pacing timer The minimum interval in msec to pace limit flooding on interface Note, refer vendor documentation for respective valid values |
|
OSPF LSA group pacing timer Interval in sec between group of LSA being refreshed or maxaged Note, refer vendor documentation for respective valid values |
|
OSPF retransmission pacing timer The minimum interval in msec between neighbor retransmissions Note, refer vendor documentation for respective valid values |
|
OSPF throttle timers |
|
OSPF LSA throttle timers |
|
Delay to generate first occurrence of LSA in milliseconds Note, refer vendor documentation for respective valid values |
|
Maximum delay between originating the same LSA in milliseconds Note, refer vendor documentation for respective valid values |
|
Minimum delay between originating the same LSA in milliseconds Note, refer vendor documentation for respective valid values |
|
OSPF SPF throttle timers - Delay between receiving a change to SPF calculation in milliseconds - Note, refer vendor documentation for respective valid values |
|
Delay between first and second SPF calculation in milliseconds Note, refer vendor documentation for respective valid values |
|
Maximum wait time in milliseconds for SPF calculations Note, refer vendor documentation for respective valid values |
|
Delay between receiving a change to SPF calculation in milliseconds Note, refer vendor documentation for respective valid values |
|
How to compute traffic share over alternate paths All traffic shared among min metric paths Use different interfaces for equal-cost paths Choices:
|
|
TTL security check |
|
Maximum number of IP hops allowed Note, refer vendor documentation for respective valid values |
|
Enable TTL Security on all interfaces Choices:
|
|
Specify parameters for a VPN Routing/Forwarding instance |
|
This option is used only with state parsed. The value of this option should be the output received from the IOS device by executing the command sh running-config | section ^router ospf. The state parsed reads the configuration from |
|
The state the configuration should be left in The states rendered, gathered and parsed does not perform any change on the device. The state rendered will transform the configuration in The state gathered will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the gathered key within the result. The state parsed reads the configuration from Choices:
|
Notes
Note
Tested against Cisco IOSXE Version 17.3 on CML.
This module works with connection
network_cli
. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html
Examples
# Using merged
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router-ios#
- name: Merge provided OSPF V2 configuration
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 1
max_metric:
router_lsa: true
on_startup:
time: 110
areas:
- area_id: "5"
capability: true
authentication:
enable: true
- area_id: "10"
authentication:
message_digest: true
nssa:
default_information_originate:
metric: 10
translate: suppress-fa
default_cost: 10
filter_list:
- name: test_prefix_in
direction: in
- name: test_prefix_out
direction: out
network:
- address: 198.51.100.0
wildcard_bits: 0.0.0.255
area: 5
default_information:
originate: true
passive_interfaces:
default: true
interface:
set_interface: false
name:
- GigabitEthernet0/1
- GigabitEthernet0/2
- process_id: 200
vrf: blue
domain_id:
ip_address:
address: 192.0.3.1
max_metric:
router_lsa: true
on_startup:
time: 100
auto_cost:
reference_bandwidth: 4
areas:
- area_id: "10"
capability: true
distribute_list:
acls:
- name: 10
direction: out
- name: 123
direction: in
state: merged
# Task Output:
# ------------
# before: {}
# commands:
# - router ospf 200 vrf blue
# - auto-cost reference-bandwidth 4
# - domain-id 192.0.3.1
# - max-metric router-lsa on-startup 100
# - area 10 capability default-exclusion
# - distribute-list 10 out
# - distribute-list 123 in
# - router ospf 1
# - default-information originate
# - max-metric router-lsa on-startup 110
# - area 5 capability default-exclusion
# - area 10 authentication message-digest
# - area 10 default-cost 10
# - area 10 nssa default-information-originate metric 10
# - area 10 nssa translate type7 suppress-fa
# - area 10 filter-list prefix test_prefix_in in
# - area 10 filter-list prefix test_prefix_out out
# - network 198.51.100.0 0.0.0.255 area 5
# - passive-interface default
# - no passive-interface GigabitEthernet0/1
# - no passive-interface GigabitEthernet0/2
# after:
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
# - areas:
# - area_id: '5'
# capability: true
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: in
# name: test_prefix_in
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# passive_interfaces:
# default: true
# interface:
# name:
# - GigabitEthernet2
# - GigabitEthernet1
# set_interface: false
# process_id: 1
# After state:
# ------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 5 capability default-exclusion
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_in in
# area 10 filter-list prefix test_prefix_out out
# passive-interface default
# no passive-interface GigabitEthernet1
# no passive-interface GigabitEthernet2
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
# Using replaced
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 5 capability default-exclusion
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_in in
# area 10 filter-list prefix test_prefix_out out
# passive-interface default
# no passive-interface GigabitEthernet1
# no passive-interface GigabitEthernet2
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Replace running config with provided OSPF V2 configuration
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 200
vrf: blue
domain_id:
ip_address:
address: 192.0.4.1
max_metric:
router_lsa: true
on_startup:
time: 200
maximum_paths: 15
ttl_security:
hops: 7
areas:
- area_id: "10"
default_cost: 10
authentication:
message_digest: true
- process_id: 100
vrf: ospf_vrf
domain_id:
ip_address:
address: 192.0.5.1
auto_cost:
reference_bandwidth: 5
areas:
- area_id: "5"
authentication:
message_digest: true
nssa:
default_information_originate:
metric: 10
translate: suppress-fa
state: replaced
# Task Output:
# ------------
#
# before:
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
# - areas:
# - area_id: '5'
# capability: true
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: in
# name: test_prefix_in
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# passive_interfaces:
# default: true
# interface:
# name:
# - GigabitEthernet2
# - GigabitEthernet1
# set_interface: false
# process_id: 1
#
# commands:
# - router ospf 100 vrf ospf_vrf
# - auto-cost reference-bandwidth 5
# - domain-id 192.0.5.1
# - area 5 authentication message-digest
# - area 5 nssa translate type7 suppress-fa
# - area 5 nssa default-information-originate metric 10
# - router ospf 200 vrf blue
# - no auto-cost reference-bandwidth 4
# - no distribute-list 10 out
# - no distribute-list 123 in
# - domain-id 192.0.4.1
# - max-metric router-lsa on-startup 200
# - maximum-paths 15
# - ttl-security all-interfaces hops 7
# - area 10 authentication message-digest
# - no area 10 capability default-exclusion
# - area 10 default-cost 10
# ]
#
# after:
# processes:
# - areas:
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# domain_id:
# ip_address:
# address: 192.0.4.1
# max_metric:
# on_startup:
# time: 200
# router_lsa: true
# maximum_paths: 15
# process_id: 200
# ttl_security:
# hops: 7
# vrf: blue
# - areas:
# - area_id: '5'
# authentication:
# message_digest: true
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# auto_cost:
# reference_bandwidth: 5
# set: true
# domain_id:
# ip_address:
# address: 192.0.5.1
# process_id: 100
# vrf: ospf_vrf
# - areas:
# - area_id: '5'
# authentication:
# enable: true
# capability: true
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: in
# name: test_prefix_in
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# process_id: 1
# After state:
# -------------
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.4.1
# max-metric router-lsa on-startup 200
# ttl-security all-interfaces hops 7
# area 10 authentication message-digest
# area 10 default-cost 10
# maximum-paths 15
# router ospf 100 vrf ospf_vrf
# domain-id 192.0.5.1
# auto-cost reference-bandwidth 5
# area 5 authentication message-digest
# area 5 nssa default-information-originate metric 10
# area 5 nssa translate type7 suppress-fa
# router ospf 1
# max-metric router-lsa on-startup 110
# area 5 capability default-exclusion
# area 5 authentication
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_in in
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
# Using overridden
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Override provided OSPF V2 configuration
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 200
vrf: blue
domain_id:
ip_address:
address: 192.0.4.1
max_metric:
router_lsa: true
on_startup:
time: 200
maximum_paths: 15
ttl_security:
hops: 7
areas:
- area_id: "10"
default_cost: 10
authentication:
message_digest: true
- process_id: 100
vrf: ospf_vrf
domain_id:
ip_address:
address: 192.0.5.1
auto_cost:
reference_bandwidth: 5
areas:
- area_id: "5"
authentication:
message_digest: true
nssa:
default_information_originate:
metric: 10
translate: suppress-fa
state: overridden
# Task Output:
# ------------
# before:
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
# - areas:
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# process_id: 1
#
# commands:
# - no router ospf 1
# - router ospf 100 vrf ospf_vrf
# - auto-cost reference-bandwidth 5
# - domain-id 192.0.5.1
# - area 5 authentication message-digest
# - area 5 nssa translate type7 suppress-fa
# - area 5 nssa default-information-originate metric 10
# - router ospf 200 vrf blue
# - no auto-cost reference-bandwidth 4
# - no distribute-list 10 out
# - no distribute-list 123 in
# - domain-id 192.0.4.1
# - max-metric router-lsa on-startup 200
# - maximum-paths 15
# - ttl-security all-interfaces hops 7
# - area 10 authentication message-digest
# - no area 10 capability default-exclusion
# - area 10 default-cost 10
#
# after:
# processes:
# - areas:
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# domain_id:
# ip_address:
# address: 192.0.4.1
# max_metric:
# on_startup:
# time: 200
# router_lsa: true
# maximum_paths: 15
# process_id: 200
# ttl_security:
# hops: 7
# vrf: blue
# - areas:
# - area_id: '5'
# authentication:
# message_digest: true
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# auto_cost:
# reference_bandwidth: 5
# set: true
# domain_id:
# ip_address:
# address: 192.0.5.1
# process_id: 100
# vrf: ospf_vrf
#
# After state:
# ------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.4.1
# max-metric router-lsa on-startup 200
# ttl-security all-interfaces hops 7
# area 10 authentication message-digest
# area 10 default-cost 10
# maximum-paths 15
# router ospf 100 vrf ospf_vrf
# domain-id 192.0.5.1
# auto-cost reference-bandwidth 5
# area 5 authentication message-digest
# area 5 nssa default-information-originate metric 10
# area 5 nssa translate type7 suppress-fa
# Using deleted
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Delete provided OSPF V2 processes
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 1
- process_id: 200
vrf: blue
state: deleted
# Task Output:
# ------------
# before:
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
# - areas:
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# process_id: 1
#
# commands:
# - no router ospf 1
#
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
#
# After state:
# ------------
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# Using deleted without any config passed (NOTE: This will delete all OSPFV2 configuration from device)
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Delete all OSPF processes
cisco.ios.ios_ospfv2:
state: deleted
# Task Output:
# ------------
# before:
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
# - areas:
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# process_id: 1
#
# commands:
# - no router ospf 200 vrf blue
# - no router ospf 1
#
# after: {}
#
# After state:
# ------------
# router-ios#sh running-config | section ^router ospf
# router-ios#
# Using Gathered
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Gather OSPFV2 running configurations
cisco.ios.ios_ospfv2:
config:
state: gathered
# Task Output:
# ------------
#
# gathered:
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
# - areas:
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# process_id: 1
# After state:
# ------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 1
max_metric:
router_lsa: true
on_startup:
time: 110
areas:
- area_id: "5"
capability: true
authentication:
enable: true
- area_id: "10"
authentication:
message_digest: true
nssa:
default_information_originate:
metric: 10
translate: suppress-fa
default_cost: 10
filter_list:
- name: test_prefix_in
direction: in
- name: test_prefix_out
direction: out
network:
- address: 198.51.100.0
wildcard_bits: 0.0.0.255
area: 5
default_information:
originate: true
- process_id: 200
vrf: blue
domain_id:
ip_address:
address: 192.0.3.1
max_metric:
router_lsa: true
on_startup:
time: 100
auto_cost:
reference_bandwidth: 4
areas:
- area_id: "10"
capability: true
distribute_list:
acls:
- name: 10
direction: out
- name: 123
direction: in
state: rendered
# Task Output:
# ------------
# rendered:
# - router ospf 200 vrf blue
# - auto-cost reference-bandwidth 4
# - distribute-list 10 out
# - distribute-list 123 in
# - domain-id 192.0.3.1
# - max-metric router-lsa on-startup 100
# - area 10 capability default-exclusion
# - router ospf 1
# - default-information originate
# - max-metric router-lsa on-startup 110
# - network 198.51.100.0 0.0.0.255 area 5
# - area 10 authentication message-digest
# - area 10 default-cost 10
# - area 10 nssa translate type7 suppress-fa
# - area 10 nssa default-information-originate metric 10
# - area 10 filter-list prefix test_prefix_out out
# - area 10 filter-list prefix test_prefix_in in
# - area 5 authentication
# - area 5 capability default-exclusion
#
# Using Parsed
# File: parsed.cfg
# ----------------
#
# router ospf 100
# auto-cost reference-bandwidth 5
# domain-id 192.0.5.1
# area 5 authentication message-digest
# area 5 nssa translate type7 suppress-fa
# area 5 nssa default-information-originate metric 10
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_ospfv2:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Task Output:
# ------------
# parsed:
# processes:
# - areas:
# - area_id: '5'
# authentication:
# message_digest: true
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# auto_cost:
# reference_bandwidth: 5
# set: true
# domain_id:
# ip_address:
# address: 192.0.5.1
# process_id: 100
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The resulting configuration model invocation. Returned: when changed Sample: |
|
The configuration prior to the model invocation. Returned: always Sample: |
|
The set of commands pushed to the remote device. Returned: always Sample: |
|
Facts about the network resource gathered from the remote device as structured data. Returned: when state is Sample: |
|
The device native config provided in running_config option parsed into structured data as per module argspec. Returned: when state is Sample: |
|
The provided configuration in the task rendered in device-native format (offline). Returned: when state is Sample: |