cisco.ios.ios_bfd_templates module – Bidirectional Forwarding Detection (BFD) templates configurations
Note
This module is part of the cisco.ios collection (version 11.3.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.ios.
To use it in a playbook, specify: cisco.ios.ios_bfd_templates.
New in cisco.ios 11.3.0
Synopsis
Manages Bidirectional Forwarding Detection (BFD) templates configurations
Parameters
Parameter |
Comments |
|---|---|
A dictionary of bfd template options |
|
Configure authentication for the BFD template |
|
Name of the key chain to use for authentication |
|
Authentication type to use for BFD sessions Choices:
|
|
enables session dampening |
|
half-life period for the exponential decay algorithm, in minutes. |
|
The maximum amount of time a session can be suppressed, in minutes. |
|
The threshold at which a dampened session is allowed to be reused (taken out of dampening), in milliseconds. |
|
The threshold at which a session is suppressed (put into dampening), in milliseconds. |
|
enables the BFD echo function for all interfaces which uses this specific template. Choices:
|
|
type of template to be used Choices:
|
|
defines transmit interval between BFD packets |
|
The minimum interval in milliseconds that the local system is capable of supporting between received BFD control packets |
|
The minimum interval in milliseconds that the local system desires for transmitting BFD control packets |
|
Specifies the number of consecutive BFD control packets that must be missed from a BFD peer before BFD declares that the peer is unavailable and the Layer 3 BFD peer is informed of the failure. |
|
name of the BFD template to be used |
|
This option is used only with state parsed. The value of this option should be the output received from the IOS device by executing the command show running-config | section ^bfd-template. 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 The state The state purged removes BFD templates completely using a single top-level Choices:
|
Notes
Note
Tested against Cisco IOS XE Software, Version 17.13.01a on CML
This module works with connection
network_cliFor more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>`
For more information on using Ansible to manage Cisco devices see the `Cisco integration page <https://www.ansible.com/integrations/networks/cisco>`_.
Examples
# Using merged
# Before state:
# -------------
# router-ios#show running-config | section ^bfd-template
# (no BFD templates configured)
- name: Merge provided configuration with device configuration
cisco.ios.ios_bfd_templates:
config:
- name: template1
hop: single_hop
interval:
min_tx: 200
min_rx: 200
multiplier: 3
authentication:
type: sha_1
keychain: bfd_keychain
echo: true
- name: template2
hop: multi_hop
interval:
min_tx: 500
min_rx: 500
multiplier: 5
dampening:
half_life_period: 30
reuse_threshold: 2000
suppress_threshold: 5000
max_suppress_time: 120
state: merged
# Commands Fired:
# ---------------
# bfd-template single-hop template1
# interval min-tx 200 min-rx 200 multiplier 3
# authentication sha-1 keychain bfd_keychain
# echo
# bfd-template multi-hop template2
# interval min-tx 500 min-rx 500 multiplier 5
# dampening 30 2000 5000 120
# After state:
# ------------
# router-ios#show running-config | section ^bfd-template
# bfd-template single-hop template1
# interval min-tx 200 min-rx 200 multiplier 3
# authentication sha-1 keychain bfd_keychain
# echo
# bfd-template multi-hop template2
# interval min-tx 500 min-rx 500 multiplier 5
# dampening 30 2000 5000 120
# Using replaced
# Before state:
# -------------
# router-ios#show running-config | section ^bfd-template
# bfd-template single-hop template1
# interval min-tx 200 min-rx 200 multiplier 3
# authentication sha-1 keychain bfd_keychain
# echo
# bfd-template multi-hop template2
# interval min-tx 500 min-rx 500 multiplier 5
- name: Replace device configuration of specified BFD templates with provided configuration
cisco.ios.ios_bfd_templates:
config:
- name: template1
hop: single_hop
interval:
min_tx: 300
min_rx: 300
multiplier: 4
authentication:
type: sha_1
keychain: new_keychain
state: replaced
# Commands Fired:
# ---------------
# bfd-template single-hop template1
# no echo
# interval min-tx 300 min-rx 300 multiplier 4
# no authentication sha-1 keychain bfd_keychain
# authentication sha-1 keychain new_keychain
# After state:
# ------------
# router-ios#show running-config | section ^bfd-template
# bfd-template single-hop template1
# interval min-tx 300 min-rx 300 multiplier 4
# authentication sha-1 keychain new_keychain
# bfd-template multi-hop template2
# interval min-tx 500 min-rx 500 multiplier 5
# Using overridden
# Before state:
# -------------
# router-ios#show running-config | section ^bfd-template
# bfd-template single-hop template1
# interval min-tx 200 min-rx 200 multiplier 3
# bfd-template multi-hop template2
# interval min-tx 500 min-rx 500 multiplier 5
# bfd-template single-hop template3
# echo
- name: Override device configuration with provided configuration
cisco.ios.ios_bfd_templates:
config:
- name: template1
hop: single_hop
interval:
min_tx: 300
min_rx: 300
multiplier: 5
authentication:
type: md5
keychain: secure_key
state: overridden
# Commands Fired:
# ---------------
# no bfd-template multi-hop template2
# no bfd-template single-hop template3
# bfd-template single-hop template1
# interval min-tx 300 min-rx 300 multiplier 5
# authentication md5 keychain secure_key
# After state:
# ------------
# router-ios#show running-config | section ^bfd-template
# bfd-template single-hop template1
# interval min-tx 300 min-rx 300 multiplier 5
# authentication md5 keychain secure_key
# Using deleted
# Before state:
# -------------
# router-ios#show running-config | section ^bfd-template
# bfd-template single-hop template1
# interval min-tx 200 min-rx 200 multiplier 3
# authentication sha-1 keychain bfd_keychain
# echo
# bfd-template multi-hop template2
# interval min-tx 500 min-rx 500 multiplier 5
- name: Delete specified BFD template
cisco.ios.ios_bfd_templates:
config:
- name: template1
hop: single_hop
state: deleted
# Commands Fired:
# ---------------
# bfd-template single-hop template1
# no echo
# no interval min-tx 200 min-rx 200 multiplier 3
# no authentication sha-1 keychain bfd_keychain
# After state:
# ------------
# router-ios#show running-config | section ^bfd-template
# bfd-template single-hop template1
# bfd-template multi-hop template2
# interval min-tx 500 min-rx 500 multiplier 5
# Using deleted (to delete all BFD templates )
# Before state:
# -------------
# router-ios#show running-config | section ^bfd-template
# bfd-template single-hop template1
# interval min-tx 200 min-rx 200 multiplier 3
# bfd-template multi-hop template2
# interval min-tx 500 min-rx 500 multiplier 5
- name: Delete all BFD template configurations
cisco.ios.ios_bfd_templates:
state: deleted
# Commands Fired:
# ---------------
# bfd-template single-hop template1
# no interval min-tx 200 min-rx 200 multiplier 3
# bfd-template multi-hop template2
# no interval min-tx 500 min-rx 500 multiplier 5
# After state:
# ------------
# router-ios#show running-config | section ^bfd-template
# bfd-template single-hop template1
# bfd-template multi-hop template2
# Using purged
# Before state:
# -------------
# router-ios#show running-config | section ^bfd-template
# bfd-template single-hop template1
# interval min-tx 200 min-rx 200 multiplier 3
# bfd-template multi-hop template2
# interval min-tx 500 min-rx 500 multiplier 5
- name: Purge specified BFD template configurations (complete removal)
cisco.ios.ios_bfd_templates:
config:
- name: template1
hop: single_hop
state: purged
# Commands Fired:
# ---------------
# no bfd-template single-hop template1
# After state:
# ------------
# router-ios#show running-config | section ^bfd-template
# bfd-template multi-hop template2
# interval min-tx 500 min-rx 500 multiplier 5
# Using purged (to remove all BFD templates)
# Before state:
# -------------
# router-ios#show running-config | section ^bfd-template
# bfd-template single-hop template1
# interval min-tx 200 min-rx 200 multiplier 3
# authentication sha-1 keychain bfd_keychain
# bfd-template multi-hop template2
# interval min-tx 500 min-rx 500 multiplier 5
# bfd-template single-hop template3
# echo
- name: Purge all BFD template configurations (complete removal)
cisco.ios.ios_bfd_templates:
config: []
state: purged
# Commands Fired:
# ---------------
# no bfd-template single-hop template1
# no bfd-template multi-hop template2
# no bfd-template single-hop template3
# After state:
# ------------
# router-ios#show running-config | section ^bfd-template
# (no BFD templates configured)
# Using rendered
- name: Render platform specific commands from task input using rendered state
cisco.ios.ios_bfd_templates:
config:
- name: template1
hop: single_hop
interval:
min_tx: 200
min_rx: 200
multiplier: 3
authentication:
type: meticulous_sha_1
keychain: secure_chain
echo: true
state: rendered
# Module Execution Result:
# ------------------------
# "rendered": [
# "bfd-template single-hop template1",
# "interval min-tx 200 min-rx 200 multiplier 3",
# "authentication meticulous-sha-1 keychain secure_chain",
# "echo"
# ]
# Using gathered
- name: Gather BFD template configuration from the device
cisco.ios.ios_bfd_templates:
state: gathered
# Module Execution Result:
# ------------------------
# "gathered": [
# {
# "name": "template1",
# "hop": "single_hop",
# "interval": {
# "min_tx": 200,
# "min_rx": 200,
# "multiplier": 3
# },
# "authentication": {
# "type": "sha_1",
# "keychain": "bfd_keychain"
# },
# "echo": true
# }
# ]
# Using parsed
- name: Parse the provided configuration to structured format
cisco.ios.ios_bfd_templates:
running_config: |
bfd-template single-hop template1
interval min-tx 200 min-rx 200 multiplier 3
authentication sha-1 keychain bfd_keychain
echo
bfd-template multi-hop template2
dampening 30 2000 5000 120
state: parsed
# Module Execution Result:
# ------------------------
# "parsed": [
# {
# "name": "template1",
# "hop": "single_hop",
# "interval": {
# "min_tx": 200,
# "min_rx": 200,
# "multiplier": 3
# },
# "authentication": {
# "type": "sha_1",
# "keychain": "bfd_keychain"
# },
# "echo": true
# },
# {
# "name": "template2",
# "hop": "multi_hop",
# "dampening": {
# "half_life_period": 30,
# "reuse_threshold": 2000,
# "suppress_threshold": 5000,
# "max_suppress_time": 120
# }
# }
# ]
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The resulting configuration after module execution. Returned: when changed Sample: |
|
The configuration prior to the module invocation. Returned: always Sample: |
|
The set of commands pushed to the remote device. Returned: always Sample: |
|
Facts about the network resource gathered from the remote device as structured data. Returned: when state is Sample: |
|
The device native config provided in running_config option parsed into structured data as per module argspec. Returned: when state is Sample: |
|
The provided configuration in the task rendered in device native format (offline). Returned: when state is Sample: |