cisco.nxos.nxos_hsrp_interfaces – HSRP interfaces resource module
Note
This plugin is part of the cisco.nxos collection (version 2.8.2).
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.nxos
.
To use it in a playbook, specify: cisco.nxos.nxos_hsrp_interfaces
.
New in version 1.0.0: of cisco.nxos
Synopsis
Manages Hot Standby Router Protocol (HSRP) interface attributes.
Note
This module has a corresponding action plugin.
Parameters
Parameter |
Comments |
---|---|
The provided configuration |
|
Enable/Disable HSRP Bidirectional Forwarding Detection (BFD) on the interface. Choices:
|
|
The name of the interface. |
|
This option is used only with state parsed. The value of this option should be the output received from the NX-OS device by executing the command show running-config | section ‘^interface’. The state parsed reads the configuration from |
|
The state the configuration should be left in Choices:
|
Notes
Note
Tested against NX-OS 7.0(3)I5(1).
Feature bfd should be enabled for this module.
Unsupported for Cisco MDS
Examples
# Using deleted
- name: Configure hsrp attributes on interfaces
cisco.nxos.nxos_hsrp_interfaces:
config:
- name: Ethernet1/1
- name: Ethernet1/2
operation: deleted
# Using merged
- name: Configure hsrp attributes on interfaces
cisco.nxos.nxos_hsrp_interfaces:
config:
- name: Ethernet1/1
bfd: enable
- name: Ethernet1/2
bfd: disable
operation: merged
# Using overridden
- name: Configure hsrp attributes on interfaces
cisco.nxos.nxos_hsrp_interfaces:
config:
- name: Ethernet1/1
bfd: enable
- name: Ethernet1/2
bfd: disable
operation: overridden
# Using replaced
- name: Configure hsrp attributes on interfaces
cisco.nxos.nxos_hsrp_interfaces:
config:
- name: Ethernet1/1
bfd: enable
- name: Ethernet1/2
bfd: disable
operation: replaced
# Using rendered
- name: Use rendered state to convert task input to device specific commands
cisco.nxos.nxos_hsrp_interfaces:
config:
- name: Ethernet1/800
bfd: enable
- name: Ethernet1/801
bfd: enable
state: rendered
# Task Output (redacted)
# -----------------------
# rendered:
# - "interface Ethernet1/800"
# - "hsrp bfd"
# - "interface Ethernet1/801"
# - "hsrp bfd"
# Using parsed
# parsed.cfg
# ------------
# interface Ethernet1/800
# no switchport
# hsrp bfd
# interface Ethernet1/801
# no switchport
# hsrp bfd
- name: Use parsed state to convert externally supplied config to structured format
cisco.nxos.nxos_hsrp_interfaces:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Task output (redacted)
# -----------------------
# parsed:
# - name: Ethernet1/800
# bfd: enable
# - name: Ethernet1/801
# bfd: enable
# Using gathered
# Existing device config state
# -------------------------------
# interface Ethernet1/1
# no switchport
# hsrp bfd
# interface Ethernet1/2
# no switchport
# hsrp bfd
# interface Ethernet1/3
# no switchport
- name: Gather hsrp_interfaces facts from the device using nxos_hsrp_interfaces
cisco.nxos.nxos_hsrp_interfaces:
state: gathered
# Task output (redacted)
# -----------------------
# gathered:
# - name: Ethernet1/1
# bfd: enable
# - name: Ethernet1/2
# bfd: enable
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 returned will always be in the same format\n of the parameters above.\n” |
|
The configuration prior to the model invocation. Returned: always Sample: “The configuration returned will always be in the same format\n of the parameters above.\n” |
|
The set of commands pushed to the remote device. Returned: always Sample: [“interface Ethernet1/1”, “hsrp bfd”] |
Authors
Chris Van Heuveln (@chrisvanheuveln)