cisco.iosxr.iosxr_ospf_interfaces module – OSPF Interfaces Resource Module.
Note
This module is part of the cisco.iosxr collection (version 2.9.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.iosxr
.
To use it in a playbook, specify: cisco.iosxr.iosxr_ospf_interfaces
.
New in version 1.2.0: of cisco.iosxr
Synopsis
This module manages OSPF(v2/v3) configuration of interfaces on devices running Cisco IOS-XR.
Parameters
Parameter |
Comments |
---|---|
A list of OSPF configuration for interfaces. |
|
OSPF settings on the interfaces in address-family context. |
|
Address Family Identifier (AFI) for OSPF settings on the interfaces. Choices:
|
|
Specify configuration from a group |
|
Specify the name of the group |
|
Specify the group config operation Choices:
|
|
Enable authentication |
|
Use message-digest authentication |
|
Specify keychain name |
|
Use no authentication Choices:
|
|
Specify authentication password (key) |
|
Specifies an UNENCRYPTED password (key) will follow |
|
Specifies an ENCRYPTED password (key) will follow |
|
The OSPFv2 password (key) |
|
Configure BFD parameters |
|
Configure fast detection |
|
Enable fast detection only Choices:
|
|
Hold down neighbor session until BFD session is up Choices:
|
|
Hello interval in milli-seconds |
|
Detect multiplier |
|
Specify Interface cost |
|
Specify Cost when cumulative bandwidth goes below the theshold |
|
Specify cost w.r.t cummulative bandwidth |
|
Specify threshold bandwidth when cost-fallback is applied |
|
Filter OSPF LSAs during synchronization and flooding |
|
Filter all outgoing LSA Choices:
|
|
Specify interval after which a neighbor is declared dead |
|
Enable/Disable demand circuits Choices:
|
|
Specify IP Fast Reroute |
|
Disable IP fast reroute Choices:
|
|
Specify per-prefix computation |
|
Specify per-link LFA exclusion or FRR LFA candidate information Choices:
|
|
Specify Per-link LFA exclusion information |
|
Specify Aggregated Ethernet interface(s) |
|
Specify the interface id |
|
Specify Bridge-Group Virtual Interface |
|
Specify the interface id |
|
Specify FastEthernet/IEEE 802.3 interface(s) |
|
Specify the interface id |
|
Specify FiftyGigE/IEEE 802.3 interface(s) |
|
Specify the interface id |
|
Specify FortyGigE/IEEE 802.3 interface(s) |
|
Specify the interface id |
|
Specify FourHundredGigE/IEEE 802.3 interface(s) |
|
Specify the interface id |
|
Specify GigabitEthernet/IEEE 802.3 interface(s) |
|
Specify the interface id |
|
Specify HundredGigE/IEEE 802.3 interface(s) |
|
Specify the interface id |
|
Specify MgmtEth/IEEE 802.3 interface(s) |
|
Specify the interface id |
|
Specify Multilink network interface(s) |
|
Specify the interface id |
|
Specify Network Virtualization Endpoint Interface(s) |
|
Specify the interface id |
|
Specify Aggregated pos interface(s) |
|
Specify the interface id |
|
Specify PWHE Ethernet Interface |
|
Specify the interface id |
|
Specify PWHE VC11 IP Interworking Interface |
|
Specify the interface id |
|
Specify Serial network interface(s) |
|
Specify the interface id |
|
Specify SRP interface(s) |
|
Specify the interface id |
|
Specify TenGigabitEthernet/IEEE 802.3 interface(s) |
|
Specify the interface id |
|
Specify GRE/IPinIP Tunnel Interface(s) |
|
Specify the interface id |
|
Specify IPSec Tunnel interface(s) |
|
Specify the interface id |
|
MPLS Transport Protocol Tunnel interface |
|
Specify the interface id |
|
Specify MPLS Traffic Engineering P2MP Tunnel interface(s) |
|
Specify the interface id |
|
Specify TwentyFiveGigabitEthernet/IEEE 802.3 interface(s) |
|
Specify the interface id |
|
Specify TwoHundredGigE/IEEE 802.3 interface(s) |
|
Specify the interface id |
|
Enable/Disable backup selection from candidate-list only Choices:
|
|
Enable/Disable flood reduction Choices:
|
|
Specify Time between HELLO packets |
|
Configure interface down parameters Choices:
|
|
Message digest authentication password (key) |
|
Key ID |
|
Use MD5 Algorithm |
|
Specifies an UNENCRYPTED password (key) will follow Choices:
|
|
Specifies an ENCRYPTED password (key) will follow Choices:
|
|
The OSPFv2 password (key) |
|
Enable/Disable MPLS LDP Sync Choices:
|
|
Enable/Disable ignoring of MTU in DBD packets Choices:
|
|
Specify a neighbor routers |
|
Specify OSPF cost for point-to-multipoint neighbor |
|
Specify Filter OSPF LSA during synchronization and flooding for point-to-multipoint neighbor Choices:
|
|
Specify Neighbor address (name) |
|
Specify OSPF dead-router polling interval |
|
Specify OSPF priority of non-broadcast neighbor |
|
Specify Network type Choices:
|
|
Customize size of OSPF packets upto MTU |
|
Enable/Disable passive Choices:
|
|
Suppress advertisement of the prefixes Choices:
|
|
Specify Router priority |
|
Interfaces configuration for an OSPF process. |
|
Specify the area-id |
|
OSPF interfaces area ID as a decimal value. Please refer vendor documentation of Valid values. OSPF interfaces area ID in IP address format(e.g. A.B.C.D) |
|
OSPF process tag. |
|
Specify time between retransmitting lost link state advertisements |
|
Enable security |
|
Maximum number of IP hops allowed <1-254> |
|
Enable ttl security Choices:
|
|
Specify estimated time needed to send link-state update packet |
|
Name/Identifier of the interface. |
|
Type of the interface. |
|
This option is used only with state parsed. The value of this option should be the output received from the IOS-XR device by executing the command show running-config router ospf’. The state parsed reads the configuration from |
|
The state the configuration should be left in. Choices:
|
Notes
Note
This module works with connection
network_cli
. See the IOS-XR Platform Options
Examples
# Using merged
# Before state:
# -------------
#
# RP/0/RP0/CPU0:anton#show running-config router ospf
# % No such configuration item(s)
#
- name: Merge provided OSPF interfaces configuration with the existing configuration
cisco.iosxr.iosxr_ospf_interfaces:
config:
- name: GigabitEthernet0/0/0/0
type: gigabitethernet
address_family:
- afi: ipv4
processes:
- process_id: "LAB3"
area:
area_id: 0.0.0.3
cost: 20
authentication:
message_digest:
keychain: cisco
- afi: ipv6
processes:
- process_id: "LAB3"
area:
area_id: 0.0.0.2
cost: 30
state: merged
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
# "before": []
#
# "commands": [
# "router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 cost 20",
# "router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 authentication message-digest",
# "router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 authentication message-digest keychain cisco",
# "router ospfv3 LAB3 area 0.0.0.2 interface GigabitEthernet 0/0/0/0 cost 30"
# ]
#
# "after": [
# {
# "address_family": [
# {
# "afi": "ipv4",
# "authentication": {
# "message_digest": {
# "keychain": "cisco"
# }
# },
# "cost": 20,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.3"
# },
# "process_id": "LAB3"
# }
# ]
# },
# {
# "afi": "ipv6",
# "cost": 30,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.2"
# },
# "process_id": "LAB3"
# }
# ]
# }
# ],
# "name": "GigabitEthernet0/0/0/0",
# "type": "gigabitethernet"
# }
# ]
#
#
# ------------
# After state
# ------------
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:00:57.217 UTC
# router ospf LAB
# area 0.0.0.0
# !
# area 0.0.0.9
# !
# !
# router ospf LAB1
# area 0.0.0.1
# !
# area 0.0.0.3
# !
# !
# router ospf LAB3
# area 0.0.0.3
# interface GigabitEthernet0/0/0/0
# cost 20
# authentication message-digest keychain cisco
# !
# !
# !
# router ospf ipv4
# !
# Using replaced
#
# ------------
# Before state
# ------------
#
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:00:57.217 UTC
# router ospf LAB
# area 0.0.0.0
# !
# area 0.0.0.9
# !
# !
# router ospf LAB1
# area 0.0.0.1
# !
# area 0.0.0.3
# !
# !
# router ospf LAB3
# area 0.0.0.3
# interface GigabitEthernet0/0/0/0
# cost 20
# authentication message-digest keychain cisco
# !
# !
# !
# router ospf ipv4
# !
- name: Replace OSPF interfaces configuration
cisco.iosxr.iosxr_ospf_interfaces:
config:
- name: GigabitEthernet0/0/0/0
type: gigabitethernet
address_family:
- afi: ipv4
processes:
- process_id: "LAB3"
area:
area_id: 0.0.0.3
cost: 30
authentication:
message_digest:
keychain: ciscoiosxr
- afi: ipv6
processes:
- process_id: "LAB3"
area:
area_id: 0.0.0.2
cost: 30
state: replaced
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
# "before": [
# {
# "address_family": [
# {
# "afi": "ipv4",
# "authentication": {
# "message_digest": {
# "keychain": "cisco"
# }
# },
# "cost": 20,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.3"
# },
# "process_id": "LAB3"
# }
# ]
# },
# {
# "afi": "ipv6",
# "cost": 30,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.2"
# },
# "process_id": "LAB3"
# }
# ]
# }
# ],
# "name": "GigabitEthernet0/0/0/0",
# "type": "gigabitethernet"
# }
# ]
#
# "commands": [
# "router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 cost 30",
# "router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 authentication message-digest",
# "router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 authentication message-digest keychain ciscoiosxr"
# ]
#
# "after": [
# {
# "address_family": [
# {
# "afi": "ipv4",
# "authentication": {
# "message_digest": {
# "keychain": "ciscoiosxr"
# }
# },
# "cost": 30,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.3"
# },
# "process_id": "LAB3"
# }
# ]
# },
# {
# "afi": "ipv6",
# "cost": 30,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.2"
# },
# "process_id": "LAB3"
# }
# ]
# }
# ],
# "name": "GigabitEthernet0/0/0/0",
# "type": "gigabitethernet"
# }
# ]
#
#
# -----------
# After state
# -----------
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:10:39.827 UTC
# router ospf LAB
# area 0.0.0.0
# !
# area 0.0.0.9
# !
# !
# router ospf LAB1
# area 0.0.0.1
# !
# area 0.0.0.3
# !
# !
# router ospf LAB3
# area 0.0.0.3
# interface GigabitEthernet0/0/0/0
# cost 30
# authentication message-digest keychain ciscoiosxr
# !
# !
# !
# router ospf ipv4
# !
- name: Override existing OSPF interfaces configuration
cisco.iosxr.iosxr_ospf_interfaces:
config:
- name: GigabitEthernet0/0/0/1
type: gigabitethernet
address_family:
- afi: ipv4
processes:
- process_id: "LAB1"
area:
area_id: 0.0.0.3
cost: 10
authentication:
message_digest:
keychain: iosxr
state: overridden
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
# "before": [
# {
# "address_family": [
# {
# "afi": "ipv4",
# "authentication": {
# "message_digest": {
# "keychain": "ciscoiosxr"
# }
# },
# "cost": 30,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.3"
# },
# "process_id": "LAB3"
# }
# ]
# },
# {
# "afi": "ipv6",
# "cost": 30,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.2"
# },
# "process_id": "LAB3"
# }
# ]
# }
# ],
# "name": "GigabitEthernet0/0/0/0",
# "type": "gigabitethernet"
# }
# ]
#
# "commands": [
# "no router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0",
# "no router ospfv3 LAB3 area 0.0.0.2 interface GigabitEthernet 0/0/0/0",
# "router ospf LAB1 area 0.0.0.3 interface GigabitEthernet 0/0/0/1 cost 10",
# "router ospf LAB1 area 0.0.0.3 interface GigabitEthernet 0/0/0/1 authentication message-digest",
# "router ospf LAB1 area 0.0.0.3 interface GigabitEthernet 0/0/0/1 authentication message-digest keychain iosxr"
# ]
#
# "after": [
# {
# "address_family": [
# {
# "afi": "ipv4",
# "authentication": {
# "message_digest": {
# "keychain": "iosxr"
# }
# },
# "cost": 10,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.3"
# },
# "process_id": "LAB1"
# }
# ]
# }
# ],
# "name": "GigabitEthernet0/0/0/1",
# "type": "gigabitethernet"
# }
# ]
#
#
# -----------
# After state
# -----------
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:28:15.025 UTC
# router ospf LAB
# area 0.0.0.0
# !
# area 0.0.0.9
# !
# !
# router ospf LAB1
# area 0.0.0.1
# !
# area 0.0.0.3
# interface GigabitEthernet0/0/0/1
# cost 10
# authentication message-digest keychain iosxr
# !
# !
# !
# router ospf LAB3
# area 0.0.0.3
# !
# !
# router ospf ipv4
# !
# Using deleted
#
# ------------
# Before state
# ------------
#
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:28:15.025 UTC
# router ospf LAB
# area 0.0.0.0
# !
# area 0.0.0.9
# !
# !
# router ospf LAB1
# area 0.0.0.1
# !
# area 0.0.0.3
# interface GigabitEthernet0/0/0/1
# cost 10
# authentication message-digest keychain iosxr
# !
# !
# !
# router ospf LAB3
# area 0.0.0.3
# !
# !
# router ospf ipv4
# !
- name: Deleted existing OSPF interfaces from the device
cisco.iosxr.iosxr_ospf_interfaces:
config:
- name: GigabitEthernet0/0/0/1
type: gigabitethernet
state: deleted
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
# "before": [
# {
# "address_family": [
# {
# "afi": "ipv4",
# "authentication": {
# "message_digest": {
# "keychain": "iosxr"
# }
# },
# "cost": 10,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.3"
# },
# "process_id": "LAB1"
# }
# ]
# }
# ],
# "name": "GigabitEthernet0/0/0/1",
# "type": "gigabitethernet"
# }
# ],
#
# "commands": [
# "no router ospf LAB1 area 0.0.0.3 interface GigabitEthernet 0/0/0/1"
# ]
#
# "after": []
#
#
# -----------
# After state
# -----------
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:34:38.319 UTC
# router ospf LAB
# area 0.0.0.0
# !
# area 0.0.0.9
# !
# !
# router ospf LAB1
# area 0.0.0.1
# !
# area 0.0.0.3
# !
# !
# router ospf LAB3
# area 0.0.0.3
# !
# !
# router ospf ipv4
# !
# Using parsed
# parsed.cfg
# ------------
# router ospf LAB
# area 0.0.0.0
# !
# area 0.0.0.9
# !
# !
# router ospf LAB1
# area 0.0.0.1
# !
# area 0.0.0.3
# !
# !
# router ospf LAB3
# area 0.0.0.3
# interface GigabitEthernet0/0/0/0
# cost 20
# authentication message-digest keychain cisco
# !
# !
# !
# router ospf ipv4
# !
- name: Parsed the device configuration to get output commands
cisco.iosxr.iosxr_ospf_interfaces:
running_config: "{{ lookup('file', './parsed.cfg') }}"
state: parsed
#
#
# -------------------------
# Module Execution Result
# -------------------------
#
#
# "parsed": [
# {
# "address_family": [
# {
# "afi": "ipv4",
# "authentication": {
# "message_digest": {
# "keychain": "cisco"
# }
# },
# "cost": 20,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.3"
# },
# "process_id": "LAB3"
# }
# ]
# }
# ],
# "name": "GigabitEthernet0/0/0/0",
# "type": "gigabitethernet"
# }
# ]
#
# Using rendered
#
#
- name: Render the commands for provided configuration
cisco.iosxr.iosxr_ospf_interfaces:
config:
- name: GigabitEthernet0/0/0/0
type: gigabitethernet
address_family:
- afi: ipv4
processes:
- process_id: "LAB3"
area:
area_id: 0.0.0.3
cost: 20
authentication:
message_digest:
keychain: cisco
- afi: ipv6
processes:
- process_id: "LAB3"
area:
area_id: 0.0.0.2
cost: 30
state: rendered
#
#
# -------------------------
# Module Execution Result
# -------------------------
#
#
# "rendered": [
# "router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 cost 20",
# "router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 authentication message-digest",
# "router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 authentication message-digest keychain cisco",
# "router ospfv3 LAB3 area 0.0.0.2 interface GigabitEthernet 0/0/0/0 cost 30"
# ]
# Using gathered
#
# Before state:
# -------------
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:50:38.743 UTC
# router ospf LAB
# area 0.0.0.0
# !
# area 0.0.0.9
# !
# !
# router ospf LAB1
# area 0.0.0.1
# !
# area 0.0.0.3
# !
# !
# router ospf LAB3
# area 0.0.0.3
# interface GigabitEthernet0/0/0/0
# cost 20
# authentication message-digest keychain cisco
# !
# !
# !
# router ospf ipv4
# !
- name: Gather ospf_interfaces routes configuration
cisco.iosxr.iosxr_ospf_interfaces:
state: gathered
#
#
# -------------------------
# Module Execution Result
# -------------------------
#
# "gathered": [
# {
# "address_family": [
# {
# "afi": "ipv4",
# "authentication": {
# "message_digest": {
# "keychain": "cisco"
# }
# },
# "cost": 20,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.3"
# },
# "process_id": "LAB3"
# }
# ]
# },
# {
# "afi": "ipv6",
# "cost": 30,
# "processes": [
# {
# "area": {
# "area_id": "0.0.0.2"
# },
# "process_id": "LAB3"
# }
# ]
# }
# ],
# "name": "GigabitEthernet0/0/0/0",
# "type": "gigabitethernet"
# }
# ]
#
Authors
Rohit Thakur (@rohitthakur2590)