HSRP interfaces resource module
Version added: 1.0.0
- Manages Hot Standby Router Protocol (HSRP) interface attributes.
Note
- Tested against NX-OS 7.0(3)I5(1).
- Feature bfd should be enabled for this module.
- Unsupported for Cisco MDS
# 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
Common return values are documented here, the following are the fields unique to this module:
- Chris Van Heuveln (@chrisvanheuveln)