cisco.nxos.nxos_ospfv2 module – OSPFv2 resource module
Note
This module is part of the cisco.nxos collection (version 4.4.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.nxos
.
To use it in a playbook, specify: cisco.nxos.nxos_ospfv2
.
New in cisco.nxos 1.0.0
Synopsis
This module manages OSPFv2 configuration on devices running Cisco NX-OS.
Note
This module has a corresponding action plugin.
Aliases: ospfv2
Parameters
Parameter |
Comments |
---|---|
A list of OSPF process configuration. |
|
A list of OSPF instances’ configurations. |
|
Configure properties of OSPF Areas. |
|
The Area ID in IP Address format. |
|
Authentication settings for the Area. |
|
Use message-digest authentication. Choices:
|
|
Set authentication for the area. Choices:
|
|
Specify the default cost for default summary LSA. |
|
Filter prefixes between OSPF areas. |
|
The direction to apply the route map. Choices:
|
|
The Route-map name. |
|
NSSA settings for the area. |
|
Originate Type-7 default LSA into NSSA area. Choices:
|
|
Do not send redistributed LSAs into NSSA area. Choices:
|
|
Do not send summary LSAs into NSSA area. Choices:
|
|
Configure area as NSSA. Choices:
|
|
Translate LSA. |
|
Translate from Type 7 to Type 5. |
|
Always translate LSAs Choices:
|
|
Never translate LSAs Choices:
|
|
Suppress forwarding address in translated LSAs. Choices:
|
|
Configure an address range for the area. |
|
Cost to use for the range. |
|
Suppress advertising the specified range. Choices:
|
|
IP in Prefix format (x.x.x.x/len) |
|
Settings for configuring the area as a stub. |
|
Prevent ABR from sending summary LSAs into stub area. Choices:
|
|
Configure the area as a stub. Choices:
|
|
Calculate OSPF cost according to bandwidth. |
|
Reference bandwidth used to assign OSPF cost. |
|
Specify in which unit the reference bandwidth is specified. Choices:
|
|
Enable BFD on all OSPF interfaces. Choices:
|
|
Control distribution of default routes. |
|
Distribute a default route. |
|
Always advertise a default route. Choices:
|
|
Policy to control distribution of default routes |
|
Enable distribution of default route. Choices:
|
|
Specify default metric for redistributed routes. |
|
Configure the OSPF administrative distance. |
|
Flush routes on a non-graceful controlled restart. Choices:
|
|
Configure graceful restart. |
|
Configure maximum interval to restart gracefully. |
|
Enable/Disable helper mode. Choices:
|
|
Enable graceful-restart. Choices:
|
|
Isolate this router from OSPF perspective. Choices:
|
|
Log changes in adjacency state. |
|
Notify all state changes. Choices:
|
|
Enable/disable logging changes in adjacency state. Choices:
|
|
Feature to limit the number of non-self-originated LSAs. |
|
Set count on how many times adjacencies can be suppressed. |
|
Set time during which all adjacencies are suppressed. |
|
Set the maximum number of non self-generated LSAs. |
|
Set number of minutes after which ignore-count is reset to zero. |
|
Threshold value (%) at which to generate a warning message. |
|
Log a warning message when limit is exceeded. Choices:
|
|
Maximize the cost metric. |
|
Router LSA configuration. |
|
External LSA configuration. |
|
Set max metric value for external LSAs. |
|
Set external-lsa attribute. Choices:
|
|
Advertise Max metric for Stub links as well. Choices:
|
|
Effective only at startup. |
|
Set on-startup attribute. Choices:
|
|
ASN of BGP to wait for. |
|
Wait period in seconds after startup. |
|
Set router-lsa attribute. Choices:
|
|
Summary LSAs configuration. |
|
Max metric value for summary LSAs. |
|
Set summary-lsa attribute. Choices:
|
|
Maximum paths per destination. |
|
OSPF MPLS configuration settings. |
|
OSPF MPLS Traffic Engineering commands. |
|
List of Area IDs. |
|
Area Id in ip address format. |
|
MPLS TE multicast support. Choices:
|
|
Router ID associated with TE. |
|
Display OSPF router ids as DNS names. Choices:
|
|
Suppress routing updates on the interface. |
|
Interfaces passive by default. Choices:
|
|
The OSPF process tag. |
|
Redistribute information from another routing protocol. |
|
The identifier for the protocol specified. |
|
The name of the protocol. Choices:
|
|
The route map policy to constrain redistribution. |
|
Configure 1583 compatibility for external path preferences. Choices:
|
|
Set OSPF process router-id. |
|
Shutdown the OSPF protocol instance. Choices:
|
|
Configure route summarization for redistribution. |
|
Suppress advertising the specified summary. Choices:
|
|
IP prefix in format x.x.x.x/ml. |
|
A 32-bit tag value. |
|
Policy for filtering/modifying OSPF routes before sending them to RIB. |
|
Block the OSPF routes from being sent to RIB. Choices:
|
|
The Route Map name. |
|
Configure timer related constants. |
|
Mimimum interval between arrival of a LSA. |
|
LSA group refresh/maxage interval. |
|
Configure throttle related constants. |
|
Set rate-limiting for LSA generation. |
|
The hold interval. |
|
The max interval. |
|
The start interval. |
|
Set OSPF SPF timers. |
|
Initial SPF schedule delay in milliseconds. |
|
Maximum wait time between SPF calculations. |
|
Minimum hold time between SPF calculations. |
|
Configure VRF specific OSPF settings. |
|
Configure properties of OSPF Areas. |
|
The Area ID in IP Address format. |
|
Authentication settings for the Area. |
|
Use message-digest authentication. Choices:
|
|
Set authentication for the area. Choices:
|
|
Specify the default cost for default summary LSA. |
|
Filter prefixes between OSPF areas. |
|
The direction to apply the route map. Choices:
|
|
The Route-map name. |
|
NSSA settings for the area. |
|
Originate Type-7 default LSA into NSSA area. Choices:
|
|
Do not send redistributed LSAs into NSSA area. Choices:
|
|
Do not send summary LSAs into NSSA area. Choices:
|
|
Configure area as NSSA. Choices:
|
|
Translate LSA. |
|
Translate from Type 7 to Type 5. |
|
Always translate LSAs Choices:
|
|
Never translate LSAs Choices:
|
|
Suppress forwarding address in translated LSAs. Choices:
|
|
Configure an address range for the area. |
|
Cost to use for the range. |
|
Suppress advertising the specified range. Choices:
|
|
IP in Prefix format (x.x.x.x/len) |
|
Settings for configuring the area as a stub. |
|
Prevent ABR from sending summary LSAs into stub area. Choices:
|
|
Configure the area as a stub. Choices:
|
|
Calculate OSPF cost according to bandwidth. |
|
Reference bandwidth used to assign OSPF cost. |
|
Specify in which unit the reference bandwidth is specified. Choices:
|
|
Enable BFD on all OSPF interfaces. Choices:
|
|
OSPF capability settings. |
|
Enable VRF-lite capability settings. |
|
Ethernet VPN. Choices:
|
|
Enable VRF-lite support. Choices:
|
|
Control distribution of default routes. |
|
Distribute a default route. |
|
Always advertise a default route. Choices:
|
|
Policy to control distribution of default routes |
|
Enable distribution of default route. Choices:
|
|
Specify default metric for redistributed routes. |
|
Configure the OSPF administrative distance. |
|
Configure a PE router to ignore the DN bit for network summary, external and NSSA external LSA. Choices:
|
|
Configure graceful restart. |
|
Configure maximum interval to restart gracefully. |
|
Enable/Disable helper mode. Choices:
|
|
Enable graceful-restart. Choices:
|
|
Log changes in adjacency state. |
|
Notify all state changes. Choices:
|
|
Enable/disable logging changes in adjacency state. Choices:
|
|
Feature to limit the number of non-self-originated LSAs. |
|
Set count on how many times adjacencies can be suppressed. |
|
Set time during which all adjacencies are suppressed. |
|
Set the maximum number of non self-generated LSAs. |
|
Set number of minutes after which ignore-count is reset to zero. |
|
Threshold value (%) at which to generate a warning message. |
|
Log a warning message when limit is exceeded. Choices:
|
|
Maximize the cost metric. |
|
Router LSA configuration. |
|
External LSA configuration. |
|
Set max metric value for external LSAs. |
|
Set external-lsa attribute. Choices:
|
|
Advertise Max metric for Stub links as well. Choices:
|
|
Effective only at startup. |
|
Set on-startup attribute. Choices:
|
|
ASN of BGP to wait for. |
|
Wait period in seconds after startup. |
|
Set router-lsa attribute. Choices:
|
|
Summary LSAs configuration. |
|
Max metric value for summary LSAs. |
|
Set summary-lsa attribute. Choices:
|
|
Maximum paths per destination. |
|
Display OSPF router ids as DNS names. Choices:
|
|
Suppress routing updates on the interface. |
|
Interfaces passive by default. Choices:
|
|
Redistribute information from another routing protocol. |
|
The identifier for the protocol specified. |
|
The name of the protocol. Choices:
|
|
The route map policy to constrain redistribution. |
|
Configure 1583 compatibility for external path preferences. Choices:
|
|
Set OSPF process router-id. |
|
Shutdown the OSPF protocol instance. Choices:
|
|
Configure route summarization for redistribution. |
|
Suppress advertising the specified summary. Choices:
|
|
IP prefix in format x.x.x.x/ml. |
|
A 32-bit tag value. |
|
Policy for filtering/modifying OSPF routes before sending them to RIB. |
|
Block the OSPF routes from being sent to RIB. Choices:
|
|
The Route Map name. |
|
Configure timer related constants. |
|
Mimimum interval between arrival of a LSA. |
|
LSA group refresh/maxage interval. |
|
Configure throttle related constants. |
|
Set rate-limiting for LSA generation. |
|
The hold interval. |
|
The max interval. |
|
The start interval. |
|
Set OSPF SPF timers. |
|
Initial SPF schedule delay in milliseconds. |
|
Maximum wait time between SPF calculations. |
|
Minimum hold time between SPF calculations. |
|
Name/Identifier of the VRF. |
|
This option is used only with state parsed. The value of this option should be the output received from the NX-OS device by executing the command show running-config | section “^router ospf .*”. The state parsed reads the configuration from |
|
The state the configuration should be left in. Choices:
|
Notes
Note
Tested against NX-OS 7.0(3)I5(1).
Unsupported for Cisco MDS
This module works with connection
network_cli
andhttpapi
.
Examples
# Using merged
# Before state:
# -------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# nxos-9k-rdo#
- name: Merge the provided configuration with the existing running configuration
cisco.nxos.nxos_ospfv2:
config:
processes:
- process_id: 100
router_id: 203.0.113.20
- process_id: 102
router_id: 198.51.100.1
areas:
- area_id: 0.0.0.100
filter_list:
- route_map: rmap_1
direction: in
- route_map: rmap_2
direction: out
ranges:
- prefix: 198.51.100.64/27
not_advertise: true
- prefix: 198.51.100.96/27
cost: 120
- area_id: 0.0.0.101
authentication:
message_digest: true
redistribute:
- protocol: eigrp
id: 120
route_map: rmap_1
- protocol: direct
route_map: ospf102-direct-connect
vrfs:
- vrf: zone1
router_id: 198.51.100.129
redistribute:
- protocol: static
route_map: zone1-static-connect
summary_address:
- prefix: 198.51.100.128/27
tag: 121
- prefix: 198.51.100.160/27
areas:
- area_id: 0.0.0.102
nssa:
default_information_originate: true
no_summary: true
- area_id: 0.0.0.103
nssa:
no_summary: true
translate:
type7:
always: true
- vrf: zone2
auto_cost:
reference_bandwidth: 45
unit: Gbps
state: merged
# Task output
# -------------
# before: {}
#
# commands:
# - router ospf 102
# - router-id 198.51.100.1
# - redistribute eigrp 120 route-map rmap_1
# - redistribute direct route-map ospf102-direct-connect
# - area 0.0.0.100 filter-list route-map rmap_1 in
# - area 0.0.0.100 filter-list route-map rmap_2 out
# - area 0.0.0.100 range 198.51.100.64/27 not-advertise
# - area 0.0.0.100 range 198.51.100.96/27 cost 120
# - area 0.0.0.101 authentication message-digest
# - vrf zone1
# - router-id 198.51.100.129
# - summary-address 198.51.100.128/27 tag 121
# - summary-address 198.51.100.160/27
# - redistribute static route-map zone1-static-connect
# - area 0.0.0.102 nssa no-summary default-information-originate
# - area 0.0.0.103 nssa no-summary
# - area 0.0.0.103 nssa translate type7 always
# - vrf zone2
# - auto-cost reference-bandwidth 45 Gbps
# - router ospf 100
# - router-id 203.0.113.20
#
# after:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# - areas:
# - area_id: 0.0.0.100
# filter_list:
# - direction: out
# route_map: rmap_2
# - direction: in
# route_map: rmap_1
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# - cost: 120
# prefix: 198.51.100.96/27
# - area_id: 0.0.0.101
# authentication:
# message_digest: true
# process_id: "102"
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "120"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# - area_id: 0.0.0.103
# nssa:
# no_summary: true
# translate:
# type7:
# always: true
# redistribute:
# - protocol: static
# route_map: zone1-static-connect
# router_id: 198.51.100.129
# vrf: zone1
# - auto_cost:
# reference_bandwidth: 45
# unit: Gbps
# vrf: zone2
#
# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# router ospf 102
# router-id 198.51.100.1
# redistribute direct route-map ospf102-direct-connect
# redistribute eigrp 120 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_2 out
# area 0.0.0.100 filter-list route-map rmap_1 in
# area 0.0.0.100 range 198.51.100.64/27 not-advertise
# area 0.0.0.100 range 198.51.100.96/27 cost 120
# area 0.0.0.101 authentication message-digest
# vrf zone1
# router-id 198.51.100.129
# area 0.0.0.102 nssa no-summary default-information-originate
# area 0.0.0.103 nssa no-summary
# area 0.0.0.103 nssa translate type7 always
# redistribute static route-map zone1-static-connect
# summary-address 198.51.100.128/27 tag 121
# summary-address 198.51.100.160/27
# vrf zone2
# auto-cost reference-bandwidth 45 Gbps
# Using replaced
# Before state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# router ospf 102
# router-id 198.51.100.1
# redistribute direct route-map ospf102-direct-connect
# redistribute eigrp 120 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_2 out
# area 0.0.0.100 filter-list route-map rmap_1 in
# area 0.0.0.100 range 198.51.100.64/27 not-advertise
# area 0.0.0.100 range 198.51.100.96/27 cost 120
# area 0.0.0.101 authentication message-digest
# vrf zone1
# router-id 198.51.100.129
# area 0.0.0.102 nssa no-summary default-information-originate
# area 0.0.0.103 nssa no-summary
# area 0.0.0.103 nssa translate type7 always
# redistribute static route-map zone1-static-connect
# summary-address 198.51.100.128/27 tag 121
# summary-address 198.51.100.160/27
# vrf zone2
# auto-cost reference-bandwidth 45 Gbps
- name: Replace device configurations of listed OSPF processes with provided configurations
cisco.nxos.nxos_ospfv2:
config:
processes:
- process_id: 102
router_id: 198.51.100.1
areas:
- area_id: 0.0.0.100
filter_list:
- route_map: rmap_8
direction: in
ranges:
- prefix: 198.51.100.64/27
not_advertise: true
- area_id: 0.0.0.101
stub:
no_summary: true
redistribute:
- protocol: eigrp
id: 130
route_map: rmap_1
- protocol: direct
route_map: ospf102-direct-connect
vrfs:
- vrf: zone1
router_id: 198.51.100.129
redistribute:
- protocol: bgp
id: 65563
route_map: zone1-bgp-connect
areas:
- area_id: 0.0.0.102
nssa:
default_information_originate: true
no_summary: true
state: replaced
# Task output
# -------------
# before:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# - areas:
# - area_id: 0.0.0.100
# filter_list:
# - direction: out
# route_map: rmap_2
# - direction: in
# route_map: rmap_1
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# - cost: 120
# prefix: 198.51.100.96/27
# - area_id: 0.0.0.101
# authentication:
# message_digest: true
# process_id: "102"
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "120"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# - area_id: 0.0.0.103
# nssa:
# no_summary: true
# translate:
# type7:
# always: true
# redistribute:
# - protocol: static
# route_map: zone1-static-connect
# router_id: 198.51.100.129
# vrf: zone1
# - auto_cost:
# reference_bandwidth: 45
# unit: Gbps
# vrf: zone2
#
# commands:
# - router ospf 102
# - redistribute eigrp 130 route-map rmap_1
# - no redistribute eigrp 120 route-map rmap_1
# - area 0.0.0.100 filter-list route-map rmap_8 in
# - no area 0.0.0.100 filter-list route-map rmap_2 out
# - no area 0.0.0.100 range 198.51.100.96/27
# - no area 0.0.0.101 authentication
# - area 0.0.0.101 stub no-summary
# - vrf zone1
# - no summary-address 198.51.100.128/27 tag 121
# - no summary-address 198.51.100.160/27
# - redistribute bgp 65563 route-map zone1-bgp-connect
# - no redistribute static route-map zone1-static-connect
# - no area 0.0.0.103 nssa
# - no area 0.0.0.103 nssa translate type7 always
# - no vrf zone2
#
# after:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# - areas:
# - area_id: 0.0.0.101
# stub:
# no_summary: true
# - area_id: 0.0.0.100
# filter_list:
# - direction: in
# route_map: rmap_8
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# process_id: "102"
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "130"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# redistribute:
# - id: "65563"
# protocol: bgp
# route_map: zone1-bgp-connect
# router_id: 198.51.100.129
# vrf: zone1
# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# router ospf 102
# router-id 198.51.100.1
# area 0.0.0.101 stub no-summary
# redistribute direct route-map ospf102-direct-connect
# redistribute eigrp 130 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_8 in
# area 0.0.0.100 range 198.51.100.64/27 not-advertise
# vrf zone1
# router-id 198.51.100.129
# area 0.0.0.102 nssa no-summary default-information-originate
# redistribute bgp 65563 route-map zone1-bgp-connect
# Using overridden
# Before state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# router ospf 102
# router-id 198.51.100.1
# redistribute direct route-map ospf102-direct-connect
# redistribute eigrp 120 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_2 out
# area 0.0.0.100 filter-list route-map rmap_1 in
# area 0.0.0.100 range 198.51.100.64/27 not-advertise
# area 0.0.0.100 range 198.51.100.96/27 cost 120
# area 0.0.0.101 authentication message-digest
# vrf zone1
# router-id 198.51.100.129
# area 0.0.0.102 nssa no-summary default-information-originate
# area 0.0.0.103 nssa no-summary
# area 0.0.0.103 nssa translate type7 always
# redistribute static route-map zone1-static-connect
# summary-address 198.51.100.128/27 tag 121
# summary-address 198.51.100.160/27
# vrf zone2
# auto-cost reference-bandwidth 45 Gbps
- name: Override all OSPF configuration with provided configuration
cisco.nxos.nxos_ospfv2:
config:
processes:
- process_id: 104
router_id: 203.0.113.20
- process_id: 102
router_id: 198.51.100.1
shutdown: true
state: overridden
# Task output
# -------------
# before:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# - areas:
# - area_id: 0.0.0.100
# filter_list:
# - direction: out
# route_map: rmap_2
# - direction: in
# route_map: rmap_1
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# - cost: 120
# prefix: 198.51.100.96/27
# - area_id: 0.0.0.101
# authentication:
# message_digest: true
# process_id: "102"
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "120"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# - area_id: 0.0.0.103
# nssa:
# no_summary: true
# translate:
# type7:
# always: true
# redistribute:
# - protocol: static
# route_map: zone1-static-connect
# router_id: 198.51.100.129
# vrf: zone1
# - auto_cost:
# reference_bandwidth: 45
# unit: Gbps
# vrf: zone2
#
# commands:
# - no router ospf 100
# - router ospf 104
# - router-id 203.0.113.20
# - router ospf 102
# - shutdown
# - no redistribute direct route-map ospf102-direct-connect
# - no redistribute eigrp 120 route-map rmap_1
# - no area 0.0.0.100 filter-list route-map rmap_2 out
# - no area 0.0.0.100 filter-list route-map rmap_1 in
# - no area 0.0.0.100 range 198.51.100.64/27
# - no area 0.0.0.100 range 198.51.100.96/27
# - no area 0.0.0.101 authentication
# - no vrf zone1
# - no vrf zone2
#
# after:
# processes:
# - process_id: "102"
# router_id: 198.51.100.1
# shutdown: true
# - process_id: "104"
# router_id: 203.0.113.20
# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 102
# router-id 198.51.100.1
# shutdown
# router ospf 104
# router-id 203.0.113.20
# Using deleted to delete a single OSPF process
# Before state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# router ospf 102
# router-id 198.51.100.1
# redistribute direct route-map ospf102-direct-connect
# redistribute eigrp 120 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_2 out
# area 0.0.0.100 filter-list route-map rmap_1 in
# area 0.0.0.100 range 198.51.100.64/27 not-advertise
# area 0.0.0.100 range 198.51.100.96/27 cost 120
# area 0.0.0.101 authentication message-digest
# vrf zone1
# router-id 198.51.100.129
# area 0.0.0.102 nssa no-summary default-information-originate
# area 0.0.0.103 nssa no-summary
# area 0.0.0.103 nssa translate type7 always
# redistribute static route-map zone1-static-connect
# summary-address 198.51.100.128/27 tag 121
# summary-address 198.51.100.160/27
# vrf zone2
# auto-cost reference-bandwidth 45 Gbps
- name: Delete a single OSPF process
cisco.nxos.nxos_ospfv2:
config:
processes:
- process_id: 102
state: deleted
# Task output
# -------------
# before:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# - areas:
# - area_id: 0.0.0.100
# filter_list:
# - direction: out
# route_map: rmap_2
# - direction: in
# route_map: rmap_1
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# - cost: 120
# prefix: 198.51.100.96/27
# - area_id: 0.0.0.101
# authentication:
# message_digest: true
# process_id: "102"
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "120"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# - area_id: 0.0.0.103
# nssa:
# no_summary: true
# translate:
# type7:
# always: true
# redistribute:
# - protocol: static
# route_map: zone1-static-connect
# router_id: 198.51.100.129
# vrf: zone1
# - auto_cost:
# reference_bandwidth: 45
# unit: Gbps
# vrf: zone2
#
# commands:
# - no router ospf 102
#
# after:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# Using deleted all OSPF processes from the device
# Before state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# router ospf 102
# router-id 198.51.100.1
# redistribute direct route-map ospf102-direct-connect
# redistribute eigrp 120 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_2 out
# area 0.0.0.100 filter-list route-map rmap_1 in
# area 0.0.0.100 range 198.51.100.64/27 not-advertise
# area 0.0.0.100 range 198.51.100.96/27 cost 120
# area 0.0.0.101 authentication message-digest
# vrf zone1
# router-id 198.51.100.129
# area 0.0.0.102 nssa no-summary default-information-originate
# area 0.0.0.103 nssa no-summary
# area 0.0.0.103 nssa translate type7 always
# redistribute static route-map zone1-static-connect
# summary-address 198.51.100.128/27 tag 121
# summary-address 198.51.100.160/27
# vrf zone2
# auto-cost reference-bandwidth 45 Gbps
- name: Delete all OSPF processes from the device
cisco.nxos.nxos_ospfv2:
state: deleted
# Task output
# -------------
# before:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# - areas:
# - area_id: 0.0.0.100
# filter_list:
# - direction: out
# route_map: rmap_2
# - direction: in
# route_map: rmap_1
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# - cost: 120
# prefix: 198.51.100.96/27
# - area_id: 0.0.0.101
# authentication:
# message_digest: true
# process_id: "102"
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "120"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# - area_id: 0.0.0.103
# nssa:
# no_summary: true
# translate:
# type7:
# always: true
# redistribute:
# - protocol: static
# route_map: zone1-static-connect
# router_id: 198.51.100.129
# vrf: zone1
# - auto_cost:
# reference_bandwidth: 45
# unit: Gbps
# vrf: zone2
#
# commands:
# - no router ospf 100
# - no router ospf 102
#
# after: {}
# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# nxos-9k-rdo#
# Using rendered
- name: Render platform specific configuration lines (without connecting to the device)
cisco.nxos.nxos_ospfv2:
config:
processes:
- process_id: 100
router_id: 203.0.113.20
- process_id: 102
router_id: 198.51.100.1
areas:
- area_id: 0.0.0.100
filter_list:
- route_map: rmap_1
direction: in
- route_map: rmap_2
direction: out
ranges:
- prefix: 198.51.100.64/27
not_advertise: true
- prefix: 198.51.100.96/27
cost: 120
- area_id: 0.0.0.101
authentication:
message_digest: true
redistribute:
- protocol: eigrp
id: 120
route_map: rmap_1
- protocol: direct
route_map: ospf102-direct-connect
vrfs:
- vrf: zone1
router_id: 198.51.100.129
redistribute:
- protocol: static
route_map: zone1-static-connect
summary_address:
- prefix: 198.51.100.128/27
tag: 121
- prefix: 198.51.100.160/27
areas:
- area_id: 0.0.0.102
nssa:
default_information_originate: true
no_summary: true
- area_id: 0.0.0.103
nssa:
no_summary: true
translate:
type7:
always: true
- vrf: zone2
auto_cost:
reference_bandwidth: 45
unit: Gbps
state: rendered
# Task Output (redacted)
# -----------------------
# rendered:
# - router ospf 100
# - router-id 203.0.113.20
# - router ospf 102
# - router-id 198.51.100.1
# - redistribute eigrp 120 route-map rmap_1
# - redistribute direct route-map ospf102-direct-connect
# - area 0.0.0.100 filter-list route-map rmap_1 in
# - area 0.0.0.100 filter-list route-map rmap_2 out
# - area 0.0.0.100 range 198.51.100.64/27 not-advertise
# - area 0.0.0.100 range 198.51.100.96/27 cost 120
# - area 0.0.0.101 authentication message-digest
# - vrf zone1
# - router-id 198.51.100.129
# - summary-address 198.51.100.128/27 tag 121
# - summary-address 198.51.100.160/27
# - redistribute static route-map zone1-static-connect
# - area 0.0.0.102 nssa no-summary default-information-originate
# - area 0.0.0.103 nssa no-summary
# - area 0.0.0.103 nssa translate type7 always
# - vrf zone2
# - auto-cost reference-bandwidth 45 Gbps
# Using parsed
# parsed.cfg
# ------------
# router ospf 100
# router-id 192.0.100.1
# area 0.0.0.101 nssa no-summary no-redistribution
# area 0.0.0.102 stub no-summary
# redistribute direct route-map ospf-direct-connect
# redistribute eigrp 120 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_2 out
# area 0.0.0.100 filter-list route-map rmap_1 in
# area 0.0.0.100 range 192.0.2.0/24 not-advertise
# area 0.0.0.100 range 192.0.3.0/24 cost 120
# area 0.0.0.100 authentication message-digest
# vrf zone1
# router-id 192.0.100.2
# area 0.0.100.1 nssa no-summary no-redistribution
# redistribute static route-map zone1-direct-connect
# summary-address 10.0.0.0/24 tag 120
# summary-address 11.0.0.0/24 not-advertise
# vrf zone2
# auto-cost reference-bandwidth 45 Gbps
# down-bit-ignore
# capability vrf-lite evpn
# shutdown
# router ospf 102
# router-id 198.54.100.1
# shutdown
# vrf zone2
# summary-address 192.0.8.0/24 tag 120
# vrf zone4
# shutdown
- name: Parse externally provided OSPFv2 config
cisco.nxos.nxos_ospfv2:
running_config: "{{ lookup('file', 'ospfv2.cfg') }}"
state: parsed
# Task output (redacted)
# -----------------------
# parsed:
# processes:
# - process_id: "100"
# areas:
# - area_id: 0.0.0.101
# nssa:
# no_redistribution: true
# no_summary: true
# - area_id: 0.0.0.102
# stub:
# no_summary: true
# - area_id: 0.0.0.100
# authentication:
# message_digest: true
# filter_list:
# - direction: out
# route_map: rmap_2
# - direction: in
# route_map: rmap_1
# ranges:
# - not_advertise: true
# prefix: 192.0.2.0/24
# - cost: 120
# prefix: 192.0.3.0/24
# redistribute:
# - protocol: direct
# route_map: ospf-direct-connect
# - id: "120"
# protocol: eigrp
# route_map: rmap_1
# router_id: 192.0.100.1
# vrfs:
# - vrf: zone1
# areas:
# - area_id: 0.0.100.1
# nssa:
# no_redistribution: true
# no_summary: true
# redistribute:
# - protocol: static
# route_map: zone1-direct-connect
# router_id: 192.0.100.2
# summary_address:
# - prefix: 10.0.0.0/24
# tag: 120
# - not_advertise: true
# prefix: 11.0.0.0/24
# - vrf: zone2
# auto_cost:
# reference_bandwidth: 45
# unit: Gbps
# capability:
# vrf_lite:
# evpn: true
# down_bit_ignore: true
# shutdown: true
# - process_id: "102"
# router_id: 198.54.100.1
# shutdown: true
# vrfs:
# - vrf: zone2
# summary_address:
# - prefix: 192.0.8.0/24
# tag: 120
# - vrf: zone4
# shutdown: true
# Using gathered
- name: Gather OSPFv2 facts using gathered
cisco.nxos.nxos_ospfv2:
state: gathered
# Task output (redacted)
# -----------------------
# gathered:
# processes:
# - process_id: "102"
# areas:
# - area_id: 0.0.0.101
# stub:
# no_summary: true
# - area_id: 0.0.0.100
# filter_list:
# - direction: in
# route_map: rmap_8
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "130"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - vrf: zone1
# areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# redistribute:
# - id: "65563"
# protocol: bgp
# route_map: zone1-bgp-connect
# router_id: 198.51.100.129
#
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: |