Skip to content

Latest commit

 

History

History
3056 lines (2966 loc) · 122 KB

cisco.iosxr.iosxr_ospf_interfaces_module.rst

File metadata and controls

3056 lines (2966 loc) · 122 KB

cisco.iosxr.iosxr_ospf_interfaces

Resource module to configure OSPF interfaces.

Version added: 1.2.0

  • This module manages OSPF(v2/v3) configuration of interfaces on devices running Cisco IOS-XR.
Parameter Choices/Defaults Comments
config
list / elements=dictionary
A list of OSPF configuration for interfaces.
address_family
list / elements=dictionary
OSPF settings on the interfaces in address-family context.
afi
string / required
    Choices:
  • ipv4
  • ipv6
Address Family Identifier (AFI) for OSPF settings on the interfaces.
apply_group_option
dictionary
Specify configuration from a group
group_name
string
Specify the name of the group
operation
string
    Choices:
  • add
  • remove
  • append
Specify the group config operation
authentication
dictionary
Enable authentication
message_digest
dictionary
Use message-digest authentication
keychain
string
Specify keychain name
null_auth
boolean
    Choices:
  • no
  • yes
Use no authentication
authentication_key
dictionary
Specify authentication password (key)
clear
string
Specifies an UNENCRYPTED password (key) will follow
encrypted
string
Specifies an ENCRYPTED password (key) will follow
password
string
The OSPFv2 password (key)
bfd
dictionary
Configure BFD parameters
fast_detect
dictionary
Configure fast detection
set
boolean
    Choices:
  • no
  • yes
Enable fast detection only
strict_mode
boolean
    Choices:
  • no
  • yes
Hold down neighbor session until BFD session is up
minimum_interval
integer
Hello interval in milli-seconds
multiplier
integer
Detect multiplier
cost
integer
Specify Interface cost
cost_fallback
dictionary
Specify Cost when cumulative bandwidth goes below the theshold
cost
integer
Specify cost w.r.t cummulative bandwidth
threshold
integer
Specify threshold bandwidth when cost-fallback is applied
database_filter
dictionary
Filter OSPF LSAs during synchronization and flooding
all_outgoing_lsa
boolean
    Choices:
  • no
  • yes
Filter all outgoing LSA
dead_interval
integer
Specify interval after which a neighbor is declared dead
demand_circuit
boolean
    Choices:
  • no
  • yes
Enable/Disable demand circuits
fast_reroute
dictionary
Specify IP Fast Reroute
disabled
boolean
    Choices:
  • no
  • yes
Disable IP fast reroute
per_link
dictionary
Specify per-prefix computation
information_type
string
    Choices:
  • exclude
  • lfa_candidate
Specify per-link LFA exclusion or FRR LFA candidate information
interface
dictionary
Specify Per-link LFA exclusion information
bundle_ether
list / elements=dictionary
Specify Aggregated Ethernet interface(s)
name
integer
Specify the interface id
bvi
list / elements=dictionary
Specify Bridge-Group Virtual Interface
name
integer
Specify the interface id
fast_ethernet
list / elements=dictionary
Specify FastEthernet/IEEE 802.3 interface(s)
name
string
Specify the interface id
fiftygige
list / elements=dictionary
Specify FiftyGigE/IEEE 802.3 interface(s)
name
string
Specify the interface id
fortygige
list / elements=dictionary
Specify FortyGigE/IEEE 802.3 interface(s)
name
string
Specify the interface id
fourhundredgige
list / elements=dictionary
Specify FourHundredGigE/IEEE 802.3 interface(s)
name
string
Specify the interface id
gigabitethernet
list / elements=dictionary
Specify GigabitEthernet/IEEE 802.3 interface(s)
name
string
Specify the interface id
hundredgige
list / elements=dictionary
Specify HundredGigE/IEEE 802.3 interface(s)
name
string
Specify the interface id
mgmteth
list / elements=dictionary
Specify MgmtEth/IEEE 802.3 interface(s)
name
string
Specify the interface id
multilink
list / elements=dictionary
Specify Multilink network interface(s)
name
string
Specify the interface id
nve
list / elements=dictionary
Specify Network Virtualization Endpoint Interface(s)
name
integer
Specify the interface id
pos_int
list / elements=dictionary
Specify Aggregated pos interface(s)
name
integer
Specify the interface id
pw_ether
list / elements=dictionary
Specify PWHE Ethernet Interface
name
integer
Specify the interface id
pw_iw
list / elements=dictionary
Specify PWHE VC11 IP Interworking Interface
name
integer
Specify the interface id
serial
list / elements=dictionary
Specify Serial network interface(s)
name
string
Specify the interface id
srp
list / elements=dictionary
Specify SRP interface(s)
name
string
Specify the interface id
tengige
list / elements=dictionary
Specify TenGigabitEthernet/IEEE 802.3 interface(s)
name
string
Specify the interface id
tunnel_ip
list / elements=dictionary
Specify GRE/IPinIP Tunnel Interface(s)
name
integer
Specify the interface id
tunnel_ipsec
list / elements=dictionary
Specify IPSec Tunnel interface(s)
name
integer
Specify the interface id
tunnel_mpls
list / elements=dictionary
MPLS Transport Protocol Tunnel interface
name
string
Specify the interface id
tunnel_mte
list / elements=dictionary
Specify MPLS Traffic Engineering P2MP Tunnel interface(s)
name
integer
Specify the interface id
twentyfivegige
list / elements=dictionary
Specify TwentyFiveGigabitEthernet/IEEE 802.3 interface(s)
name
string
Specify the interface id
twohundredgige
list / elements=dictionary
Specify TwoHundredGigE/IEEE 802.3 interface(s)
name
string
Specify the interface id
use_candidate_only
boolean
    Choices:
  • no
  • yes
Enable/Disable backup selection from candidate-list only
flood_reduction
boolean
    Choices:
  • no
  • yes
Enable/Disable flood reduction
hello_interval
integer
Specify Time between HELLO packets
link_down_fast_detect
boolean
    Choices:
  • no
  • yes
Configure interface down parameters
message_digest_key
dictionary
Message digest authentication password (key)
id
integer / required
Key ID
md5
dictionary / required
Use MD5 Algorithm
clear
boolean
    Choices:
  • no
  • yes
Specifies an UNENCRYPTED password (key) will follow
encrypted
boolean
    Choices:
  • no
  • yes
Specifies an ENCRYPTED password (key) will follow
password
string
The OSPFv2 password (key)
mpls_ldp_sync
boolean
    Choices:
  • no
  • yes
Enable/Disable MPLS LDP Sync
mtu_ignore
boolean
    Choices:
  • no
  • yes
Enable/Disable ignoring of MTU in DBD packets
neighbors
list / elements=dictionary
Specify a neighbor routers
cost
integer
Specify OSPF cost for point-to-multipoint neighbor
db_filter_all_out
boolean
    Choices:
  • no
  • yes
Specify Filter OSPF LSA during synchronization and flooding for point-to-multipoint neighbor
neighbor_id
string
Specify Neighbor address (name)
poll_interval
integer
Specify OSPF dead-router polling interval
priority
integer
Specify OSPF priority of non-broadcast neighbor
network
string
    Choices:
  • broadcast
  • non-broadcast
  • point-to-multipoint
  • point-to-point
Specify Network type
packet_size
integer
Customize size of OSPF packets upto MTU
passive
boolean
    Choices:
  • no
  • yes
Enable/Disable passive
prefix_suppression
boolean
    Choices:
  • no
  • yes
Suppress advertisement of the prefixes
priority
integer
Specify Router priority
processes
list / elements=dictionary
Interfaces configuration for an OSPF process.
area
dictionary
Specify the area-id
area_id
string
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)
process_id
string / required
OSPF process tag.
retransmit_interval
integer
Specify time between retransmitting lost link state advertisements
security_ttl
dictionary
Enable security
hops
integer
Maximum number of IP hops allowed <1-254>
set
boolean
    Choices:
  • no
  • yes
Enable ttl security
transmit_delay
integer
Specify estimated time needed to send link-state update packet
name
string / required
Name/Identifier of the interface.
type
string / required
Type of the interface.
running_config
string
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 running_config option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the parsed key within the result.
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
  • gathered
  • parsed
  • rendered
The state the configuration should be left in.

Note

# 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

#
#
# Task Output:
# ------------
#
# 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 LAB3
#  area 0.0.0.3
#   interface GigabitEthernet0/0/0/0
#    cost 20
#    authentication message-digest keychain cisco
#   !
#  !
# !
# router ospfv3 LAB3
#  area 0.0.0.2
#   interface GigabitEthernet0/0/0/0
#    cost 30
#   !
#  !
# !

# 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 LAB3
#  area 0.0.0.3
#   interface GigabitEthernet0/0/0/0
#    cost 20
#    authentication message-digest keychain cisco
#   !
#  !
# !
# router ospfv3 LAB3
#  area 0.0.0.2
#   interface GigabitEthernet0/0/0/0
#    cost 30
#   !
#  !
# !

- 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
#
# Task Output:
# ------------
#
# 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 LAB3
#  area 0.0.0.3
#   interface GigabitEthernet0/0/0/0
#    cost 30
#    authentication message-digest keychain ciscoiosxr
#   !
# router ospfv3 LAB3
#  area 0.0.0.2
#   interface GigabitEthernet0/0/0/0
#    cost 30
#   !
#  !
# !

# Using overridden
#
# Before state
# ------------
#
- 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

#
#
# Task Output:
# ------------
#
# 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 LAB1
#  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 ospfv3 LAB3
#  area 0.0.0.2
#  !
# !

# 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 LAB1
#  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
#   interface GigabitEthernet0/0/0/0
#    cost 20
#    authentication message-digest keychain cisco
#   !
#  !
# !
# router ospfv3 LAB3
#  area 0.0.0.2
#   interface GigabitEthernet0/0/0/0
#    cost 30
#   !
#  !
# !

- name: Deleted existing OSPF interfaces from the device
  cisco.iosxr.iosxr_ospf_interfaces:
    config:
      - name: GigabitEthernet0/0/0/1
        type: gigabitethernet
    state: deleted

#
# Task Output:
# ------------
#
# 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
#   - 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:
#   - no router ospf LAB1 area 0.0.0.3 interface GigabitEthernet 0/0/0/1]
#
# 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:34:38.319 UTC
# router ospf LAB1
#  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 ospfv3 LAB3
#  area 0.0.0.2
#   interface GigabitEthernet0/0/0/0
#    cost 30
#   !
#  !
# !

# 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 running config and display structured facts.
  cisco.iosxr.iosxr_ospf_interfaces:
    running_config: "{{ lookup('file', './parsed.cfg') }}"
    state: parsed
#
# Task Output:
# ------------
#
# 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

#
# Task Output:
# ------------
#
# 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 LAB3
#  area 0.0.0.3
#   interface GigabitEthernet0/0/0/0
#    cost 20
#    authentication message-digest keychain cisco
#   !
#  !
# !
# router ospfv3 LAB3
#  area 0.0.0.2
#   interface GigabitEthernet0/0/0/0
#    cost 30
#   !
#  !
# !


- name: Gather ospf_interfaces routes configuration
  cisco.iosxr.iosxr_ospf_interfaces:
    state: gathered
#
# Task Output:
# ------------
#
# 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

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
after
list
when changed
The resulting configuration model invocation.

Sample:
The configuration returned will always be in the same format of the parameters above.
before
list
always
The configuration prior to the model invocation.

Sample:
The configuration returned will always be in the same format of the parameters above.
commands
list
always
The set of commands pushed to the remote device.

Sample:
['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']
gathered
list
when state is gathered
Facts about the network resource gathered from the remote device as structured data.

Sample:
This output will always be in the same format as the module argspec.
parsed
list
when state is parsed
The device native config provided in running_config option parsed into structured data as per module argspec.

Sample:
This output will always be in the same format as the module argspec.
rendered
list
when state is rendered
The provided configuration in the task rendered in device-native format (offline).

Sample:
['router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 cost 20']


Authors

  • Rohit Thakur (@rohitthakur2590)