cisco.nxos.nxos_vpc module – VPC resource module.
Note
This module is part of the cisco.nxos collection (version 14.0.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.nxos.
To use it in a playbook, specify: cisco.nxos.nxos_vpc.
New in cisco.nxos 1.0.0
Synopsis
This module manages global VPC domain configuration on devices running Cisco NX-OS.
Note
This module has a corresponding action plugin.
Aliases: vpc
Parameters
Parameter |
Comments |
|---|---|
Global VPC domain configuration. |
|
Enable or disable IP ARP synchronization between VPC peers. Choices:
|
|
Enable or disable auto-recovery. Choices:
|
|
Delay in seconds before auto-recovery after reload. |
|
Delay in seconds before VPC comes back up after reload. |
|
Delay in seconds before interface-vlan comes back up after reload. |
|
Delay in seconds for orphan port delay restore. |
|
VPC domain ID. Valid range is 1–1000; NX-OS rejects values outside this range. |
|
Enable or disable Layer 3 peer-router. Requires Choices:
|
|
Enable or disable IPv6 ND synchronization between VPC peers. Choices:
|
|
Enable or disable peer gateway. Choices:
|
|
Enable or disable peer-switch. Choices:
|
|
Destination (remote) IP address used for peer keepalive link. Required whenever any peer keepalive options are used. |
|
Source IP address used for peer keepalive link. |
|
VRF used for peer keepalive link. NX-OS does not write this to running-config when it is the default (Note) |
|
Role priority for device. Lower values are preferred. |
|
System priority. Must match between VPC peers. |
|
Destination IP address for the virtual peer-link. |
|
DSCP value for virtual peer-link packets (0–63). NX-OS silently appends |
|
Source IP address for the virtual peer-link. |
|
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 ‘^vpc domain’. The state parsed reads the configuration from |
|
The state the configuration should be left in. Choices:
|
Notes
Note
Tested against NX-OS 10.5(5) on N9K-C93180YC-FX3H.
Unsupported for Cisco MDS.
The feature vpc must be enabled before this module can be used.
If not using management vrf, the vrf must be globally configured on the device before using it in the peer-keepalive configuration.
Both pkl_src and pkl_dest are needed when changing peer-keepalive VRF.
NX-OS does not write default values to running-config, so role_priority, system_priority, delay_restore, delay_restore_interface_vlan, delay_restore_orphan_port and auto_recovery_reload_delay are reset by re-applying the platform default rather than by a
noform, which NX-OS rejects for some of these sub-commands.A boolean sub-command that is absent from running-config is reported and treated as
false.Only one VPC domain can exist at a time. With state
replacedoroverridden, supplying a different domain removes the existing domain first, which discards its configuration.Removing a peer-keepalive under state
replacedoroverriddenis disruptive. NX-OS rejects everyno peer-keepaliveform, so the module deletes the domain and recreates it with only the wanted configuration. This momentarily flaps the VPC peer relationship.When a peer-keepalive removal triggers a domain recreate, the module waits and retries internally for NX-OS to finish the async domain delete before reapplying configuration. This can add up to roughly 30 seconds to the task. If NX-OS has not finished within that window, the task fails and can safely be rerun.
Examples
# Using merged
# Before state:
# -------------
# (no vpc domain configured)
- name: Merge VPC global domain configuration
cisco.nxos.nxos_vpc:
config:
domain: "10"
role_priority: "150"
system_priority: "2000"
pkl_dest: 192.168.2.2
pkl_src: 192.168.2.1
pkl_vrf: management
peer_gw: true
auto_recovery: true
delay_restore: "150"
state: merged
# Task output:
# ------------
# commands:
# - terminal dont-ask
# - vpc domain 10
# - role priority 150
# - system-priority 2000
# - delay restore 150
# - auto-recovery
# - peer-gateway
# - peer-keepalive destination 192.168.2.2 source 192.168.2.1 vrf management
# After state:
# ------------
# vpc domain 10
# role priority 150
# system-priority 2000
# peer-keepalive destination 192.168.2.2 source 192.168.2.1
# delay restore 150
# peer-gateway
# auto-recovery
# Using replaced
# Before state:
# -------------
# vpc domain 10
# role priority 150
# system-priority 2000
# peer-keepalive destination 192.168.2.2 source 192.168.2.1
# delay restore 150
# peer-gateway
# auto-recovery
- name: Replace VPC global domain configuration
cisco.nxos.nxos_vpc:
config:
domain: "10"
pkl_dest: 192.168.2.2
pkl_src: 192.168.2.1
state: replaced
# Task output:
# ------------
# commands:
# - terminal dont-ask
# - vpc domain 10
# - role priority 32667
# - system-priority 32667
# - delay restore 60
# - no auto-recovery
# - no peer-gateway
# After state:
# ------------
# vpc domain 10
# peer-keepalive destination 192.168.2.2 source 192.168.2.1
# Using overridden
# Before state:
# -------------
# vpc domain 10
# peer-keepalive destination 192.168.2.2 source 192.168.2.1 vrf orange
# peer-switch
- name: Override VPC global domain configuration
cisco.nxos.nxos_vpc:
config:
domain: "10"
role_priority: "150"
state: overridden
# Task output:
# ------------
# commands:
# - terminal dont-ask
# - no vpc domain 10
# - vpc domain 10
# - role priority 150
# - no terminal dont-ask
# After state:
# ------------
# vpc domain 10
# role priority 150
# Using deleted
# Before state:
# -------------
# vpc domain 10
# peer-keepalive destination 192.168.2.2 source 192.168.2.1
- name: Delete VPC global domain configuration
cisco.nxos.nxos_vpc:
state: deleted
# Task output:
# ------------
# commands:
# - terminal dont-ask
# - no vpc domain 10
# - no terminal dont-ask
# After state:
# ------------
# (no vpc domain configured)
# Using gathered
# Device running-config:
# ----------------------
# vpc domain 10
# role priority 150
# system-priority 2000
# peer-keepalive destination 192.168.2.2 source 192.168.2.1
# delay restore 150
# peer-gateway
# auto-recovery
- name: Gather VPC global domain facts from the device
cisco.nxos.nxos_vpc:
state: gathered
# Task output:
# ------------
# gathered:
# domain: "10"
# role_priority: "150"
# system_priority: "2000"
# pkl_dest: 192.168.2.2
# pkl_src: 192.168.2.1
# peer_gw: true
# auto_recovery: true
# delay_restore: "150"
# Using rendered
- name: Render VPC configuration (offline, no device connection)
cisco.nxos.nxos_vpc:
config:
domain: "10"
role_priority: "150"
peer_gw: true
pkl_dest: 192.168.2.2
pkl_src: 192.168.2.1
pkl_vrf: management
state: rendered
# Task output:
# ------------
# rendered:
# - terminal dont-ask
# - vpc domain 10
# - role priority 150
# - peer-gateway
# - peer-keepalive destination 192.168.2.2 source 192.168.2.1 vrf management
# Using parsed
- name: Parse VPC configuration from provided running-config
cisco.nxos.nxos_vpc:
running_config: |
vpc domain 10
role priority 150
peer-keepalive destination 192.168.2.2 source 192.168.2.1 vrf orange
peer-gateway
auto-recovery
state: parsed
# Task output:
# ------------
# parsed:
# domain: "10"
# role_priority: "150"
# pkl_dest: 192.168.2.2
# pkl_src: 192.168.2.1
# pkl_vrf: orange
# peer_gw: true
# auto_recovery: true
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The resulting configuration after module invocation. 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 rendered in device-native format (offline). Returned: when state is Sample: |