kowabunga.cloud.keepalived role – Install, configure, and start Keepalived IP failover.

Note

This role is part of the kowabunga.cloud collection (version 0.0.1).

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 kowabunga.cloud.

To use it in a playbook, specify: kowabunga.cloud.keepalived.

Entry point main – Install, configure, and start Keepalived IP failover.

Synopsis

  • Install, configure, and start Keepalived IP failover.

Parameters

Parameter

Comments

kowabunga_network_failover_enabled

boolean

Defines whether network redundancy and virtual IP failover mechanisms must be enabled.

Disabled if unspecified.

Choices:

  • false ← (default)

  • true

kowabunga_network_failover_settings

dictionary

Configuration settings for failover mechanisms (useless if disabled)

Default: {"peers": [], "trackers": [], "use_bfd": true, "use_unicast": false, "use_vmac": true}

peers

list / elements=string

List of hosts used as peers in a highly-available failover setup

Recommended to use Ansible special variables like groups[‘ROLE’]

Default: []

trackers

list / elements=dictionary

List of VRRP trackers to be configured to managed virtual IP addresses.

Default: []

checkscript

string

Used to determine the condition under which a given instance goes from PRIMARY to BACKUP state.

If unset, failover is performed when one server fails (crash, reboot, …)

Example: ‘/usr/bin/killall -0 myapp’

configs

list / elements=dictionary

List of tracker configuration settings

control_interface

string

Network interface to use for VRRP messages communication.

Defaults to private network one if unspecified.

interface

string

Network interface to use to attacj virtual IP address.

Defaults to private network one if unspecified.

nopreempt

boolean

Allows lower priority machine to maintain the master role and prevent unnecessary VIP flapping.

Disabled if unspecified.

Choices:

  • false ← (default)

  • true

password

string

Password to authenticate VRRP messages between peers.

primary

string

Hostname from inventory of the expected master host.

Overriden when priority is set.

priority

integer

Enforce priority (1..250).

The lower value will be selected as master host.

Default: 100

routes

list / elements=dictionary

Set custom route when virtual IP is acquired.

Default: []

destination

string / required

Route’s destination CIDR.

gateway

string / required

Route’s gateway IPv4 address.

metric

string / required

Route’s weight

vip

string / required

Virtual IP address (VIP) to be assigned, must be unique in your network.

Can be used either as a simple string or a list of strings to handle multiple IP addresses.

vrid

integer / required

Virtual Router Identification, integer in 1..255 range.

Required to be unique on a given L2/L3 segment.

name

string / required

Tracker name

notifyscript

string

Path to post-actions script, called at state change.

Example: ‘/opt/keepalived-notify-myapp.sh’

use_bfd

boolean

Defines whether to enable fast failure detection with point-to-point Bidirectional Forwarding Detection (BFD).

Enabled if unspecified.

Choices:

  • false

  • true ← (default)

use_unicast

boolean

Forces peer-to-peer unicast VRRP communication over multicast.

Only supported with 2 peers failover.

Disabled if unspecified.

Choices:

  • false ← (default)

  • true

use_vmac

boolean

Defines whether virtual MAC addresses (VMAC) must be used (formatted as 00:00:5e:00:00:xx).

Useful if not supported by underlying network interface (e.g. VMware vSwitch with MAC address range restriction)

Enabled if unspecified.

Choices:

  • false

  • true ← (default)