Skip to content

Latest commit

 

History

History
1942 lines (1090 loc) · 49.8 KB

REFERENCE.md

File metadata and controls

1942 lines (1090 loc) · 49.8 KB

Reference

Table of Contents

Classes

Defined types

Public Defined types

Work in progress, supports:

  • single IP/port virtual servers
  • TCP_CHECK healthchecks

Private Defined types

  • keepalived::vrrp::unicast_peer: Define a unicast peer for a vrrp instance.

Data types

Classes

keepalived

Install and configure keepalived

Parameters

The following parameters are available in the keepalived class:

sysconf_dir

Data type: String[1]

sysconf_options

Data type: String

config_dir

Data type: Stdlib::Absolutepath

Default value: '/etc/keepalived'

config_dir_mode

Data type: Stdlib::Filemode

Default value: '0755'

config_file_mode

Data type: Stdlib::Filemode

Default value: '0644'

config_validate_cmd

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 %'

config_group

Data type: String[1]

Default value: 'root'

config_owner

Data type: String[1]

Default value: 'root'

daemon_group

Data type: String[1]

Default value: 'root'

daemon_user

Data type: String[1]

Default value: 'root'

pkg_ensure

Data type: String[1]

Default value: 'present'

pkg_list

Data type: Array[String[1]]

Default value: ['keepalived']

service_enable

Data type: Boolean

Default value: true

service_ensure

Data type: Stdlib::Ensure::Service

Default value: 'running'

service_hasrestart

Data type: Optional[Boolean]

Default value: undef

service_hasstatus

Data type: Optional[Boolean]

Default value: undef

service_manage

Data type: Boolean

Default value: true

service_name

Data type: String[1]

Default value: 'keepalived'

service_restart

Data type: Optional[String[1]]

Default value: undef

global_defs

Data type: Optional[Hash]

Default value: undef

vrrp_instance

Data type: Hash

Default value: {}

vrrp_script

Data type: Hash

Default value: {}

vrrp_track_process

Data type: Hash

Default value: {}

vrrp_sync_group

Data type: Hash

Default value: {}

lvs_real_server

Data type: Hash

Default value: {}

lvs_virtual_server

Data type: Hash

Default value: {}

include_external_conf_files

Data type: Array[Stdlib::Absolutepath]

Default value: []

manage_package

Data type: Boolean

Default value: true

keepalived::config

Configure keepalived module

keepalived::global_defs

Manage keepalived notifictions

Parameters

The following parameters are available in the keepalived::global_defs class:

notification_email

Data type: Any

Array of notification email Recipients.

Default value: undef

notification_email_from

Data type: Any

Define the notification email Sender.

Default value: undef

smtp_server

Data type: Any

Define the smtp server addres.

Default value: undef

smtp_connect_timeout

Data type: Any

Define the smtp connect timeout.

Default value: undef

router_id

Data type: Any

Define the router ID.

Default value: undef

script_user

Data type: Any

Set the global script_user option.

Default value: undef

enable_script_security

Data type: Any

Set the enable_script_security option.

Default value: undef

snmp_socket

Data type: Any

Define snmp master agent socker

Default value: 'unix:/var/agentx/master'

enable_snmp_keepalived

Data type: Any

Set enable_snmp_keepalived option.

Default value: undef

enable_snmp_vrrp

Data type: Any

Set enable_snmp_vrrp option.

Default value: undef

enable_snmp_checker

Data type: Any

Set enable_snmp_checker option

Default value: undef

enable_snmp_rfc

Data type: Any

Set enable_snmp_rfc option.

Default value: undef

enable_snmp_rfcv2

Data type: Any

Set enable_snmp_rfcv2 option.

Default value: undef

enable_snmp_rfcv3

Data type: Any

Set enable_snmp_rfcv3 option.

Default value: undef

enable_traps

Data type: Any

Set enable_traps option.

Default value: undef

enable_dbus

Data type: Boolean

Set enable_dbus option

Default value: false

vrrp_higher_prio_send_advert

Data type: Optional[Boolean]

Set vrrp_higher_prio_send_advert option.

Default value: undef

vrrp_min_garp

Data type: Optional[Boolean]

Set vrrp_min_garp option.

Default value: undef

vrrp_garp_lower_prio_repeat

Data type: Optional[Integer]

Set vrrp_garp_lower_prio_repeat option.

Default value: undef

vrrp_garp_master_delay

Data type: Optional[Integer]

Set vrrp_garp_master_delay option

Default value: undef

vrrp_garp_master_refresh

Data type: Optional[Integer]

Set vrrp_garp_master_refresh option.

Default value: undef

vrrp_garp_master_repeat

Data type: Optional[Integer]

Set vrrp_garp_master_repeat option

Default value: undef

vrrp_garp_master_refresh_repeat

Data type: Optional[Integer]

Set vrrp_garp_master_refresh_repeat option

Default value: undef

vrrp_garp_lower_prio_delay

Data type: Optional[Integer]

Set vrrp_garp_lower_prio_delay option.

Default value: undef

vrrp_startup_delay

Data type: Optional[Float]

Set vrrp_startup_delay option.

Default value: undef

bfd_rlimit_rttime

Data type: Optional[Integer]

Set bfd_rlimit_rttime option.

Default value: undef

checker_rlimit_rttime

Data type: Optional[Integer]

Set checker_rlimit_rttime option.

Default value: undef

vrrp_rlimit_rttime

Data type: Optional[Integer]

Set vrrp_rlimit_rttime option.

Default value: undef

bfd_priority

Data type: Optional[Integer[-20, 19]]

Set bfd_priority option.

Default value: undef

checker_priority

Data type: Optional[Integer[-20, 19]]

Set checker_priority option.

Default value: undef

vrrp_priority

Data type: Optional[Integer[-20, 19]]

Set vrrp_priority option.

Default value: undef

bfd_rt_priority

Data type: Optional[Integer[1, 99]]

Set bfd_rt_priority option.

Default value: undef

checker_rt_priority

Data type: Optional[Integer[1, 99]]

Set checker_rt_priority option.

Default value: undef

vrrp_rt_priority

Data type: Optional[Integer[1, 99]]

Set vrrp_rt_priority option.

Default value: undef

bfd_no_swap

Data type: Boolean

Set bfd_no_swap option.

Default value: false

checker_no_swap

Data type: Boolean

Set checker_no_swap option.

Default value: false

vrrp_no_swap

Data type: Boolean

Set vrrp_no_swap option.

Default value: false

vrrp_check_unicast_src

Data type: Boolean

Set vrrp_check_unicast_src option.

Default value: false

vrrp_version

Data type: Optional[Integer[2, 3]]

Set vrrp_version option.

Default value: undef

max_auto_priority

Data type: Optional[Integer[-1, 99]]

Set max_auto_priority option.

Default value: undef

dynamic_interfaces

Data type: Boolean

Set the dynamic_interfaces option.

Default value: false

vrrp_notify_fifo

Data type: Optional[Stdlib::Absolutepath]

Set the vrrp_notify_fifo option.

Default value: undef

vrrp_notify_fifo_script

Data type: Optional[Stdlib::Absolutepath]

Set the vrrp_notify_fifo_script option.

Default value: undef

lvs_sync_daemon

Data type: Optional[Keepalived::Global_defs::Lvs_sync_daemon]

Set the lvs_sync_daemon option.

Default value: undef

keepalived::install

Install keepalived package

keepalived::service

Manage keepalived service

Defined types

keepalived::lvs::real_server

Add a real server to a Linux Virtual Server with keepalived

Parameters

The following parameters are available in the keepalived::lvs::real_server defined type:

virtual_server

Data type: String[1]

The name of the virtual server this real server will be added to

ip_address

Data type: Stdlib::IP::Address

The ip address of the real server

port

Data type: Stdlib::Port

Real sever IP port. (if ommitted the port defaults to the VIP port)

options

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: {}

keepalived::lvs::virtual_server

Configure a Linux Virtual Server with keepalived

Work in progress, supports:

  • single IP/port virtual servers
  • TCP_CHECK healthchecks

Examples

real_server_options => {
  inhibit_on_failure => true,
  SMTP_CHECK => {
    connect_timeout => 10
    host => {
      connect_ip => '127.0.0.1'
    }
  }
}

Parameters

The following parameters are available in the keepalived::lvs::virtual_server defined type:

ip_address

Data type: Optional[Stdlib::IP::Address]

Virtual server IP address.

Default value: undef

port

Data type: Optional[Stdlib::Port]

Virtual sever IP port.

Default value: undef

fwmark

Data type: Optional[Integer[1]]

Virtual Server firewall mark. (overrides ip_address and port)

Default value: undef

lb_algo

Data type: Enum['rr','wrr','lc','wlc','lblc','sh','dh', 'mh']

Must be one of rr, wrr, lc, wlc, lblc, sh, mh, dh

delay_loop

Data type: Optional[Integer[1]]

Default value: undef

protocol

Data type: Enum['TCP','UDP']

Default value: 'TCP'

lb_kind

Data type: Enum['NAT','DR','TUN']

Must be one of NAT, TUN, DR.

Default value: 'NAT'

ha_suspend

Data type: Boolean

Default value: false

alpha

Data type: Boolean

Default value: false

omega

Data type: Boolean

Default value: false

mh_port

Data type: Boolean

Enable mh-port for mh scheduler

Default value: false

mh_fallback

Data type: Boolean

Enable mh-fallback for mh scheduler

Default value: false

sh_port

Data type: Boolean

Enable sh-port for sh scheduler

Default value: false

sh_fallback

Data type: Boolean

Enable sh-fallback for sh scheduler

Default value: false

quorum

Data type: Optional[Integer[1]]

Default value: undef

quorum_up

Data type: Optional[String[1]]

Default value: undef

quorum_down

Data type: Optional[String[1]]

Default value: undef

hysteresis

Data type: Optional[Integer[0]]

Default value: undef

tcp_check

Data type: Optional[Hash]

The TCP_CHECK to configure for real_servers.

Default value: undef

real_server_options

Data type: Hash

One or more options to apply to all real_server blocks inside this virtual_server.

Default value: {}

sorry_server

Data type: Optional[Struct[{ ip_address => Stdlib::IP::Address, port => Stdlib::Port }]]

The sorry_server to define

Default value: undef

sorry_server_inhibit

Data type: Boolean

Default value: false

persistence_timeout

Data type: Optional[Integer[1]]

Default value: undef

virtualhost

Data type: Optional[Stdlib::Fqdn]

Default value: undef

real_servers

Data type: Array[Hash]

The real servers to balance to.

Default value: []

collect_exported

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

keepalived::vrrp::instance

Configure VRRP instance

Examples

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.

Parameters

The following parameters are available in the keepalived::vrrp::instance defined type:

interface

Data type: Any

Define which interface to listen on.

priority

Data type: Integer[1,254]

Set instance priority.

state

Data type: Any

Set instance state.

virtual_ipaddress_int

Data type: Any

Set interface for VIP to be assigned to,

Default value: undef

virtual_ipaddress

Data type: Any

Set floating IP address.

Default value: undef

promote_secondaries

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

virtual_routes

Data type: Any

Set floating routes.

Default value: undef

virtual_rules

Data type: Array[Keepalived::Vrrp::Instance::VRule]

Set floating rules.

Default value: []

virtual_ipaddress_excluded

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

virtual_router_id

Data type: Integer[1,255]

Set virtual router id.

auth_type

Data type: Any

Set authentication method.

Default value: undef

auth_pass

Data type: Optional[Variant[String, Sensitive[String]]]

Authentication password.

Default value: undef

track_script

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: []

track_process

Data type: Array[String[1]]

Define which process trackers to run.

Default value: []

track_file

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: []

vrrp_track_file

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: []

track_interface

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: []

lvs_interface

Data type: Any

Define lvs_sync_daemon_interface.

Default value: undef

smtp_alert

Data type: Any

Send status alerts via SMTP. Requires user provided in SMTP settings in keepalived::global_defs class.

Default value: false

nopreempt

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

preempt_delay

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

advert_int

Data type: Any

The interval between VRRP packets

Default value: 1

garp_master_delay

Data type: Any

The delay for gratuitous ARP after transition to MASTER

Default value: 5

garp_master_refresh

Data type: Any

Repeat gratuitous ARP after transition to MASTER this often.

Default value: undef

notify_script_master

Data type: Any

Define the notify master script.

Default value: undef

notify_script_backup

Data type: Any

Define the notify backup script.

Default value: undef

notify_script_fault

Data type: Any

Define the notify fault script.

Default value: undef

notify_script_stop

Data type: Any

Define the notify stop script.

Default value: undef

notify_script

Data type: Any

Define the notify script.

Default value: undef

multicast_source_ip

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

notify_script_master_rx_lower_pri

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

unicast_source_ip

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

unicast_peers

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: []

dont_track_primary

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

use_vmac

Data type: Any

Use virtual MAC address for VRRP packages.

Default value: false

vmac_xmit_base

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

use_vmac_addr

Data type: Boolean

Use virtual MAC address for virtual IP addresses.

Default value: false

native_ipv6

Data type: Boolean

Force instance to use IPv6 (when mixed IPv4 and IPv6 config)

Default value: false

garp_lower_prio_repeat

Data type: Optional[Integer]

Default value: undef

higher_prio_send_advert

Data type: Optional[Boolean]

Default value: undef

collect_unicast_peers

Data type: Boolean

Default value: false

keepalived::vrrp::script

Configure VRRP script

Parameters

The following parameters are available in the keepalived::vrrp::script defined type:

interval

Data type: Any

Set the interval to run the vrrp script.

Default value: '2'

script

Data type: String[1]

Which command or script to execute.

weight

Data type: Any

The weight the script should add to the instance.

Default value: undef

fall

Data type: Any

required number of failures for KO switch.

Default value: undef

rise

Data type: Any

required number of successes for OK switch.

Default value: undef

timeout

Data type: Any

max time to wait for the vrrp script to return.

Default value: undef

user

Data type: Any

user to run the vrrp script under.

Default value: undef

group

Data type: Any

group to run the vrrp script under - only used if $user is also set.

Default value: undef

no_weight

Data type: Any

Default value: false

init_fail

Data type: Any

assume script initially is in failed state if true.

Default value: false

keepalived::vrrp::sync_group

Configure the group for instance

Parameters

The following parameters are available in the keepalived::vrrp::sync_group defined type:

group

Data type: Any

Define vrrp instances to group (Array)

notify_script_master

Data type: Any

Define the notify master script.

Default value: undef

track_script

Data type: Array[String]

Define which script to run to track service states.

Default value: []

track_process

Data type: Array[String]

Define which process check to run to track processes.

Default value: []

notify_script_backup

Data type: Any

Define the notify backup script.

Default value: undef

notify_script_fault

Data type: Any

Define the notify fault script.

Default value: undef

notify_script

Data type: Any

Define the notify script.

Default value: undef

notify_script_master_rx_lower_pri

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

smtp_alert

Data type: Any

Send email on status change

Default value: undef

nopreempt

Data type: Any

Default value: undef

global_tracking

Data type: Boolean

Default value: false

track_interface

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

keepalived::vrrp::track_file

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.

Parameters

The following parameters are available in the keepalived::vrrp::track_file defined type:

file_name

Data type: String[1]

name of track file

weight

Data type: Integer

The weight that should add to the instance.

Default value: 1

init_file

Data type: Optional[String[1]]

create the file and/or initialise the value

Default value: undef

overwrite

Data type: Boolean

This causes VALUE (default 0) to be written to

Default value: false

keepalived::vrrp::track_process

Configure the process tracker

Parameters

The following parameters are available in the keepalived::vrrp::track_process defined type:

proc_name

Data type: String[1]

process name to track

weight

Data type: Optional[Integer[0]]

The weight that should add to the instance.

Default value: undef

quorum

Data type: Integer[0]

Number of processes to expect running

Default value: 1

delay

Data type: Optional[Integer[0]]

this sets fork_delay and terminate_delay (for keepalived => 2.0.16), before terminate_delay

Default value: undef

fork_delay

Data type: Optional[Integer[0]]

time to delay after process quorum gained after fork before consider process up

Default value: undef

terminate_delay

Data type: Optional[Integer[0]]

time to delay after process quorum lost before consider process down

Default value: undef

full_command

Data type: Boolean

Match entire process cmdline

Default value: false

param_match

Data type: Optional[Enum['initial','partial']]

Set inital if command has no parameters or use partial if first n parameters match

Default value: undef

keepalived::vrrp::vrrp_track_file

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.

Parameters

The following parameters are available in the keepalived::vrrp::vrrp_track_file defined type:

file_name

Data type: String[1]

name of track file

weight

Data type: Integer

The weight that should add to the instance.

Default value: 1

init_file

Data type: Optional[String[1]]

create the file and/or initialise the value

Default value: undef

overwrite

Data type: Boolean

This causes VALUE (default 0) to be written to

Default value: false

Data types

Keepalived::Global_defs::Lvs_sync_daemon

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

keepalived::options

Alias of Hash[String[1], Any]

Keepalived::Vrrp::Instance::VRule

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,
}]