dellemc.enterprise_sonic.sonic_vrrp module – Configure VRRP protocol settings on SONiC.
Note
This module is part of the dellemc.enterprise_sonic collection (version 2.5.1).
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 dellemc.enterprise_sonic
.
To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_vrrp
.
New in dellemc.enterprise_sonic 2.5.0
Synopsis
This module provides configuration management of VRRP protocol settings on devices running SONiC
Configure interface IP address before configuring VRRP
Configure interface VRF forwarding before configuring VRRP in a VRF
Parameters
Parameter |
Comments |
---|---|
Specifies the VRRP related configuration. |
|
Defining the VRRP/VRRP6 group |
|
Configure advertisement interval (1 to 254) |
|
VRRP configurations to be set for the interface mentioned in types(VRRP/VRRP6). Choices:
|
|
Enable preempt Choices:
|
|
Priority for MASTER election (1 to 254) |
|
Configure track interface for priority change. interface and priority_increment are required together. |
|
Full name of the Layer 3 interface, i.e. Eth1/1. |
|
Weight for changing priority (1 to 254) |
|
Enable checksum compatibility with VRRPv2 (Not supported for IPv6). Choices:
|
|
Configure VRRP Version 2 or 3 (Not supported for IPv6). Choices:
|
|
Configure virtual IP Address. |
|
List of IP addresses to be set. |
|
VRRP ID (1 to 255) |
|
Full name of the Layer 3 interface, i.e. Eth1/1. |
|
Specifies the operation to be performed on the VRRP process configured on the device. In case of merged, the input configuration will be merged with the existing VRRP configuration on the device. In case of deleted, the existing VRRP configuration will be removed from the device. In case of overridden, all existing VRRP configuration will be deleted and the specified input configuration will be installed. In case of replaced, the existing VRRP configuration on the device will be replaced by the configuration in the playbook for each VRRP interface/group configured by the playbook. Choices:
|
Examples
# Using deleted
#
# Before State:
# -------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 81.1.1.1/24
# ipv6 address 81::1/24
# !
# vrrp 1 address-family ipv4
# preempt
# vip 81.1.1.3
# vip 81.1.1.4
# !
# vrrp 10 address-family ipv6
# priority 10
# advertisement-interval 4
# vip 81::3
# vip 81::4
#!
#interface Eth1/3
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 61.1.1.1/24
# !
# vrrp 5 address-family ipv4
# priority 20
# vip 61.1.1.3
# !
# vrrp 15 address-family ipv4
# priority 20
# preempt
# vip 61.1.1.4
#!
- name: Delete VRRP and VRRP6 relay configurations
sonic_vrrp:
config:
- name: 'Eth1/1'
group:
- virtual_router_id: 1
afi: ipv4
virtual_address:
- address: 81.1.1.4
preempt: true
- virtual_router_id: 10
afi: ipv6
advertisement_interval: 4
priority: 10
- name: 'Eth1/3'
group:
- virtual_router_id: 5
afi: ipv4
virtual_address:
- address: 61.1.1.3
priority: 20
- virtual_router_id: 15
afi: ipv4
state: deleted
# After State:
# ------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 81.1.1.1/24
# ipv6 address 81::1/24
# !
# vrrp 1 address-family ipv4
# vip 81.1.1.3
# !
# vrrp 10 address-family ipv6
# vip 81::3
# vip 81::4
#!
#interface Eth1/3
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 61.1.1.1/24
#!
# Using merged
#
# Before State:
# -------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 81.1.1.1/24
# ipv6 address 81::1/24
#!
#interface Eth1/3
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 61.1.1.1/24
#!
- name: Add VRRP and VRRP6 configurations
sonic_vrrp:
config:
- name: 'Eth1/1'
group:
- virtual_router_id: 1
afi: ipv4
virtual_address:
- address: 81.1.1.3
- address: 81.1.1.4
preempt: true
- virtual_router_id: 10
afi: ipv6
virtual_address:
- address: 81::3
- address: 81::4
advertisement_interval: 4
priority: 10
- name: 'Eth1/3'
group:
- virtual_router_id: 5
afi: ipv4
virtual_address:
- address: 61.1.1.3
priority: 20
- virtual_router_id: 15
afi: ipv4
virtual_address:
- address: 61.1.1.4
preempt: true
priority: 20
state: merged
# After State:
# ------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 81.1.1.1/24
# ipv6 address 81::1/24
# !
# vrrp 1 address-family ipv4
# preempt
# vip 81.1.1.3
# vip 81.1.1.4
# !
# vrrp 10 address-family ipv6
# priority 10
# advertisement-interval 4
# vip 81::3
# vip 81::4
#!
#interface Eth1/3
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 61.1.1.1/24
# !
# vrrp 5 address-family ipv4
# priority 20
# vip 61.1.1.3
# !
# vrrp 15 address-family ipv4
# priority 20
# preempt
# vip 61.1.1.4
#!
# Using replaced
#
# Before State:
# -------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 81.1.1.1/24
# ipv6 address 81::1/24
# !
# vrrp 1 address-family ipv4
# preempt
# vip 81.1.1.3
# vip 81.1.1.4
# !
# vrrp 10 address-family ipv6
# priority 10
# advertisement-interval 4
# vip 81::3
# vip 81::4
#!
#interface Eth1/3
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 61.1.1.1/24
# !
# vrrp 5 address-family ipv4
# priority 20
# vip 61.1.1.3
# !
# vrrp 15 address-family ipv4
# priority 20
# preempt
# vip 61.1.1.4
#!
- name: Replace VRRP and VRRP6 relay configurations
sonic_vrrp:
config:
- name: 'Eth1/1'
group:
- virtual_router_id: 10
afi: ipv6
priority: 20
- name: 'Eth1/3'
group:
- virtual_router_id: 5
afi: ipv4
virtual_address:
- address: 61.1.1.5
preempt: false
track_interface:
- interface: Eth1/1
priority_increment: 10
state: replaced
# After State:
# ------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 81.1.1.1/24
# ipv6 address 81::1/24
# !
# vrrp 1 address-family ipv4
# vip 81.1.1.3
# vip 81.1.1.4
# !
# vrrp 10 address-family ipv6
# priority 20
#!
#interface Eth1/3
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 61.1.1.1/24
# !
# vrrp 5 address-family ipv4
# no preempt
# vip 61.1.1.5
# track-interface Eth1/1 weight 10
# !
# vrrp 15 address-family ipv4
# priority 20
# preempt
# vip 61.1.1.4
#!
# Using overridden
#
# Before State:
# -------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 81.1.1.1/24
# ipv6 address 81::1/24
# !
# vrrp 1 address-family ipv4
# preempt
# vip 81.1.1.3
# vip 81.1.1.4
# !
# vrrp 10 address-family ipv6
# priority 10
# advertisement-interval 4
# vip 81::3
# vip 81::4
#!
#interface Eth1/3
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 61.1.1.1/24
# !
# vrrp 5 address-family ipv4
# priority 20
# vip 61.1.1.3
# !
# vrrp 15 address-family ipv4
# priority 20
# preempt
# vip 61.1.1.4
#!
- name: Overwrite the VRRP and VRRP6 relay configurations
sonic_vrrp:
config:
- name: 'Eth1/1'
group:
- virtual_router_id: 15
afi: ipv4
virtual_address:
- address: 81.1.1.15
preempt: false
- name: 'Eth1/3'
group:
- virtual_router_id: 5
afi: ipv4
- virtual_router_id: 15
afi: ipv4
virtual_address:
- address: 61.1.1.5
state: overridden
# After State:
# ------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 81.1.1.1/24
# ipv6 address 81::1/24
# !
# vrrp 15 address-family ipv4
# no preempt
# vip 81.1.1.15
#!
#interface Eth1/3
# mtu 9100
# speed 400000
# fec RS
# no shutdown
# ip address 61.1.1.1/24
# !
# vrrp 5 address-family ipv4
# !
# vrrp 15 address-family ipv4
# vip 61.1.1.5
#!
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 generated configuration model invocation. Returned: when Sample: |
|
The configuration prior to the model invocation. Returned: always Sample: |
|
The set of commands pushed to the remote device. Returned: always Sample: |