amnesh.soodar.soodar_ospf_interfaces module – OSPF_interfaces resource module.
Note
This module is part of the amnesh.soodar collection (version 1.0.0).
To install it, use: ansible-galaxy collection install https://soodar.ir/ansible/amnesh.soodar.tar.gz
.
To use it in a playbook, specify: amnesh.soodar.soodar_ospf_interfaces
.
New in amnesh.soodar 1.0
Synopsis
Manages and configures Open Shortest Path First (OSPF) version 2 and it’s attributes over interface on Soodar platforms.
Parameters
Parameter |
Comments |
---|---|
A dictionary of OSPF interfaces options. |
|
OSPF interfaces settings on the interfaces in address-family context. |
|
Address Family Identifier (AFI) for OSPF interfaces settings on the interfaces. Choices:
|
|
Enable authentication |
|
Use message-digest authentication Choices:
|
|
Use no authentication Choices:
|
|
BFD configuration commands Enable/Disable BFD on this interface Choices:
|
|
Interface cost |
|
Interface cost or Route cost of this interface |
|
Interval after which a neighbor is declared dead |
|
Set to 1 second and set multiplier for Hellos Number of Hellos sent within 1 second. Please refer vendor documentation of Valid values. Valid only with IP OSPF config |
|
time in seconds |
|
Time between HELLO packets Please refer vendor documentation of Valid values. |
|
Ignores the MTU in DBD packets Choices:
|
|
Network type |
|
Specify OSPF broadcast multi-access network Choices:
|
|
Specify OSPF NBMA network Choices:
|
|
Specify OSPF point-to-multipoint network Choices:
|
|
Specify OSPF point-to-point network Choices:
|
|
Router priority. Please refer vendor documentation of Valid values. |
|
OSPF interfaces process config |
|
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) |
|
Set the OSPF instance based on ID Valid only with IPv6 OSPF config |
|
Time between retransmitting lost link state advertisements. Please refer vendor documentation of Valid values. |
|
Link state transmit delay. Please refer vendor documentation of Valid values. |
|
Full name of the interface e.g. ge1. |
|
This option is used only with state parsed. The value of this option should be the output received from the Soodar device by executing the command sh running-config | section ^interface. 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 Soodar Version 21.04
Examples
# Using deleted
# Before state:
# -------------
#
# soodar# sh running-config | section ^interface
# interface ge0
# interface ge1
# ipv6 ospf priority 20
# ipv6 ospf transmit-delay 30
# interface ge2
# ip ospf priority 40
# ip ospf 10 area 20
# ip ospf cost 30
- name: Delete provided OSPF Interface config
amnesh.soodar.soodar_ospf_interfaces:
config:
- name: ge1
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "interface ge1",
# "no ipv6 ospf priority 20",
# "no ipv6 ospf transmit-delay 30"
# ]
# After state:
# -------------
# soodar# sh running-config | section ^interface
# interface ge0
# interface ge1
# interface ge2
# ip ospf priority 40
# ip ospf 10 area 20
# ip ospf cost 30
# Using deleted without any config passed (NOTE: This will delete all OSPF Interfaces configuration from device)
# Before state:
# -------------
#
# soodar# sh running-config | section ^interface
# interface ge0
# interface ge1
# ipv6 ospf priority 20
# ipv6 ospf transmit-delay 30
# interface ge2
# ip ospf priority 40
# ip ospf 10 area 20
# ip ospf cost 30
- name: Delete all OSPF config from interfaces
amnesh.soodar.soodar_ospf_interfaces:
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "interface ge2",
# "no ip ospf 10 area 20",
# "no ip ospf cost 30",
# "no ip ospf priority 40",
# "interface ge1",
# "no ipv6 ospf priority 20",
# "no ipv6 ospf transmit-delay 30"
# ]
# After state:
# -------------
# soodar# sh running-config | section ^interface
# interface ge0
# interface ge1
# interface ge2
# Using merged
# Before state:
# -------------
#
# soodar# sh running-config | section ^interface
# soodar#
- name: Merge provided OSPF Interfaces configuration
amnesh.soodar.soodar_ospf_interfaces:
config:
- name: ge1
address_family:
- afi: ipv4
process:
id: 10
area_id: 30
bfd: true
cost:
interface_cost: 5
dead_interval:
time: 5
network:
broadcast: true
priority: 25
- afi: ipv6
priority: 55
transmit_delay: 45
state: merged
# Commands Fired:
# ---------------
#
# "commands": [
# "interface ge1",
# "ip ospf 10 area 30",
# "ip ospf bfd",
# "ip ospf cost 5",
# "ip ospf dead-interval 5",
# "ip ospf network broadcast",
# "ip ospf priority 25",
# "ipv6 ospf priority 55",
# "ipv6 ospf transmit-delay 45"
# ]
# After state:
# -------------
#
# soodar# sh running-config | section ^interface
# interface ge0
# interface ge1
# ip ospf network broadcast
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf bfd
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# interface ge2
# Using replaced
# Before state:
# -------------
#
# soodar# sh running-config | section ^interface
# interface ge0
# interface ge1
# ip ospf network broadcast
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf bfd
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# interface ge2
- name: Replaced provided OSPF Interfaces configuration
amnesh.soodar.soodar_ospf_interfaces:
config:
- name: ge2
address_family:
- afi: ipv6
priority: 20
transmit_delay: 30
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "interface ge2",
# "ipv6 ospf priority 20",
# "ipv6 ospf transmit-delay 30"
# ]
# After state:
# -------------
# soodar# sh running-config | section ^interface
# interface ge0
# interface ge1
# ip ospf network broadcast
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf bfd
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# interface ge2
# ipv6 ospf priority 20
# ipv6 ospf transmit-delay 30
# Using overridden
# Before state:
# -------------
#
# soodar# sh running-config | section ^interface
# interface ge0
# interface ge1
# ip ospf network broadcast
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf bfd
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# interface ge2
- name: Override provided OSPF Interfaces configuration
amnesh.soodar.soodar_ospf_interfaces:
config:
- name: ge1
address_family:
- afi: ipv6
priority: 20
transmit_delay: 30
- name: ge2
address_family:
- afi: ipv4
process:
id: 10
area_id: 20
cost:
interface_cost: 30
priority: 40
state: overridden
# Commands Fired:
# ---------------
#
# "commands": [
# "interface ge2",
# "ip ospf 10 area 20",
# "ip ospf cost 30",
# "ip ospf priority 40",
# "interface ge1",
# "ipv6 ospf priority 20",
# "ipv6 ospf transmit-delay 30",
# "no ip ospf 10 area 30",
# "no ip ospf bfd",
# "no ip ospf cost 5",
# "no ip ospf dead-interval 5",
# "no ip ospf network broadcast",
# "no ip ospf priority 25",
# "no ip ospf shutdown",
# ]
# After state:
# -------------
#
# soodar# sh running-config | section ^interface
# interface ge0
# interface ge1
# ipv6 ospf 55 area 105
# ipv6 ospf priority 20
# ipv6 ospf transmit-delay 30
# ipv6 ospf adjacency stagger disable
# interface ge2
# ip ospf priority 40
# ip ospf adjacency stagger disable
# ip ospf ttl-security hops 50
# ip ospf 10 area 20
# ip ospf cost 30
# Using Gathered
# Before state:
# -------------
#
# soodar# sh running-config | section ^interface
# interface ge0
# interface ge1
# ip ospf network broadcast
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf bfd
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# interface ge2
- name: Gather OSPF Interfaces provided configurations
amnesh.soodar.soodar_ospf_interfaces:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "name": "ge2"
# },
# {
# "address_family": [
# {
# "adjacency": true,
# "afi": "ipv4",
# "bfd": true,
# "cost": {
# "interface_cost": 5
# },
# "dead_interval": {
# "time": 5
# },
# "network": {
# "broadcast": true
# },
# "priority": 25,
# "process": {
# "area_id": "30",
# "id": 10
# },
# "resync_timeout": 10,
# },
# {
# "adjacency": true,
# "afi": "ipv6",
# "priority": 55,
# "transmit_delay": 45
# }
# ],
# "name": "ge1"
# },
# {
# "name": "ge0"
# }
# ]
# After state:
# ------------
#
# soodar# sh running-config | section ^interface
# interface ge0
# interface ge1
# ip ospf network broadcast
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf bfd
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# interface ge2
# Using Rendered
- name: Render the commands for provided configuration
amnesh.soodar.soodar_ospf_interfaces:
config:
- name: ge1
address_family:
- afi: ipv4
process:
id: 10
area_id: 30
adjacency: true
bfd: true
cost:
interface_cost: 5
dead_interval:
time: 5
network:
broadcast: true
priority: 25
resync_timeout: 10
- afi: ipv6
adjacency: true
priority: 55
transmit_delay: 45
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "interface ge1",
# "ip ospf 10 area 30",
# "ip ospf bfd",
# "ip ospf cost 5",
# "ip ospf dead-interval 5",
# "ip ospf network broadcast",
# "ip ospf priority 25",
# "ip ospf resync-timeout 10",
# "ipv6 ospf priority 55",
# "ipv6 ospf transmit-delay 45"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# interface ge2
# interface ge1
# ip ospf network broadcast
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf bfd
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf 35 area 45
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# interface ge0
- name: Parse the provided configuration with the existing running configuration
amnesh.soodar.soodar_ospf_interfaces:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# },
# {
# "name": "ge2"
# },
# {
# "address_family": [
# {
# "afi": "ipv4",
# "bfd": true,
# "cost": {
# "interface_cost": 5
# },
# "dead_interval": {
# "time": 5
# },
# "network": {
# "broadcast": true
# },
# "priority": 25,
# "process": {
# "area_id": "30",
# "id": 10
# },
# },
# {
# "afi": "ipv6",
# "priority": 55,
# "process": {
# "area_id": "45",
# "id": 35
# },
# "transmit_delay": 45
# }
# ],
# "name": "ge1"
# },
# {
# "name": "ge0"
# }
# ]
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: |