cisco.nxos.nxos_hsrp_interfaces – HSRP interfaces resource module¶
Note
This plugin is part of the cisco.nxos collection (version 1.4.0).
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¶
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:
Authors¶
Chris Van Heuveln (@chrisvanheuveln)