cisco.iosxr.iosxr_ospfv3 – ospfv3 resource module¶
Note
This plugin is part of the cisco.iosxr collection (version 1.2.1).
To install it use: ansible-galaxy collection install cisco.iosxr
.
To use it in a playbook, specify: cisco.iosxr.iosxr_ospfv3
.
New in version 1.1.0: of cisco.iosxr
Synopsis¶
This module manages global ospfv3 configuration on devices running Cisco IOS-XR
Note
This module has a corresponding action plugin.
Parameters¶
Notes¶
Note
Tested against IOS-XR 6.1.3
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 ospfv3
# Thu Jun 11 15:54:44.569 UTC
# % No such configuration item(s)
#
- name: Merge provided OSPFv3 configuration with the existing configuration
cisco.iosxr.iosxr_ospfv3:
config:
processes:
- process_id: 27
areas:
- area_id: 10
hello_interval: 2
- process_id: 26
authentication:
disable: true
- process_id: 10
areas:
- area_id: 11
default_cost: 5
cost: 11
- area_id: 22
default_cost: 6
- process_id: 30
areas:
- area_id: 11
default_cost: 5
- area_id: 22
default_cost: 6
cost: 2
default_metric: 10
transmit_delay: 2
hello_interval: 1
dead_interval: 2
retransmit_interval: 2
packet_size: 577
priority: 1
router_id: '2.2.2.2'
demand_circuit: true
mtu_ignore: true
state: merged
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
# "before": {}
#
# "commands": [
# "router ospfv3 10",
# "area 11 default-cost 5",
# "area 11 cost 11",
# "area 22 default-cost 6",
# "router ospfv3 26",
# "authentication disable",
# "router ospfv3 27",
# "area 10 hello-interval 2",
# "router ospfv3 30",
# "cost 2",
# "priority 1",
# "default-metric 10",
# "router-id 2.2.2.2",
# "demand-circuit",
# "packet-size 577",
# "transmit-delay 2",
# "dead-interval 2",
# "hello-interval 1",
# "retransmit-interval 2",
# "mtu-ignore",
# "area 11 default-cost 5",
# "area 22 default-cost 6"
# ]
#
# "after": {
# "processes": [
# {
# "areas": [
# {
# "area_id": "11",
# "cost": 11,
# "default_cost": 5
# },
# {
# "area_id": "22",
# "default_cost": 6
# }
# ],
# "process_id": "10"
# },
# {
# "authentication": {
# "disable": true
# },
# "process_id": "26"
# },
# {
# "areas": [
# {
# "area_id": "10",
# "hello_interval": 2
# }
# ],
# "process_id": "27"
# },
# {
# "areas": [
# {
# "area_id": "11",
# "default_cost": 5
# },
# {
# "area_id": "22",
# "default_cost": 6
# }
# ],
# "cost": 2,
# "dead_interval": 2,
# "default_metric": 10,
# "demand_circuit": true,
# "hello_interval": 1,
# "mtu_ignore": true,
# "packet_size": 577,
# "priority": 1,
# "process_id": "30",
# "retransmit_interval": 2,
# "router_id": "2.2.2.2",
# "transmit_delay": 2
# }
# ]
# }
#
#
# ------------
# After state
# ------------
#
# RP/0/RP0/CPU0:anton#show running-config router ospfv3
# router ospfv3 10
# area 11
# cost 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# !
# router ospfv3 26
# authentication disable
# !
# router ospfv3 27
# area 10
# hello-interval 2
# !
# area 20
# !
# area 30
# !
# !
# router ospfv3 30
# cost 2
# priority 1
# mtu-ignore
# packet-size 577
# dead-interval 2
# retransmit-interval 2
# demand-circuit
# hello-interval 1
# transmit-delay 2
# router-id 2.2.2.2
# default-metric 10
# area 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# router ospfv3 10
# area 11
# cost 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# !
# router ospfv3 26
# authentication disable
# !
# router ospfv3 27
# area 10
# hello-interval 2
# !
# area 20
# !
# area 30
# !
# !
# router ospfv3 30
# cost 2
# priority 1
# mtu-ignore
# packet-size 577
# dead-interval 2
# retransmit-interval 2
# demand-circuit
# hello-interval 1
# transmit-delay 2
# router-id 2.2.2.2
# default-metric 10
# area 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# !
# Using replaced
#
# ------------
# Before state
# ------------
#
#
# RP/0/RP0/CPU0:anton#show running-config router ospf
# router ospfv3 10
# area 11
# cost 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# !
# router ospfv3 26
# authentication disable
# !
# router ospfv3 27
# area 10
# hello-interval 2
# !
# area 20
# !
# area 30
# !
# !
# router ospfv3 30
# cost 2
# priority 1
# mtu-ignore
# packet-size 577
# dead-interval 2
# retransmit-interval 2
# demand-circuit
# hello-interval 1
# transmit-delay 2
# router-id 2.2.2.2
# default-metric 10
# area 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# router ospfv3 10
# area 11
# cost 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# !
# router ospfv3 26
# authentication disable
# !
# router ospfv3 27
# area 10
# hello-interval 2
# !
# area 20
# !
# area 30
# !
# !
# router ospfv3 30
# cost 2
# priority 1
# mtu-ignore
# packet-size 577
# dead-interval 2
# retransmit-interval 2
# demand-circuit
# hello-interval 1
# transmit-delay 2
# router-id 2.2.2.2
# default-metric 10
# area 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# !
- name: Replace OSPFv3 routes configurations from the device
cisco.iosxr.iosxr_ospfv3:
config:
processes:
- process_id: 27
areas:
- area_id: 10
hello_interval: 2
- area_id: 20
cost: 2
default_cost: 2
- process_id: 26
authentication:
disable: true
state: replaced
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
# "before": {
# "processes": [
# {
# "areas": [
# {
# "area_id": "11",
# "cost": 11,
# "default_cost": 5
# },
# {
# "area_id": "22",
# "default_cost": 6
# }
# ],
# "process_id": "10"
# },
# {
# "authentication": {
# "disable": true
# },
# "process_id": "26"
# },
# {
# "areas": [
# {
# "area_id": "10",
# "hello_interval": 2
# }
# ],
# "process_id": "27"
# },
# {
# "areas": [
# {
# "area_id": "11",
# "default_cost": 5
# },
# {
# "area_id": "22",
# "default_cost": 6
# }
# ],
# "cost": 2,
# "dead_interval": 2,
# "default_metric": 10,
# "demand_circuit": true,
# "hello_interval": 1,
# "mtu_ignore": true,
# "packet_size": 577,
# "priority": 1,
# "process_id": "30",
# "retransmit_interval": 2,
# "router_id": "2.2.2.2",
# "transmit_delay": 2
# }
# ]
# }
#
# "commands": [
# "router ospfv3 27",
# "area 20 default-cost 2",
# "area 20 cost 2"
# ]
#
# "after": {
# "processes": [
# {
# "areas": [
# {
# "area_id": "11",
# "cost": 11,
# "default_cost": 5
# },
# {
# "area_id": "22",
# "default_cost": 6
# }
# ],
# "process_id": "10"
# },
# {
# "authentication": {
# "disable": true
# },
# "process_id": "26"
# },
# {
# "areas": [
# {
# "area_id": "10",
# "hello_interval": 2
# },
# {
# "area_id": "20",
# "cost": 2,
# "default_cost": 2
# }
# ],
# "process_id": "27"
# },
# {
# "areas": [
# {
# "area_id": "11",
# "default_cost": 5
# },
# {
# "area_id": "22",
# "default_cost": 6
# }
# ],
# "cost": 2,
# "dead_interval": 2,
# "default_metric": 10,
# "demand_circuit": true,
# "hello_interval": 1,
# "mtu_ignore": true,
# "packet_size": 577,
# "priority": 1,
# "process_id": "30",
# "retransmit_interval": 2,
# "router_id": "2.2.2.2",
# "transmit_delay": 2
# }
# ]
# }
#
#
# -----------
# After state
# -----------
#
# RP/0/RP0/CPU0:anton(config)#do show running-config router ospfv3
# router ospfv3 10
# area 11
# cost 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# !
# router ospfv3 26
# authentication disable
# !
# router ospfv3 27
# area 10
# hello-interval 2
# !
# area 20
# cost 2
# default-cost 2
# !
# area 30
# !
# !
# router ospfv3 30
# cost 2
# priority 1
# mtu-ignore
# packet-size 577
# dead-interval 2
# retransmit-interval 2
# demand-circuit
# hello-interval 1
# transmit-delay 2
# router-id 2.2.2.2
# default-metric 10
# area 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# !
- name: Override existing OSPFv3 configurations from the device
cisco.iosxr.iosxr_ospfv3:
config:
processes:
- process_id: 27
areas:
- area_id: 10
hello_interval: 2
authentication:
disable: true
- area_id: 20
cost: 2
default_cost: 2
authentication:
disable: true
- process_id: 26
areas:
- area_id: 10
hello_interval: 2
authentication:
disable: true
state: overridden
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
# "before": {
# "processes": [
# {
# "areas": [
# {
# "area_id": "11",
# "cost": 11,
# "default_cost": 5
# },
# {
# "area_id": "22",
# "default_cost": 6
# }
# ],
# "process_id": "10"
# },
# {
# "authentication": {
# "disable": true
# },
# "process_id": "26"
# },
# {
# "areas": [
# {
# "area_id": "10",
# "hello_interval": 2
# },
# {
# "area_id": "20",
# "cost": 2,
# "default_cost": 2
# }
# ],
# "process_id": "27"
# },
# {
# "areas": [
# {
# "area_id": "11",
# "default_cost": 5
# },
# {
# "area_id": "22",
# "default_cost": 6
# }
# ],
# "cost": 2,
# "dead_interval": 2,
# "default_metric": 10,
# "demand_circuit": true,
# "hello_interval": 1,
# "mtu_ignore": true,
# "packet_size": 577,
# "priority": 1,
# "process_id": "30",
# "retransmit_interval": 2,
# "router_id": "2.2.2.2",
# "transmit_delay": 2
# }
# ]
# }
#
# "commands": [
# "router ospfv3 10",
# "no area 11 default-cost 5",
# "no area 11 cost 11",
# "no area 22 default-cost 6",
# "router ospfv3 30",
# "no cost 2",
# "no priority 1",
# "no default-metric 10",
# "no router-id 2.2.2.2",
# "no demand-circuit",
# "no packet-size 577",
# "no transmit-delay 2",
# "no dead-interval 2",
# "no hello-interval 1",
# "no retransmit-interval 2",
# "no mtu-ignore",
# "no area 11 default-cost 5",
# "no area 22 default-cost 6",
# "router ospfv3 26",
# "area 10 hello-interval 4"
# ]
#
# "after": {
# "processes": [
# {
# "process_id": "10"
# },
# {
# "areas": [
# {
# "area_id": "10",
# "hello_interval": 4
# }
# ],
# "authentication": {
# "disable": true
# },
# "process_id": "26"
# },
# {
# "areas": [
# {
# "area_id": "10",
# "hello_interval": 2
# },
# {
# "area_id": "20",
# "cost": 2,
# "default_cost": 2
# }
# ],
# "process_id": "27"
# },
# {
# "process_id": "30"
# }
# ]
# }
#
#
# -----------
# After state
# -----------
#
# RP/0/RP0/CPU0:anton#show running-config router ospfv3
# router ospfv3 10
# area 11
# !
# area 22
# !
# !
# router ospfv3 26
# authentication disable
# area 10
# hello-interval 4
# !
# !
# router ospfv3 27
# area 10
# hello-interval 2
# !
# area 20
# cost 2
# default-cost 2
# !
# area 30
# !
# !
# router ospfv3 30
# area 11
# !
# area 22
# !
# !
# Using deleted
#
# ------------
# Before state
# ------------
#
#
# RP/0/RP0/CPU0:anton#show running-config router ospfv3
# router ospfv3 10
# area 11
# !
# area 22
# !
# !
# router ospfv3 26
# authentication disable
# area 10
# hello-interval 4
# !
# !
# router ospfv3 27
# area 10
# hello-interval 2
# !
# area 20
# cost 2
# default-cost 2
# !
# area 30
# !
# !
# router ospfv3 30
# area 11
# !
# area 22
# !
# !
- name: Deleted existing OSPFv3 configurations from the device
cisco.iosxr.iosxr_ospfv3:
config:
processes:
- process_id: '10'
- process_id: '26'
- process_id: '27'
- process_id: '30'
state: deleted
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
# "before": {
# "processes": [
# {
# "process_id": "10"
# },
# {
# "areas": [
# {
# "area_id": "10",
# "hello_interval": 4
# }
# ],
# "authentication": {
# "disable": true
# },
# "process_id": "26"
# },
# {
# "areas": [
# {
# "area_id": "10",
# "hello_interval": 2
# },
# {
# "area_id": "20",
# "cost": 2,
# "default_cost": 2
# }
# ],
# "process_id": "27"
# },
# {
# "process_id": "30"
# }
# ]
# },
#
# "commands": [
# "router ospfv3 26",
# "no authentication disable",
# "no area 10 hello-interval 4",
# "router ospfv3 27",
# "no area 10 hello-interval 2",
# "no area 20 default-cost 2",
# "no area 20 cost 2"
# ]
#
# "after": {
# "processes": [
# {
# "process_id": "10"
# },
# {
# "process_id": "26"
# },
# {
# "process_id": "27"
# },
# {
# "process_id": "30"
# }
# ]
# }
#
#
# -----------
# After state
# -----------
#
# RP/0/RP0/CPU0:anton(config)#show running-config router ospfv3
# router ospfv3 10
# !
# router ospfv3 26
# !
# router ospfv3 27
# !
# router ospfv3 30
# !
# Using parsed
# parsed.cfg
# ------------
# router ospfv3 10
# area 11
# cost 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# !
# router ospfv3 26
# authentication disable
# !
# router ospfv3 27
# area 10
# hello-interval 2
# !
# !
# router ospfv3 30
# router-id 2.2.2.2
# cost 2
# packet-size 577
# priority 1
# mtu-ignore
# dead-interval 2
# retransmit-interval 2
# demand-circuit
# hello-interval 1
# transmit-delay 2
# default-metric 10
# area 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# !
- name: Parsed the device configuration to get output commands
cisco.iosxr.iosxr_ospfv3:
running_config: "{{ lookup('file', './parsed.cfg') }}"
state: parsed
#
#
# -------------------------
# Module Execution Result
# -------------------------
#
#
# "parsed": {
# "processes": [
# {
# "areas": [
# {
# "area_id": "11",
# "cost": 11,
# "default_cost": 5
# },
# {
# "area_id": "22",
# "default_cost": 6
# }
# ],
# "process_id": "10"
# },
# {
# "authentication": {
# "disable": true
# },
# "process_id": "26"
# },
# {
# "areas": [
# {
# "area_id": "10",
# "hello_interval": 2
# }
# ],
# "process_id": "27"
# },
# {
# "areas": [
# {
# "area_id": "11",
# "default_cost": 5
# },
# {
# "area_id": "22",
# "default_cost": 6
# }
# ],
# "cost": 2,
# "dead_interval": 2,
# "default_metric": 10,
# "demand_circuit": true,
# "hello_interval": 1,
# "mtu_ignore": true,
# "packet_size": 577,
# "priority": 1,
# "process_id": "30",
# "retransmit_interval": 2,
# "router_id": "2.2.2.2",
# "transmit_delay": 2
# }
# ]
# }
#
# Using rendered
#
#
- name: Render the commands for provided configuration
cisco.iosxr.iosxr_ospfv3:
config:
processes:
- process_id: 27
areas:
- area_id: 10
hello_interval: 2
- process_id: 26
authentication:
disable: true
- process_id: 10
areas:
- area_id: 11
default_cost: 5
cost: 11
- area_id: 22
default_cost: 6
- process_id: 30
areas:
- area_id: 11
default_cost: 5
- area_id: 22
default_cost: 6
cost: 2
default_metric: 10
transmit_delay: 2
hello_interval: 1
dead_interval: 2
retransmit_interval: 2
packet_size: 577
priority: 1
router_id: '2.2.2.2'
demand_circuit: true
mtu_ignore: true
state: rendered
#
#
# -------------------------
# Module Execution Result
# -------------------------
#
#
# "rendered": [
# "router ospfv3 27",
# "area 10 hello-interval 2",
# "router ospfv3 26",
# "authentication disable",
# "router ospfv3 10",
# "area 11 default-cost 5",
# "area 11 cost 11",
# "area 22 default-cost 6",
# "router ospfv3 30",
# "cost 2",
# "priority 1",
# "default-metric 10",
# "router-id 2.2.2.2",
# "demand-circuit",
# "packet-size 577",
# "transmit-delay 2",
# "dead-interval 2",
# "hello-interval 1",
# "retransmit-interval 2",
# "mtu-ignore",
# "area 11 default-cost 5",
# "area 22 default-cost 6"
# ]
# Using gathered
#
# Before state:
# -------------
#
# RP/0/RP0/CPU0:anton#show running-config router ospf
# router ospfv3 10
# area 11
# cost 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# !
# router ospfv3 26
# authentication disable
# area 10
# !
# !
# router ospfv3 27
# area 10
# hello-interval 2
# !
# area 20
# !
# area 30
# !
# !
# router ospfv3 30
# cost 2
# priority 1
# mtu-ignore
# packet-size 577
# dead-interval 2
# retransmit-interval 2
# demand-circuit
# hello-interval 1
# transmit-delay 2
# router-id 2.2.2.2
# default-metric 10
# area 11
# default-cost 5
# !
# area 22
# default-cost 6
# !
# !
- name: Gather ospfv3 routes configuration
cisco.iosxr.iosxr_ospfv3:
state: gathered
#
#
# -------------------------
# Module Execution Result
# -------------------------
#
# "gathered": {
# "processes": [
# {
# "areas": [
# {
# "area_id": "11",
# "cost": 11,
# "default_cost": 5
# },
# {
# "area_id": "22",
# "default_cost": 6
# }
# ],
# "process_id": "10"
# },
# {
# "authentication": {
# "disable": true
# },
# "process_id": "26"
# },
# {
# "areas": [
# {
# "area_id": "10",
# "hello_interval": 2
# }
# ],
# "process_id": "27"
# },
# {
# "areas": [
# {
# "area_id": "11",
# "default_cost": 5
# },
# {
# "area_id": "22",
# "default_cost": 6
# }
# ],
# "cost": 2,
# "dead_interval": 2,
# "default_metric": 10,
# "demand_circuit": true,
# "hello_interval": 1,
# "mtu_ignore": true,
# "packet_size": 577,
# "priority": 1,
# "process_id": "30",
# "retransmit_interval": 2,
# "router_id": "2.2.2.2",
# "transmit_delay": 2
# }
# ]
# }
#
Authors¶
Rohit Thakur (@rohitthakur2590)