keepalived
: Install and configure keepalivedkeepalived::config
: Configure keepalived modulekeepalived::global_defs
: Manage keepalived notifictionskeepalived::install
: Install keepalived packagekeepalived::service
: Manage keepalived service
keepalived::lvs::real_server
: Add a real server to a Linux Virtual Server with keepalivedkeepalived::lvs::virtual_server
: Configure a Linux Virtual Server with keepalived
Work in progress, supports:
- single IP/port virtual servers
- TCP_CHECK healthchecks
keepalived::vrrp::instance
: Configure VRRP instancekeepalived::vrrp::script
: Configure VRRP scriptkeepalived::vrrp::sync_group
: Configure the group for instancekeepalived::vrrp::track_file
: Configure the tracker filekeepalived::vrrp::track_process
: Configure the process trackerkeepalived::vrrp::vrrp_track_file
: Configure the tracker file
keepalived::vrrp::unicast_peer
: Define a unicast peer for a vrrp instance.
Keepalived::Global_defs::Lvs_sync_daemon
: Defines parameters for lvs_sync_daemon as documented inman 5 keepalived.conf
Keepalived::Options
: keepalived::optionsKeepalived::Vrrp::Instance::VRule
: Translates directly to rules to be added as perip-rule(8)
Install and configure keepalived
The following parameters are available in the keepalived
class:
sysconf_dir
sysconf_options
config_dir
config_dir_mode
config_file_mode
config_validate_cmd
config_group
config_owner
daemon_group
daemon_user
pkg_ensure
pkg_list
service_enable
service_ensure
service_hasrestart
service_hasstatus
service_manage
service_name
service_restart
global_defs
vrrp_instance
vrrp_script
vrrp_track_process
vrrp_sync_group
lvs_real_server
lvs_virtual_server
include_external_conf_files
manage_package
Data type: String[1]
Data type: String
Data type: Stdlib::Absolutepath
Default value: '/etc/keepalived'
Data type: Stdlib::Filemode
Default value: '0755'
Data type: Stdlib::Filemode
Default value: '0644'
Data type: Variant[String, Undef]
Input for the validate_cmd
param of the keepalived.conf concat fragment.
Default value: '/usr/sbin/keepalived -l -t -f %'
Data type: String[1]
Default value: 'root'
Data type: String[1]
Default value: 'root'
Data type: String[1]
Default value: 'root'
Data type: String[1]
Default value: 'root'
Data type: String[1]
Default value: 'present'
Data type: Array[String[1]]
Default value: ['keepalived']
Data type: Boolean
Default value: true
Data type: Stdlib::Ensure::Service
Default value: 'running'
Data type: Optional[Boolean]
Default value: undef
Data type: Optional[Boolean]
Default value: undef
Data type: Boolean
Default value: true
Data type: String[1]
Default value: 'keepalived'
Data type: Optional[String[1]]
Default value: undef
Data type: Optional[Hash]
Default value: undef
Data type: Hash
Default value: {}
Data type: Hash
Default value: {}
Data type: Hash
Default value: {}
Data type: Hash
Default value: {}
Data type: Hash
Default value: {}
Data type: Hash
Default value: {}
Data type: Array[Stdlib::Absolutepath]
Default value: []
Data type: Boolean
Default value: true
Configure keepalived module
Manage keepalived notifictions
The following parameters are available in the keepalived::global_defs
class:
notification_email
notification_email_from
smtp_server
smtp_connect_timeout
router_id
script_user
enable_script_security
snmp_socket
enable_snmp_keepalived
enable_snmp_vrrp
enable_snmp_checker
enable_snmp_rfc
enable_snmp_rfcv2
enable_snmp_rfcv3
enable_traps
enable_dbus
vrrp_higher_prio_send_advert
vrrp_min_garp
vrrp_garp_lower_prio_repeat
vrrp_garp_master_delay
vrrp_garp_master_refresh
vrrp_garp_master_repeat
vrrp_garp_master_refresh_repeat
vrrp_garp_lower_prio_delay
vrrp_startup_delay
bfd_rlimit_rttime
checker_rlimit_rttime
vrrp_rlimit_rttime
bfd_priority
checker_priority
vrrp_priority
bfd_rt_priority
checker_rt_priority
vrrp_rt_priority
bfd_no_swap
checker_no_swap
vrrp_no_swap
vrrp_check_unicast_src
vrrp_version
max_auto_priority
dynamic_interfaces
vrrp_notify_fifo
vrrp_notify_fifo_script
lvs_sync_daemon
Data type: Any
Array of notification email Recipients.
Default value: undef
Data type: Any
Define the notification email Sender.
Default value: undef
Data type: Any
Define the smtp server addres.
Default value: undef
Data type: Any
Define the smtp connect timeout.
Default value: undef
Data type: Any
Define the router ID.
Default value: undef
Data type: Any
Set the global script_user option.
Default value: undef
Data type: Any
Set the enable_script_security option.
Default value: undef
Data type: Any
Define snmp master agent socker
Default value: 'unix:/var/agentx/master'
Data type: Any
Set enable_snmp_keepalived option.
Default value: undef
Data type: Any
Set enable_snmp_vrrp option.
Default value: undef
Data type: Any
Set enable_snmp_checker option
Default value: undef
Data type: Any
Set enable_snmp_rfc option.
Default value: undef
Data type: Any
Set enable_snmp_rfcv2 option.
Default value: undef
Data type: Any
Set enable_snmp_rfcv3 option.
Default value: undef
Data type: Any
Set enable_traps option.
Default value: undef
Data type: Boolean
Set enable_dbus option
Default value: false
Data type: Optional[Boolean]
Set vrrp_higher_prio_send_advert option.
Default value: undef
Data type: Optional[Boolean]
Set vrrp_min_garp option.
Default value: undef
Data type: Optional[Integer]
Set vrrp_garp_lower_prio_repeat option.
Default value: undef
Data type: Optional[Integer]
Set vrrp_garp_master_delay option
Default value: undef
Data type: Optional[Integer]
Set vrrp_garp_master_refresh option.
Default value: undef
Data type: Optional[Integer]
Set vrrp_garp_master_repeat option
Default value: undef
Data type: Optional[Integer]
Set vrrp_garp_master_refresh_repeat option
Default value: undef
Data type: Optional[Integer]
Set vrrp_garp_lower_prio_delay option.
Default value: undef
Data type: Optional[Float]
Set vrrp_startup_delay option.
Default value: undef
Data type: Optional[Integer]
Set bfd_rlimit_rttime option.
Default value: undef
Data type: Optional[Integer]
Set checker_rlimit_rttime option.
Default value: undef
Data type: Optional[Integer]
Set vrrp_rlimit_rttime option.
Default value: undef
Data type: Optional[Integer[-20, 19]]
Set bfd_priority option.
Default value: undef
Data type: Optional[Integer[-20, 19]]
Set checker_priority option.
Default value: undef
Data type: Optional[Integer[-20, 19]]
Set vrrp_priority option.
Default value: undef
Data type: Optional[Integer[1, 99]]
Set bfd_rt_priority option.
Default value: undef
Data type: Optional[Integer[1, 99]]
Set checker_rt_priority option.
Default value: undef
Data type: Optional[Integer[1, 99]]
Set vrrp_rt_priority option.
Default value: undef
Data type: Boolean
Set bfd_no_swap option.
Default value: false
Data type: Boolean
Set checker_no_swap option.
Default value: false
Data type: Boolean
Set vrrp_no_swap option.
Default value: false
Data type: Boolean
Set vrrp_check_unicast_src option.
Default value: false
Data type: Optional[Integer[2, 3]]
Set vrrp_version option.
Default value: undef
Data type: Optional[Integer[-1, 99]]
Set max_auto_priority option.
Default value: undef
Data type: Boolean
Set the dynamic_interfaces option.
Default value: false
Data type: Optional[Stdlib::Absolutepath]
Set the vrrp_notify_fifo option.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Set the vrrp_notify_fifo_script option.
Default value: undef
Data type: Optional[Keepalived::Global_defs::Lvs_sync_daemon]
Set the lvs_sync_daemon option.
Default value: undef
Install keepalived package
Manage keepalived service
Add a real server to a Linux Virtual Server with keepalived
The following parameters are available in the keepalived::lvs::real_server
defined type:
Data type: String[1]
The name of the virtual server this real server will be added to
Data type: Stdlib::IP::Address
The ip address of the real server
Data type: Stdlib::Port
Real sever IP port. (if ommitted the port defaults to the VIP port)
Data type: Keepalived::Options
One or more options to include in the real_server block
@example options => { inhibit_on_failure => true, SMTP_CHECK => { connect_timeout => 10 host => { connect_ip => '127.0.0.1' } } }
Default value: {}
Configure a Linux Virtual Server with keepalived
Work in progress, supports:
- single IP/port virtual servers
- TCP_CHECK healthchecks
real_server_options => {
inhibit_on_failure => true,
SMTP_CHECK => {
connect_timeout => 10
host => {
connect_ip => '127.0.0.1'
}
}
}
The following parameters are available in the keepalived::lvs::virtual_server
defined type:
ip_address
port
fwmark
lb_algo
delay_loop
protocol
lb_kind
ha_suspend
alpha
omega
mh_port
mh_fallback
sh_port
sh_fallback
quorum
quorum_up
quorum_down
hysteresis
tcp_check
real_server_options
sorry_server
sorry_server_inhibit
persistence_timeout
virtualhost
real_servers
collect_exported
Data type: Optional[Stdlib::IP::Address]
Virtual server IP address.
Default value: undef
Data type: Optional[Stdlib::Port]
Virtual sever IP port.
Default value: undef
Data type: Optional[Integer[1]]
Virtual Server firewall mark. (overrides ip_address and port)
Default value: undef
Data type: Enum['rr','wrr','lc','wlc','lblc','sh','dh', 'mh']
Must be one of rr, wrr, lc, wlc, lblc, sh, mh, dh
Data type: Optional[Integer[1]]
Default value: undef
Data type: Enum['TCP','UDP']
Default value: 'TCP'
Data type: Enum['NAT','DR','TUN']
Must be one of NAT, TUN, DR.
Default value: 'NAT'
Data type: Boolean
Default value: false
Data type: Boolean
Default value: false
Data type: Boolean
Default value: false
Data type: Boolean
Enable mh-port for mh scheduler
Default value: false
Data type: Boolean
Enable mh-fallback for mh scheduler
Default value: false
Data type: Boolean
Enable sh-port for sh scheduler
Default value: false
Data type: Boolean
Enable sh-fallback for sh scheduler
Default value: false
Data type: Optional[Integer[1]]
Default value: undef
Data type: Optional[String[1]]
Default value: undef
Data type: Optional[String[1]]
Default value: undef
Data type: Optional[Integer[0]]
Default value: undef
Data type: Optional[Hash]
The TCP_CHECK to configure for real_servers.
Default value: undef
Data type: Hash
One or more options to apply to all real_server blocks inside this virtual_server.
Default value: {}
Data type: Optional[Struct[{ ip_address => Stdlib::IP::Address, port => Stdlib::Port }]]
The sorry_server to define
Default value: undef
Data type: Boolean
Default value: false
Data type: Optional[Integer[1]]
Default value: undef
Data type: Optional[Stdlib::Fqdn]
Default value: undef
Data type: Array[Hash]
The real servers to balance to.
Default value: []
Data type: Boolean
Boolean. Automatically collect exported @@keepalived::lvs::real_servers with a virtual_server equal to the name/title of this resource. This allows you to easily export a real_server resource on each node in the pool.
Default value: true
Configure VRRP instance
May be specified as either:
a) ip address (or array of IP addresses)
e.g. `'10.0.0.1'`
b) a hash (or array of hashes) containing
extra properties
e.g. `{ 'ip' => '10.0.0.1', 'label' => 'webvip' }`
Supported properties: dev, brd, label, scope.
May be specified as a hash (or array of hashes)
containing extra properties
e.g. `{ 'src' => '10.0.0.1',
'to' => '192.168.30.0/24',
'via' => '10.0.0.254',
'metric' => '15' }`
Supported properties: src, to, via, dev, scope, table, metric
May be specified as a hash (or array of hashes)
containing extra properties
e.g. `{ 'from' => '10.0.0.1',
'via' => '10.0.0.254',
'lookup' => 'customroute',
'metric' => '15' }`
Supported properties: from, to, dev, lookup, metric
May be specified as either:
a) ip address (or array of IP addresses)
e.g. `'10.0.0.1'`
b) a hash (or array of hashes) containing
extra properties
e.g. `{ 'ip'=>'10.0.0.1', 'scope'=>'local' }`
Supported properties: dev, brd, label, scope.
The following parameters are available in the keepalived::vrrp::instance
defined type:
interface
priority
state
virtual_ipaddress_int
virtual_ipaddress
promote_secondaries
virtual_routes
virtual_rules
virtual_ipaddress_excluded
virtual_router_id
auth_type
auth_pass
track_script
track_process
track_file
vrrp_track_file
track_interface
lvs_interface
smtp_alert
nopreempt
preempt_delay
advert_int
garp_master_delay
garp_master_refresh
notify_script_master
notify_script_backup
notify_script_fault
notify_script_stop
notify_script
multicast_source_ip
notify_script_master_rx_lower_pri
unicast_source_ip
unicast_peers
dont_track_primary
use_vmac
vmac_xmit_base
use_vmac_addr
native_ipv6
garp_lower_prio_repeat
higher_prio_send_advert
collect_unicast_peers
Data type: Any
Define which interface to listen on.
Data type: Integer[1,254]
Set instance priority.
Data type: Any
Set instance state.
Data type: Any
Set interface for VIP to be assigned to,
Default value: undef
Data type: Any
Set floating IP address.
Default value: undef
Data type: Boolean
Set the promote_secondaries flag on the interface to stop other addresses in the same CIDR being removed when 1 of them is removed For example if 10.1.1.2/24 and 10.1.1.3/24 are both configured on an interface, and one is removed, unless promote_secondaries is set on the interface the other address will also be removed.
Default value: false
Data type: Any
Set floating routes.
Default value: undef
Data type: Array[Keepalived::Vrrp::Instance::VRule]
Set floating rules.
Default value: []
Data type: Any
For cases with large numbers (eg 200) of IPs on the same interface. To decrease the number of packets sent in adverts, you can exclude most IPs from adverts.
Default value: undef
Data type: Integer[1,255]
Set virtual router id.
Data type: Any
Set authentication method.
Default value: undef
Data type: Optional[Variant[String, Sensitive[String]]]
Authentication password.
Default value: undef
Data type: Array[String[1]]
Define which scripts to run to track service states. Must be specified as an Array of Strings with multiple Scriptnames.
Default value: []
Data type: Array[String[1]]
Define which process trackers to run.
Default value: []
Data type: Array[String[1]]
Define which file trackers to run. References a track_file block that can be created with keepalived::vrrp::track_file.
Default value: []
Data type: Array[String[1]]
Define which file trackers to run. Deprecated, for keepalived < 2.1.0. References a vrrp_track_file block that can be created with keepalived::vrrp::vrrp_track_file.
Default value: []
Data type: Array[String[1]]
Define which interface(s) to monitor. Go to FAULT state if one of these interfaces goes down. May be specified as either: a) interface name b) array of interfaces names
Default value: []
Data type: Any
Define lvs_sync_daemon_interface.
Default value: undef
Data type: Any
Send status alerts via SMTP. Requires user provided in SMTP settings in keepalived::global_defs class.
Default value: false
Data type: Any
Allows the lower priority machine to maintain the master role, when a higher priority machine comes back online. NOTE: For this to work, the initial state of this entry must be BACKUP
Default value: false
Data type: Any
Seconds after startup until preemption Range: 0 to 1,000 NOTE: For this to work, the initial state of this entry must be BACKUP
Default value: undef
Data type: Any
The interval between VRRP packets
Default value: 1
Data type: Any
The delay for gratuitous ARP after transition to MASTER
Default value: 5
Data type: Any
Repeat gratuitous ARP after transition to MASTER this often.
Default value: undef
Data type: Any
Define the notify master script.
Default value: undef
Data type: Any
Define the notify backup script.
Default value: undef
Data type: Any
Define the notify fault script.
Default value: undef
Data type: Any
Define the notify stop script.
Default value: undef
Data type: Any
Define the notify script.
Default value: undef
Data type: Any
default IP for binding vrrpd is the primary IP on interface. If you want to hide the location of vrrpd, use this IP as src_addr for multicast vrrp packets.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Define the notify_master_rx_lower_pri script. This is executed if a master receives an advert with priority lower than the master's advert.
Default value: undef
Data type: Optional[Stdlib::IP::Address]
default IP for binding vrrpd is the primary IP on interface. If you want to hide the location of vrrpd, use this IP as src_addr for unicast vrrp packets.
Default value: undef
Data type: Variant[Array[Stdlib::IP::Address], Stdlib::IP::Address]
Do not send VRRP adverts over VRRP multicast group. Instead send adverts to the list of ip addresses using a unicast design fashion.
May be specified as an array with ip addresses
Default value: []
Data type: Any
Tells keepalived to ignore VRRP interface faults. Can be useful on setup where two routers are connected directly to each other on the interface used for VRRP. Without this feature the link down caused by one router crashing would also inspire the other router to lose (or not gain) MASTER state, since it was also tracking link status. Default: false.
Default value: false
Data type: Any
Use virtual MAC address for VRRP packages.
Default value: false
Data type: Any
When using virtual MAC addresses transmit and receive VRRP messaged on the underlying interface whilst ARP will happen from the the VMAC interface.
Default value: true
Data type: Boolean
Use virtual MAC address for virtual IP addresses.
Default value: false
Data type: Boolean
Force instance to use IPv6 (when mixed IPv4 and IPv6 config)
Default value: false
Data type: Optional[Integer]
Default value: undef
Data type: Optional[Boolean]
Default value: undef
Data type: Boolean
Default value: false
Configure VRRP script
The following parameters are available in the keepalived::vrrp::script
defined type:
Data type: Any
Set the interval to run the vrrp script.
Default value: '2'
Data type: String[1]
Which command or script to execute.
Data type: Any
The weight the script should add to the instance.
Default value: undef
Data type: Any
required number of failures for KO switch.
Default value: undef
Data type: Any
required number of successes for OK switch.
Default value: undef
Data type: Any
max time to wait for the vrrp script to return.
Default value: undef
Data type: Any
user to run the vrrp script under.
Default value: undef
Data type: Any
group to run the vrrp script under - only used if $user is also set.
Default value: undef
Data type: Any
Default value: false
Data type: Any
assume script initially is in failed state if true.
Default value: false
Configure the group for instance
The following parameters are available in the keepalived::vrrp::sync_group
defined type:
group
notify_script_master
track_script
track_process
notify_script_backup
notify_script_fault
notify_script
notify_script_master_rx_lower_pri
smtp_alert
nopreempt
global_tracking
track_interface
Data type: Any
Define vrrp instances to group (Array)
Data type: Any
Define the notify master script.
Default value: undef
Data type: Array[String]
Define which script to run to track service states.
Default value: []
Data type: Array[String]
Define which process check to run to track processes.
Default value: []
Data type: Any
Define the notify backup script.
Default value: undef
Data type: Any
Define the notify fault script.
Default value: undef
Data type: Any
Define the notify script.
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
Define the notify_master_rx_lower_pri script. This is executed if a master receives an advert with priority lower than the master's advert.
Default value: undef
Data type: Any
Send email on status change
Default value: undef
Data type: Any
Default value: undef
Data type: Boolean
Default value: false
Data type: Optional[Variant[String, Array[String]]]
Define which interface(s) to monitor. Go to FAULT state if one of these interfaces goes down. May be specified as either: a) interface name b) array of interfaces names
Default value: undef
the specified file at startup if the file doesn't exist, unless overwrite is specified in which case any existing file contents will be overwritten with the specified value.
The following parameters are available in the keepalived::vrrp::track_file
defined type:
Data type: String[1]
name of track file
Data type: Integer
The weight that should add to the instance.
Default value: 1
Data type: Optional[String[1]]
create the file and/or initialise the value
Default value: undef
Data type: Boolean
This causes VALUE (default 0) to be written to
Default value: false
Configure the process tracker
The following parameters are available in the keepalived::vrrp::track_process
defined type:
Data type: String[1]
process name to track
Data type: Optional[Integer[0]]
The weight that should add to the instance.
Default value: undef
Data type: Integer[0]
Number of processes to expect running
Default value: 1
Data type: Optional[Integer[0]]
this sets fork_delay and terminate_delay (for keepalived => 2.0.16), before terminate_delay
Default value: undef
Data type: Optional[Integer[0]]
time to delay after process quorum gained after fork before consider process up
Default value: undef
Data type: Optional[Integer[0]]
time to delay after process quorum lost before consider process down
Default value: undef
Data type: Boolean
Match entire process cmdline
Default value: false
Data type: Optional[Enum['initial','partial']]
Set inital if command has no parameters or use partial if first n parameters match
Default value: undef
the specified file at startup if the file doesn't exist, unless overwrite is specified in which case any existing file contents will be overwritten with the specified value.
The following parameters are available in the keepalived::vrrp::vrrp_track_file
defined type:
Data type: String[1]
name of track file
Data type: Integer
The weight that should add to the instance.
Default value: 1
Data type: Optional[String[1]]
create the file and/or initialise the value
Default value: undef
Data type: Boolean
This causes VALUE (default 0) to be written to
Default value: false
Defines parameters for lvs_sync_daemon as documented in man 5 keepalived.conf
Alias of
Struct[{
interface => String[1],
vrrp_instance => String[1],
Optional[id] => Integer[0, 255],
Optional[maxlen] => Integer[1, 65507],
Optional[port] => Stdlib::Port,
Optional[ttl] => Integer[1, 255],
Optional[group] => Stdlib::IP::Address,
}]
keepalived::options
Alias of Hash[String[1], Any]
Translates directly to rules to be added as per ip-rule(8)
Alias of
Struct[{
Optional[from] => String,
Optional[to] => String,
Optional[iif] => String,
Optional[oof] => String,
Optional[lookup] => String,
Optional[table] => String,
Optional[tos] => String,
Optional[dsfield] => String,
Optional[fwmark] => String,
Optional[uidrange] => String,
Optional[ipproto] => String,
Optional[sport] => String,
Optional[dport] => String,
Optional[priority] => String,
Optional[preference] => String,
Optional[order] => String,
Optional[protocol] => String,
Optional[suppress_prefixlength] => String,
Optional[suppress_ifgroup] => String,
Optional[realms] => String,
Optional[nat] => String,
}]