haproxy
Version information
This version is compatible with:
- Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
- Puppet >= 6.0.0 < 8.0.0
- , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppetlabs-haproxy', '6.2.1'
Learn more about managing modules with a PuppetfileDocumentation
haproxy
Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with haproxy
- Usage - Configuration options and additional functionality
- Configure HAProxy options
- HAProxy and Software Collections
- Configure HAProxy daemon listener
- Configure multi-network daemon listener
- Configure HAProxy load-balanced member nodes
- Configure a load balancer with exported resources
- Set up a frontend service
- Set up a backend service
- Set up a resolver
- Configure multiple haproxy instances on one machine
- Manage a map file
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Overview
The haproxy module lets you use Puppet to install, configure, and manage HAProxy.
Module Description
HAProxy is a daemon for load-balancing and proxying TCP- and HTTP-based services. This module lets you use Puppet to configure HAProxy servers and backend member servers.
Setup
Beginning with haproxy
The simplest HAProxy configuration consists of a server that listens on a port and balances against some other nodes:
node 'haproxy-server' {
include ::haproxy
haproxy::listen { 'puppet00':
collect_exported => false,
ipaddress => $::ipaddress,
ports => '8140',
}
haproxy::balancermember { 'server00':
listening_service => 'puppet00',
server_names => 'server00.example.com',
ipaddresses => '10.0.0.10',
ports => '8140',
options => 'check',
}
haproxy::balancermember { 'server01':
listening_service => 'puppet00',
server_names => 'server01.example.com',
ipaddresses => '10.0.0.11',
ports => '8140',
options => 'check',
}
}
Usage
Configure HAProxy options
The main haproxy
class has many options for configuring your HAProxy server:
class { 'haproxy':
global_options => {
'log' => "${::ipaddress} local0",
'chroot' => '/var/lib/haproxy',
'pidfile' => '/var/run/haproxy.pid',
'maxconn' => '4000',
'user' => 'haproxy',
'group' => 'haproxy',
'daemon' => '',
'stats' => 'socket /var/lib/haproxy/stats',
},
defaults_options => {
'log' => 'global',
'stats' => 'enable',
'option' => [
'redispatch',
],
'retries' => '3',
'timeout' => [
'http-request 10s',
'queue 1m',
'connect 10s',
'client 1m',
'server 1m',
'check 10s',
],
'maxconn' => '8000',
},
}
The above shown values are the module's defaults for platforms like Debian and RedHat (see haproxy::params
for details). If you wish to override or add to any of these defaults set merge_options => true
(see below) and set global_options
and/or defaults_options
to a hash containing just the option => value
pairs you need changed or added. In case of duplicates your supplied values will "win" over the default values (this is especially noteworthy for arrays -- they cannot be merged easily). If you want to completely remove a parameter set it to the special value undef
:
class { 'haproxy':
global_options => {
'maxconn' => undef,
'user' => 'root',
'group' => 'root',
'stats' => [
'socket /var/lib/haproxy/stats',
'timeout 30s'
]
},
defaults_options => {
'retries' => '5',
'option' => [
'redispatch',
'http-server-close',
'logasap',
],
'timeout' => [
'http-request 7s',
'connect 3s',
'check 9s',
],
'maxconn' => '15000',
},
}
HAProxy and Software Collections
To use this module with a software collection such as rh-haproxy18 you will need to set a few extra parameters like so:
class { 'haproxy':
package_name => 'rh-haproxy18',
config_dir => '/etc/opt/rh/rh-haproxy18/haproxy',
config_file => '/etc/opt/rh/rh-haproxy18/haproxy/haproxy.cfg',
config_validate_cmd => '/bin/scl enable rh-haproxy18 "haproxy -f % -c"',
service_name => 'rh-haproxy18-haproxy',
}
Configure HAProxy daemon listener
To export the resource for a balancermember and collect it on a single HAProxy load balancer server:
haproxy::listen { 'puppet00':
ipaddress => $::ipaddress,
ports => '8140',
mode => 'tcp',
options => {
'option' => [
'tcplog',
],
'balance' => 'roundrobin',
},
}
Configure multi-network daemon listener
If you need a more complex configuration for the listen block, use the $bind
parameter:
haproxy::listen { 'puppet00':
mode => 'tcp',
options => {
'option' => [
'tcplog',
],
'balance' => 'roundrobin',
},
bind => {
'10.0.0.1:443' => ['ssl', 'crt', 'puppetlabs.com'],
'168.12.12.12:80' => [],
'192.168.122.42:8000-8100' => ['ssl', 'crt', 'puppetlabs.com'],
':8443,:8444' => ['ssl', 'crt', 'internal.puppetlabs.com']
},
}
Note: $ports
and $ipaddress
cannot be used in combination with $bind
.
Configure HAProxy load-balanced member nodes
First export the resource for a balancermember:
@@haproxy::balancermember { 'haproxy':
listening_service => 'puppet00',
ports => '8140',
server_names => $::hostname,
ipaddresses => $::ipaddress,
options => 'check',
}
Then collect the resource on a load balancer:
Haproxy::Balancermember <<| listening_service == 'puppet00' |>>
Then create the resource for multiple balancermembers at once:
haproxy::balancermember { 'haproxy':
listening_service => 'puppet00',
ports => '8140',
server_names => ['server01', 'server02'],
ipaddresses => ['192.168.56.200', '192.168.56.201'],
options => 'check',
}
This example assumes a single-pass installation of HAProxy where you know the members in advance. Otherwise, you'd need a first pass to export the resources.
Configure a load balancer with exported resources
Install and configure an HAProxy service listening on port 8140 and balanced against all collected nodes:
node 'haproxy-server' {
include ::haproxy
haproxy::listen { 'puppet00':
ipaddress => $::ipaddress,
ports => '8140',
}
}
node /^server\d+/ {
@@haproxy::balancermember { $::fqdn:
listening_service => 'puppet00',
server_names => $::hostname,
ipaddresses => $::ipaddress,
ports => '8140',
options => 'check',
}
}
The resulting HAProxy service uses storeconfigs to collect and realize balancermember servers, and automatically collects configurations from backend servers. The backend nodes export their HAProxy configurations to the Puppet Server, which then distributes them to the HAProxy server.
Set up a frontend service
This example routes traffic from port 8140 to all balancermembers added to a backend with the title 'puppet_backend00':
haproxy::frontend { 'puppet00':
ipaddress => $::ipaddress,
ports => '8140',
mode => 'tcp',
bind_options => 'accept-proxy',
options => {
'default_backend' => 'puppet_backend00',
'timeout client' => '30s',
'option' => [
'tcplog',
'accept-invalid-http-request',
],
},
}
If option order is important, pass an array of hashes to the options
parameter:
haproxy::frontend { 'puppet00':
ipaddress => $::ipaddress,
ports => '8140',
mode => 'tcp',
bind_options => 'accept-proxy',
options => [
{ 'default_backend' => 'puppet_backend00' },
{ 'timeout client' => '30s' },
{ 'option' => [
'tcplog',
'accept-invalid-http-request',
],
}
],
}
This adds the frontend options to the configuration block in the same order as they appear within your array.
Set up a backend service
haproxy::backend { 'puppet00':
options => {
'option' => [
'tcplog',
],
'balance' => 'roundrobin',
},
}
If option order is important, pass an array of hashes to the options
parameter:
haproxy::backend { 'puppet00':
options => [
{ 'option' => [
'tcplog',
]
},
{ 'balance' => 'roundrobin' },
{ 'cookie' => 'C00 insert' },
],
}
Set up a resolver
Note: This is only available on haproxy 1.6+
# Need to start with an init-addr parameter set to none and enable runtime DNS resolution.
class { 'haproxy':
...
defaults_options => {
'default-server' => 'init-addr none',
...
},
}
# Declare the resolver
haproxy::resolver { 'puppet00':
nameservers => {
'dns1' => '192.168.56.1:53',
'dns2' => '192.168.56.2:53'
},
hold => {
'nx' => '30s',
'valid' => '10s'
},
resolve_retries => 3,
timeout => {
'retry' => '1s'
},
accepted_payload_size => 512,
}
# Setup the balancermember to use the resolver for DNS resolution
haproxy::balancermember { 'haproxy':
listening_service => 'puppet00',
ports => '8140',
server_names => ['server01', 'server02'],
ipaddresses => ['server01', 'server02'],
options => 'check resolvers puppet00 resolve-prefer ipv4',
}
Set up stick-tables for a frontend (or a backend)
haproxy::backend { 'backend01':
options => [
{ 'stick-table' => 'type ip size 1 nopurge peers LB' },
{ 'stick' => 'on dst' },
],
}
This adds the backend options to the configuration block in the same order as they appear within the array.
Configure multiple haproxy instances on one machine
This is an advanced feature typically only used at large sites.
It is possible to run multiple haproxy processes ("instances") on the same machine. This has the benefit that each is a distinct failure domain, each can be restarted independently, and each can run a different binary.
In this use case, instead of using Class['haproxy']
, each process
is started using haproxy::instance{'inst'}
where inst
is the
name of the instance. It assumes there is a matching Service['inst']
that will be used to manage service. Different sites may have
different requirements for how the Service[]
is constructed.
However, haproxy::instance_service
exists as an example of one
way to do this, and may be sufficient for most sites.
In this example, two instances are created. The first uses the standard
class and uses haproxy::instance
to add an additional instance called
beta
.
include ::haproxy
haproxy::listen { 'puppet00':
instance => 'haproxy',
collect_exported => false,
ipaddress => $::ipaddress,
ports => '8800',
}
haproxy::instance { 'beta': }
->
haproxy::instance_service { 'beta':
haproxy_package => 'custom_haproxy',
haproxy_init_source => "puppet:///modules/${module_name}/haproxy-beta.init",
}
->
haproxy::listen { 'puppet00':
instance => 'beta',
collect_exported => false,
ipaddress => $::ipaddress,
ports => '9900',
}
In this example, two instances are created called group1
and group2
.
The second uses a custom package.
haproxy::instance { 'group1': }
->
haproxy::instance_service { 'group1':
haproxy_init_source => "puppet:///modules/${module_name}/haproxy-group1.init",
}
->
haproxy::listen { 'group1-puppet00':
section_name => 'puppet00',
instance => 'group1',
collect_exported => false,
ipaddress => $::ipaddress,
ports => '8800',
}
haproxy::instance { 'group2': }
->
haproxy::instance_service { 'group2':
haproxy_package => 'custom_haproxy',
haproxy_init_source => "puppet:///modules/${module_name}/haproxy-group2.init",
}
->
haproxy::listen { 'group2-puppet00':
section_name => 'puppet00',
instance => 'group2',
collect_exported => false,
ipaddress => $::ipaddress,
ports => '9900',
}
Manage a map file
haproxy::mapfile { 'domains-to-backends':
ensure => 'present',
mappings => [
{ 'app01.example.com' => 'bk_app01' },
{ 'app02.example.com' => 'bk_app02' },
{ 'app03.example.com' => 'bk_app03' },
{ 'app04.example.com' => 'bk_app04' },
'app05.example.com bk_app05',
'app06.example.com bk_app06',
],
}
This creates a file /etc/haproxy/domains-to-backends.map
containing the mappings specified in the mappings
array.
The map file can then be used in a frontend to map Host:
values to backends, implementing name-based virtual hosting:
frontend ft_allapps
[...]
use_backend %[req.hdr(host),lower,map(/etc/haproxy/domains-to-backends.map,bk_default)]
Or expressed using haproxy::frontend
:
haproxy::frontend { 'ft_allapps':
ipaddress => '0.0.0.0',
ports => '80',
mode => 'http',
options => {
'use_backend' => '%[req.hdr(host),lower,map(/etc/haproxy/domains-to-backends.map,bk_default)]'
}
}
Reference
For information on the classes and types, see the REFERENCE.md
Limitations
For an extensive list of supported operating systems, see metadata.json
Development
Acceptance tests for this module leverage puppet_litmus. To run the acceptance tests follow the instructions here. You can also find a tutorial and walkthrough of using Litmus and the PDK on YouTube.
If you run into an issue with this module, or if you would like to request a feature, please file a ticket. Every Monday the Puppet IA Content Team has office hours in the Puppet Community Slack, alternating between an EMEA friendly time (1300 UTC) and an Americas friendly time (0900 Pacific, 1700 UTC).
If you have problems getting this module up and running, please contact Support.
If you submit a change to this module, be sure to regenerate the reference documentation as follows:
puppet strings generate --format markdown --out REFERENCE.md
Reference
Table of Contents
Classes
haproxy
: A Puppet module, using storeconfigs, to model an haproxy configuration. Currently VERY limited - assumes Redhat/CentOS setup. Pull requests ahaproxy::globals
: For global configuration options used by all haproxy instances.haproxy::params
: This is a container class holding default parameters for for haproxy class.
Defined types
Public Defined types
haproxy::backend
: This type will setup a backend service configuration block inside the haproxy.cfg file on an haproxy load balancer.haproxy::balancermember
: This type will setup a balancer member inside a listening service configuration block in /etc/haproxy/haproxy.cfg on the load balancer.haproxy::defaults
: This type will setup a additional defaults configuration block inside the haproxy.cfg file on an haproxy load balancer.haproxy::frontend
: This type will setup a frontend service configuration block inside the haproxy.cfg file on an haproxy load balancer.haproxy::instance
: Manages haproxy permitting multiple instances to run on the same machine.haproxy::instance_service
: Set up the environment for an haproxy service.haproxy::listen
: This type will setup a listening service configuration block inside the haproxy.cfg file on an haproxy load balancer.haproxy::mailer
: This type will set up a mailer entry inside the mailers configuration block in haproxy.cfg on the load balancer.haproxy::mailers
: This type will set up a mailers entry in haproxy.cfg on the load balancer.haproxy::mapfile
: Manage an HAProxy map file as documented in https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#7.3.1-maphaproxy::peer
: This type will set up a peer entry inside the peers configuration block in haproxy.cfg on the load balancer.haproxy::peer::collect_exported
: Private definehaproxy::peers
: This type will set up a peers entry in haproxy.cfghaproxy::resolver
: This type will setup resolvers configuration block inside the haproxy.cfg file on an haproxy load balancer.haproxy::userlist
: This type will set up a userlist configuration block inside the haproxy.cfg file on an haproxy load balancer.
Private Defined types
haproxy::balancermember::collect_exported
haproxy::config
: HAProxy configurationhaproxy::install
: Install haproxyhaproxy::mailer::collect_exported
haproxy::service
: HAProxy service
Classes
haproxy
A Puppet module, using storeconfigs, to model an haproxy configuration. Currently VERY limited - assumes Redhat/CentOS setup. Pull requests accepted!
Currently requires the puppetlabs/concat module on the Puppet Forge and uses storeconfigs on the Puppet Server to export/collect resources from all balancer members.
Examples
class { 'haproxy':
global_options => {
'log' => "${::ipaddress} local0",
'chroot' => '/var/lib/haproxy',
'pidfile' => '/var/run/haproxy.pid',
'maxconn' => '4000',
'user' => 'haproxy',
'group' => 'haproxy',
'daemon' => '',
'stats' => 'socket /var/lib/haproxy/stats'
},
defaults_options => {
'log' => 'global',
'stats' => 'enable',
'option' => 'redispatch',
'retries' => '3',
'timeout' => [
'http-request 10s',
'queue 1m',
'connect 10s',
'client 1m',
'server 1m',
'check 10s'
],
'maxconn' => '8000'
},
}
Parameters
The following parameters are available in the haproxy
class:
package_ensure
package_name
service_ensure
service_manage
service_name
service_options
sysconfig_options
global_options
defaults_options
merge_options
restart_command
custom_fragment
config_dir
config_file
config_validate_cmd
manage_config_dir
manage_service
enable
package_ensure
Data type: String[1]
Ensure the package is present (installed), absent or a specific version. Defaults to 'present'
Default value: 'present'
package_name
Data type: String
The package name of haproxy. Defaults to 'haproxy' NOTE: haproxy::instance has a different default.
Default value: $haproxy::params::package_name
service_ensure
Data type: Variant[Enum['running', 'stopped'], Boolean]
Chooses whether the haproxy service should be running & enabled at boot, or stopped and disabled at boot. Defaults to 'running'
Default value: 'running'
service_manage
Data type: Boolean
Chooses whether the haproxy service state should be managed by puppet at all. Defaults to true
Default value: true
service_name
Data type: String
The service name for haproxy. Defaults to 'haproxy' NOTE: haproxy::instance has a different default.
Default value: $haproxy::params::service_name
service_options
Data type: String
Contents for the /etc/defaults/haproxy
file on Debian. Defaults to "ENABLED=1\n" on Debian, and is ignored on other systems.
Default value: $haproxy::params::service_options
sysconfig_options
Data type: Any
Contents for the /etc/sysconfig/haproxy
file on RedHat(-based) systems.
Defaults to OPTIONS="" on RedHat(-based) systems and is ignored on others
Default value: $haproxy::params::sysconfig_options
global_options
Data type: Hash
A hash of all the haproxy global options. If you want to specify more than one option (i.e. multiple timeout or stats options), pass those options as an array and you will get a line for each of them in the resultant haproxy.cfg file.
Default value: $haproxy::params::global_options
defaults_options
Data type: Hash
A hash of all the haproxy defaults options. If you want to specify more than one option (i.e. multiple timeout or stats options), pass those options as an array and you will get a line for each of them in the resultant haproxy.cfg file.
Default value: $haproxy::params::defaults_options
merge_options
Data type: Boolean
Whether to merge the user-supplied global_options
/defaults_options
hashes with their default values set in params.pp. Merging allows to change
or add options without having to recreate the entire hash. Defaults to
false, but will default to true in future releases.
Default value: $haproxy::params::merge_options
restart_command
Data type: Any
Command to use when restarting the on config changes. Passed directly as the 'restart' parameter to the service resource. Defaults to undef i.e. whatever the service default is.
Default value: undef
custom_fragment
Data type: Any
Allows arbitrary HAProxy configuration to be passed through to support additional configuration not available via parameters, or to short-circute the defined resources such as haproxy::listen when an operater would rather just write plain configuration. Accepts a string (ie, output from the template() function). Defaults to undef
Default value: undef
config_dir
Data type: Stdlib::Absolutepath
Path to the directory in which the main configuration file haproxy.cfg
resides. Will also be used for storing any managed map files (see
haproxy::mapfile
). Default depends on platform.
Default value: $haproxy::params::config_dir
config_file
Data type: Optional[Stdlib::Absolutepath]
Optional. Path to the haproxy config file. Default depends on platform.
Default value: $haproxy::params::config_file
config_validate_cmd
Data type: Any
Optional. Command used by concat validate_cmd to validate new config file concat is a valid haproxy config. Default /usr/sbin/haproxy -f % -c
Default value: $haproxy::params::config_validate_cmd
manage_config_dir
Data type: Any
Optional.
Default value: $haproxy::params::manage_config_dir
manage_service
Data type: Any
Deprecated
Default value: undef
enable
Data type: Any
Deprecated
Default value: undef
haproxy::globals
For global configuration options used by all haproxy instances.
Parameters
The following parameters are available in the haproxy::globals
class:
sort_options_alphabetic
Data type: Boolean
Sort options either alphabetic or custom like haproxy internal sorts them. Defaults to true.
Default value: true
haproxy::params
This is a container class holding default parameters for for haproxy class.
- Note Currently, only the Redhat family is supported, but this can be easily extended by changing package names and configuration file paths.
Defined types
haproxy::backend
=== Authors
Gary Larizza gary@puppetlabs.com Jeremy Kitchen jeremy@nationbuilder.com
- Note Each backend service needs one or more backend member servers (that can be declared with the haproxy::balancermember defined resource type). Using storeconfigs, you can export the haproxy::balancermember resources on all load balancer member servers and then collect them on a single haproxy load balancer server.
Examples
haproxy::backend { 'puppet00':
options => {
'option' => [
'tcplog',
'ssl-hello-chk'
],
'balance' => 'roundrobin'
},
}
Parameters
The following parameters are available in the haproxy::backend
defined type:
section_name
Data type: Any
This name goes right after the 'backend' statement in haproxy.cfg Default: $name (the namevar of the resource).
Default value: $name
mode
Data type: Any
The mode of operation for the backend service. Valid values are undef, 'tcp', 'http', and 'health'.
Default value: undef
options
Data type: Any
A hash of options that are inserted into the backend configuration block.
Default value: { 'balance' => 'roundrobin', }
collect_exported
Data type: Any
Boolean, default 'true'. True means 'collect exported @@balancermember resources' (for the case when every balancermember node exports itself), false means 'rely on the existing declared balancermember resources' (for the case when you know the full set of balancermember in advance and use haproxy::balancermember with array arguments, which allows you to deploy everything in 1 run)
Default value: true
config_file
Data type: Optional[Stdlib::Absolutepath]
Optional. Path of the config file where this entry will be added. Assumes that the parent directory exists. Default: $haproxy::params::config_file
Default value: undef
sort_options_alphabetic
Data type: Any
Sort options either alphabetic or custom like haproxy internal sorts them. Defaults to true.
Default value: undef
defaults
Data type: Any
Name of the defaults section this backend will use. Defaults to undef which means the global defaults section will be used.
Default value: undef
instance
Data type: Any
Optional. Defaults to 'haproxy'
Default value: 'haproxy'
haproxy::balancermember
This type will setup a balancer member inside a listening service configuration block in /etc/haproxy/haproxy.cfg on the load balancer.
- Note Currently it only has the ability to specify the instance name, ip address, port, and whether or not it is a backup. More features can be added as needed. The best way to implement this is to export this resource for all haproxy balancer member servers, and then collect them on the main haproxy load balancer.
Examples
Exporting the resource for a balancer member:
@@haproxy::balancermember { 'haproxy':
listening_service => 'puppet00',
ports => '8140',
server_names => $::hostname,
ipaddresses => $::ipaddress,
options => 'check',
}
Collecting the resource on a load balancer
Haproxy::Balancermember <<| listening_service == 'puppet00' |>>
Creating the resource for multiple balancer members at once
(for single-pass installation of haproxy without requiring a first
pass to export the resources if you know the members in advance):
haproxy::balancermember { 'haproxy':
listening_service => 'puppet00',
ports => '8140',
server_names => ['server01', 'server02'],
ipaddresses => ['192.168.56.200', '192.168.56.201'],
options => 'check',
}
Implemented in HAPROXY 1.8:
Set a template to initialize servers with shared parameters.
The names of these servers are built from <prefix> and <amount> parameters.
Initializes 5 servers with srv1, srv2, srv3, srv4 and srv5 as names,
myserver.example.com as FQDN, 8140 as port, and health-check enabled.
haproxy::balancermember { 'haproxy':
listening_service => 'puppet00',
type => 'server-template'
port => '8140',
prefix => 'srv',
amount => '1-5',
fqdn => 'myserver.example.com',
options => 'check',
}
(this resource can be declared anywhere)
Parameters
The following parameters are available in the haproxy::balancermember
defined type:
listening_service
ports
port
server_names
ipaddresses
prefix
amount
fqdn
options
define_cookies
defaults
config_file
verifyhost
weight
instance
type
listening_service
Data type: Any
The haproxy service's instance name (or, the title of the haproxy::listen resource). This must match up with a declared haproxy::listen resource.
ports
Data type: Any
An array or commas-separated list of ports for which the balancer member will accept connections from the load balancer. Note that cookie values aren't yet supported, but shouldn't be difficult to add to the configuration. If you use an array in server_names and ipaddresses, the same port is used for all balancermembers.
Default value: undef
port
Data type: Any
A port for server-template. It is an optional specification.
Default value: undef
server_names
Data type: Any
The name of the balancer member server as known to haproxy in the listening service's configuration block. This defaults to the hostname. Can be an array of the same length as ipaddresses, in which case a balancermember is created for each pair of server_names and ipaddresses (in lockstep).
Default value: $::hostname
ipaddresses
Data type: Any
The ip address used to contact the balancer member server. Can be an array, see documentation to server_names.
Default value: $::ipaddress
prefix
Data type: Any
A prefix for the server-template for the server names to be built.
Default value: 'server'
amount
Data type: Any
If "amount" is provided, the server-template initializes servers with 1 up to as server name suffixes. A range of numbers <num_low>-<num_high> may also be used to use <num_low> up to <num_high> as server name suffixes.
Default value: '1'
fqdn
Data type: Any
A FQDN for all the servers the server-template initializes.
Default value: ''
options
Data type: Any
An array of options to be specified after the server declaration in the listening service's configuration block.
Default value: ''
define_cookies
Data type: Any
If true, then add "cookie SERVERID" stickiness options. Default false.
Default value: false
defaults
Data type: Any
Name of the defaults section the backend or listener use. Defaults to undef.
Default value: undef
config_file
Data type: Optional[Stdlib::Absolutepath]
Optional. Path of the config file where this entry will be added. Assumes that the parent directory exists. Default: $haproxy::params::config_file
Default value: undef
verifyhost
Data type: Any
Optional. Will add the verifyhost option to the server line, using the specific host from server_names as an argument. Default: false
Default value: false
weight
Data type: Any
Optional. Will add the weight option to the server line Default: undef
Default value: undef
instance
Data type: Any
Optional. Defaults to 'haproxy'
Default value: 'haproxy'
type
Data type: Enum['server', 'default-server', 'server-template']
Optional. Defaults to 'server'
Default value: 'server'
haproxy::defaults
This type will setup a additional defaults configuration block inside the haproxy.cfg file on an haproxy load balancer.
- Note A new default configuration block resets all defaults of prior defaults configuration blocks. Listener, Backends, Frontends and Balancermember can be configured behind a default configuration block by setting the defaults parameter to the corresponding defaults name.
Parameters
The following parameters are available in the haproxy::defaults
defined type:
options
Data type: Any
A hash of options that are inserted into the defaults configuration block.
Default value: {}
sort_options_alphabetic
Data type: Any
Sort options either alphabetic or custom like haproxy internal sorts them. Defaults to true.
Default value: undef
instance
Data type: Any
Optional. Defaults to 'haproxy'.
Default value: 'haproxy'
haproxy::frontend
=== Authors
Gary Larizza gary@puppetlabs.com
- Note Currently requires the puppetlabs/concat module on the Puppet Forge and uses storeconfigs on the Puppet Server to export/collect resources from all balancer members.
Examples
Exporting the resource for a balancer member:
haproxy::frontend { 'puppet00':
ipaddress => $::ipaddress,
ports => '18140',
mode => 'tcp',
bind_options => 'accept-proxy',
options => {
'option' => [
'tcplog',
'accept-invalid-http-request',
],
'timeout client' => '30s',
'balance' => 'roundrobin'
},
}
Parameters
The following parameters are available in the haproxy::frontend
defined type:
section_name
ports
bind
ipaddress
mode
bind_options
options
sort_options_alphabetic
defaults
defaults_use_backend
config_file
collect_exported
instance
section_name
Data type: Any
This name goes right after the 'frontend' statement in haproxy.cfg Default: $name (the namevar of the resource).
Default value: $name
ports
Data type: Any
Ports on which the proxy will listen for connections on the ip address specified in the ipaddress parameter. Accepts either a single comma-separated string or an array of strings which may be ports or hyphenated port ranges.
Default value: undef
bind
Data type: Optional[Hash]
Set of ip addresses, port and bind options $bind = { '10.0.0.1:80' => ['ssl', 'crt', '/path/to/my/crt.pem'] }
Default value: undef
ipaddress
Data type: Any
The ip address the proxy binds to. Empty addresses, '*', and '0.0.0.0' mean that the proxy listens to all valid addresses on the system.
Default value: undef
mode
Data type: Any
The mode of operation for the frontend service. Valid values are undef, 'tcp', 'http', and 'health'.
Default value: undef
bind_options
Data type: Any
(Deprecated) An array of options to be specified after the bind declaration in the listening serivce's configuration block.
Default value: ''
options
Data type: Any
A hash of options that are inserted into the frontend service configuration block.
Default value: { 'option' => [ 'tcplog', ], }
sort_options_alphabetic
Data type: Any
Sort options either alphabetic or custom like haproxy internal sorts them. Defaults to true.
Default value: undef
defaults
Data type: Any
Name of the defaults section this backend will use. Defaults to undef which means the global defaults section will be used.
Default value: undef
defaults_use_backend
Data type: Any
If defaults are used and a default backend is configured use the backend name for ordering. This means that the frontend is placed in the configuration file before the backend configuration. Defaults to true.
Default value: true
config_file
Data type: Optional[Stdlib::Absolutepath]
Optional. Path of the config file where this entry will be added. Assumes that the parent directory exists. Default: $haproxy::params::config_file
Default value: undef
collect_exported
Data type: Any
Boolean. Default true
Default value: true
instance
Data type: Any
Optional. Defaults to 'haproxy'
Default value: 'haproxy'
haproxy::instance
template() function). Defaults to undef
- Note Normally users use the Class['haproxy'], which runs a single haproxy daemon on a machine.
Examples
A single instance of haproxy with all defaults
i.e. emulate Class['haproxy']
package{ 'haproxy': ensure => present }->haproxy::instance { 'haproxy': }->
haproxy::listen { 'puppet00':
instance => 'haproxy',
collect_exported => false,
ipaddress => $::ipaddress,
ports => '8140',
}
Multiple instances of haproxy:
haproxy::instance { 'group1': }
haproxy::instance_service { 'group1':
haproxy_init_source => "puppet:///modules/${module_name}/haproxy-group1.init",
}
haproxy::listen { 'puppet00':
instance => 'group1',
collect_exported => false,
ipaddress => $::ipaddress,
ports => '8800',
requires => Package['haproxy'],
}
haproxy::instance { 'group2': }
haproxy::instance_service { 'group2':
haproxy_init_source => "puppet:///modules/${module_name}/haproxy-group1.init",
}
haproxy::listen { 'puppet00':
instance => 'group2',
collect_exported => false,
ipaddress => $::ipaddress,
ports => '9900',
requires => Package['haproxy'],
}
Multiple instances of haproxy, one with a custom haproxy package:
haproxy::instance { 'group1': }
haproxy::instance_service { 'group1':
haproxy_init_source => "puppet:///modules/${module_name}/haproxy-group1.init",
}
haproxy::listen { 'puppet00':
instance => 'group1',
collect_exported => false,
ipaddress => $::ipaddress,
ports => '8800',
requires => Package['haproxy'],
}
haproxy::instance { 'group2': }
haproxy::instance_service { 'group2':
haproxy_package => 'custom_haproxy',
haproxy_init_source => "puppet:///modules/${module_name}/haproxy-group2.init",
}
haproxy::listen { 'puppet00':
instance => 'group2',
collect_exported => false,
ipaddress => $::ipaddress,
ports => '9900',
requires => Package['haproxy'],
}
Parameters
The following parameters are available in the haproxy::instance
defined type:
package_ensure
package_name
service_ensure
service_manage
service_name
global_options
defaults_options
restart_command
custom_fragment
config_file
config_validate_cmd
config_dir
merge_options
service_options
sysconfig_options
package_ensure
Data type: String[1]
Ensure the package is present (installed), absent or a specific version. Defaults to 'present'
Default value: 'present'
package_name
Data type: Optional[String]
The package name of haproxy. Defaults to undef, and no package is installed. NOTE: Class['haproxy'] has a different default.
Default value: undef
service_ensure
Data type: Variant[Enum['running', 'stopped'], Boolean]
Chooses whether the haproxy service should be running & enabled at boot, or stopped and disabled at boot. Defaults to 'running'
Default value: 'running'
service_manage
Data type: Boolean
Chooses whether the haproxy service state should be managed by puppet at all. Defaults to true
Default value: true
service_name
Data type: Optional[String]
The service name for haproxy. Defaults to undef. If no name is given then the value computed for $instance_name will be used. NOTE: Class['haproxy'] has a different default.
Default value: undef
global_options
Data type: Optional[Hash]
A hash of all the haproxy global options. If you want to specify more than one option (i.e. multiple timeout or stats options), pass those options as an array and you will get a line for each of them in the resultant haproxy.cfg file.
Default value: undef
defaults_options
Data type: Optional[Hash]
A hash of all the haproxy defaults options. If you want to specify more than one option (i.e. multiple timeout or stats options), pass those options as an array and you will get a line for each of them in the resultant haproxy.cfg file.
Default value: undef
restart_command
Data type: Any
Command to use when restarting the on config changes. Passed directly as the 'restart' parameter to the service resource. # Defaults to undef i.e. whatever the service default is.
Default value: undef
custom_fragment
Data type: Any
Allows arbitrary HAProxy configuration to be passed through to support additional configuration not available via parameters, or to short-circuit the defined resources such as haproxy::listen when an operater would rather just write plain configuration. Accepts a string (ie, output from the
Default value: undef
config_file
Data type: Optional[Stdlib::Absolutepath]
Allows arbitrary config filename to be specified. If this is used, it is assumed that the directory path to the file exists and has owner/group/permissions as desired. If set to undef, the name will be generated as follows: If $title is 'haproxy', the operating system default will be used. Otherwise, /etc/haproxy-$title/haproxy-$title.conf (Linux), or /usr/local/etc/haproxy-$title/haproxy-$title.conf (FreeBSD) The parent directory will be created automatically. Defaults to undef.
Default value: undef
config_validate_cmd
Data type: Any
Command used by concat validate_cmd to validate new config file concat is a valid haproxy config. Default /usr/sbin/haproxy -f % -c
Default value: $haproxy::params::config_validate_cmd
config_dir
Data type: Any
Optional. Default undef.
Default value: undef
merge_options
Data type: Any
Default value: $haproxy::params::merge_options
service_options
Data type: Any
Default value: $haproxy::params::service_options
sysconfig_options
Data type: Any
Default value: $haproxy::params::sysconfig_options
haproxy::instance_service
Set up the environment for an haproxy service.
- Note * Associate an haproxy instance with the haproxy package it should use.
- Create the start/restart/stop functions needed by Service[]. In other words: sets things up so that Service[$instance_name] will work.
In particular:
- Create a link to the binary an instance will be using. This way each instance can link to a different binary. If you have an instance called "foo", you know "haproxy-foo" is a link to the binary it should be using.
- Create an init.d file named after the instance. This way Service[$instance] can start/restart the service.
Parameters
The following parameters are available in the haproxy::instance_service
defined type:
haproxy_package
Data type: String
The name of the package to be installed. This is useful if you package your own custom version of haproxy. Defaults to 'haproxy'
Default value: 'haproxy'
bindir
Data type: Stdlib::Absolutepath
Where to put symlinks to the binary used for each instance. Defaults to '/opt/haproxy'
Default value: '/opt/haproxy/bin'
haproxy_init_source
Data type: Optional[String]
The init.d script that will start/restart/reload this instance.
Default value: undef
haproxy_unit_template
Data type: Optional[String]
Default value: 'haproxy/instance_service_unit.erb'
haproxy::listen
=== Authors
Gary Larizza gary@puppetlabs.com
- Note Each listening service configuration needs one or more load balancer member server (that can be declared with the haproxy::balancermember defined resource type). Using storeconfigs, you can export the haproxy::balancermember resources on all load balancer member servers, and then collect them on a single haproxy load balancer server.
Examples
haproxy::listen { 'puppet00':
ipaddress => $::ipaddress,
ports => '18140',
mode => 'tcp',
options => {
'option' => [
'tcplog',
'ssl-hello-chk'
],
'balance' => 'roundrobin'
},
}
Parameters
The following parameters are available in the haproxy::listen
defined type:
section_name
ports
ipaddress
bind
mode
options
bind_options
collect_exported
sort_options_alphabetic
defaults
config_file
instance
section_name
Data type: Any
This name goes right after the 'listen' statement in haproxy.cfg Default: $name (the namevar of the resource).
Default value: $name
ports
Data type: Any
Ports on which the proxy will listen for connections on the ip address specified in the ipaddress parameter. Accepts either a single comma-separated string or an array of strings which may be ports or hyphenated port ranges.
Default value: undef
ipaddress
Data type: Any
The ip address the proxy binds to. Empty addresses, '*', and '0.0.0.0' mean that the proxy listens to all valid addresses on the system.
Default value: undef
bind
Data type: Optional[Hash]
Set of ip addresses, port and bind options $bind = { '10.0.0.1:80' => ['ssl', 'crt', '/path/to/my/crt.pem'] }
Default value: undef
mode
Data type: Any
The mode of operation for the listening service. Valid values are undef, 'tcp', 'http', and 'health'.
Default value: undef
options
Data type: Any
A hash of options that are inserted into the listening service configuration block.
Default value: { 'option' => [ 'tcplog', ], 'balance' => 'roundrobin' }
bind_options
Data type: Any
(Deprecated) An array of options to be specified after the bind declaration in the listening serivce's configuration block.
Default value: ''
collect_exported
Data type: Any
Boolean, default 'true'. True means 'collect exported @@balancermember resources' (for the case when every balancermember node exports itself), false means 'rely on the existing declared balancermember resources' (for the case when you know the full set of balancermembers in advance and use haproxy::balancermember with array arguments, which allows you to deploy everything in 1 run)
Default value: true
sort_options_alphabetic
Data type: Any
Sort options either alphabetic or custom like haproxy internal sorts them. Defaults to true.
Default value: undef
defaults
Data type: Any
Name of the defaults section this backend will use. Defaults to undef which means the global defaults section will be used.
Default value: undef
config_file
Data type: Optional[Stdlib::Absolutepath]
Optional. Path of the config file where this entry will be added. Assumes that the parent directory exists. Default: $haproxy::params::config_file
Default value: undef
instance
Data type: Any
Optional. Defaults to 'haproxy'
Default value: 'haproxy'
haproxy::mailer
This type will set up a mailer entry inside the mailers configuration block in haproxy.cfg on the load balancer.
- Note Currently, it has the ability to specify the instance name, ip address, ports and server_names. Automatic discovery of mailer nodes may be implemented by exporting the mailer resource for all HAProxy balancer servers that are configured in the same HA block and then collecting them on all load balancers.
Parameters
The following parameters are available in the haproxy::mailer
defined type:
mailers_name
Data type: Any
Specifies the mailer in which this load balancer needs to be added.
server_names
Data type: Any
Sets the name of the mailer server in the mailers configuration block. Defaults to the hostname. Can be an array. If this parameter is specified as an array, it must be the same length as the ipaddresses parameter's array. A mailer is created for each pair of server_names and ipaddresses in the array.
Default value: $::hostname
ipaddresses
Data type: Any
Specifies the IP address used to contact the mailer member server. Can be an array. If this parameter is specified as an array it must be the same length as the server_names parameter's array. A mailer is created for each pair of address and server_name.
Default value: $::ipaddress
port
Data type: Any
Sets the port on which the mailer is going to share the state.
instance
Data type: Any
Default value: 'haproxy'
haproxy::mailers
This type will set up a mailers entry in haproxy.cfg on the load balancer.
- Note This setting makes it possible to send emails during state changes.
Parameters
The following parameters are available in the haproxy::mailers
defined type:
instance
Data type: Any
Optional. Defaults to 'haproxy'.
Default value: 'haproxy'
collect_exported
Data type: Any
Boolean. Defaults to true.
Default value: true
haproxy::mapfile
Manage an HAProxy map file as documented in https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#7.3.1-map
- Note A map file contains one key + value per line. These key-value pairs are
specified in the
mappings
array.
Parameters
The following parameters are available in the haproxy::mapfile
defined type:
name
The namevar of the defined resource type is the filename of the map file
(without any extension), relative to the haproxy::config_dir
directory.
A '.map' extension will be added automatically.
mappings
Data type: Array
An array of mappings for this map file. Array elements may be Hashes with a
single key-value pair each (preferably) or simple Strings. Default: []
Default value: []
ensure
Data type: Enum['present', 'absent']
The state of the underlying file resource, either 'present' or 'absent'. Default: 'present'
Default value: 'present'
owner
Data type: Any
The owner of the underlying file resource. Defaut: 'root'
Default value: 'root'
group
Data type: Any
The group of the underlying file resource. Defaut: 'root'
Default value: 'root'
mode
Data type: Any
The mode of the underlying file resource. Defaut: '0644'
Default value: '0644'
instances
Data type: Array
Array of managed HAproxy instance names to notify (restart/reload) when the
map file is updated. This is so that the same map file can be used with
multiple HAproxy instances. Default: [ 'haproxy' ]
Default value: [ 'haproxy' ]
haproxy::peer
This type will set up a peer entry inside the peers configuration block in haproxy.cfg on the load balancer.
- Note Currently, it has the ability to specify the instance name, ip address, ports and server_names.
Parameters
The following parameters are available in the haproxy::peer
defined type:
peers_name
Data type: Any
Specifies the peer in which this load balancer needs to be added.
server_names
Data type: Any
Sets the name of the peer server in the peers configuration block. Defaults to the hostname. Can be an array. If this parameter is specified as an array, it must be the same length as the ipaddresses parameter's array. A peer is created for each pair of server_names and ipaddresses in the array.
Default value: $::hostname
ipaddresses
Data type: Any
Specifies the IP address used to contact the peer member server. Can be an array. If this parameter is specified as an array it must be the same length as the server_names parameter's array. A peer is created for each pair of address and server_name.
Default value: $::ipaddress
port
Data type: Any
Sets the port on which the peer is going to share the state.
config_file
Data type: Optional[Stdlib::Absolutepath]
Optional. Path of the config file where this entry will be added. Assumes that the parent directory exists. Default: $haproxy::params::config_file
Default value: undef
instance
Data type: Any
Default value: 'haproxy'
haproxy::peer::collect_exported
Private define
haproxy::peers
on the load balancer. This setting is required to share the current state of HAproxy with other HAproxy in High available configurations.
Parameters
The following parameters are available in the haproxy::peers
defined type:
name
Sets the peers' name. Generally it will be the namevar of the defined resource type. This value appears right after the 'peers' statement in haproxy.cfg
config_file
Data type: Optional[Stdlib::Absolutepath]
Optional. Path of the config file where this entry will be added. Assumes that the parent directory exists. Default: $haproxy::params::config_file
Default value: undef
instance
Data type: String
Optional. Defaults to 'haproxy'
Default value: 'haproxy'
collect_exported
Data type: Boolean
Boolean. Defaults to true
Default value: true
haproxy::resolver
=== Authors
Gary Larizza gary@puppetlabs.com Ricardo Rosales missingcharacter@gmail.com
- Note Currently requires the puppetlabs/concat module on the Puppet Forge and uses storeconfigs on the Puppet Server to export/collect resources from all balancer members.
Examples
Exporting the resource for a balancer member:
haproxy::resolver { 'puppet00':
nameservers => {
'dns1' => '10.0.0.1:53',
'dns2' => '10.0.0.2:53'
},
hold => {
'nx' => '30s',
'valid' => '10s'
},
resolve_retries => 3,
timeout => {
'retry' => '1s'
},
accepted_payload_size => 512,
}
Parameters
The following parameters are available in the haproxy::resolver
defined type:
section_name
nameservers
hold
resolve_retries
timeout
accepted_payload_size
collect_exported
config_file
sort_options_alphabetic
defaults
instance
section_name
Data type: Any
This name goes right after the 'resolvers' statement in haproxy.cfg Default: $name (the namevar of the resource).
Default value: $name
nameservers
Data type: Any
Set of id, ip addresses and port options. $nameservers = { 'dns1' => '10.0.0.1:53', 'dns2' => '10.0.0.2:53' }
Default value: undef
hold
Data type: Any
Defines during which the last name resolution should be kept based on last valid resolution status. $hold = { 'nx' => '30s', 'valid' => '10s' }
Default value: undef
resolve_retries
Data type: Any
Defines the number of queries to send to resolve a server name before giving up. $resolve_retries = 3
Default value: undef
timeout
Data type: Any
Defines timeouts related to name resolution in the listening serivce's configuration block. $timeout = { 'retry' => '1s' }
Default value: undef
accepted_payload_size
Data type: Any
Defines the maximum payload size accepted by HAProxy and announced to all the name servers configured in this resolvers section. is in bytes. If not set, HAProxy announces 512. (minimal value defined by RFC 6891) Note: the maximum allowed value is 8192.
Default value: undef
collect_exported
Data type: Any
Boolean, default 'true'. True means 'collect exported @@balancermember resources' (for the case when every balancermember node exports itself), false means 'rely on the existing declared balancermember resources' (for the case when you know the full set of balancermember in advance and use haproxy::balancermember with array arguments, which allows you to deploy everything in 1 run)
Default value: true
config_file
Data type: Any
Optional. Path of the config file where this entry will be added. Assumes that the parent directory exists. Default: $haproxy::params::config_file
Default value: undef
sort_options_alphabetic
Data type: Any
Sort options either alphabetic or custom like haproxy internal sorts them. Defaults to true.
Default value: undef
defaults
Data type: Any
Name of the defaults section this backend will use. Defaults to undef which means the global defaults section will be used.
Default value: undef
instance
Data type: Any
Optional. Defaults to 'haproxy'
Default value: 'haproxy'
haproxy::userlist
=== Authors
Jeremy Kitchen jeremy@nationbuilder.com
- Note See http://cbonte.github.io/haproxy-dconv/configuration-1.4.html#3.4 for more info
Parameters
The following parameters are available in the haproxy::userlist
defined type:
section_name
Data type: String
This name goes right after the 'userlist' statement in haproxy.cfg Default: $name (the namevar of the resource).
Default value: $name
users
Data type: Optional[Array[Variant[String, Sensitive[String]]]]
An array of users in the userlist. See http://cbonte.github.io/haproxy-dconv/configuration-1.4.html#3.4-user
Default value: undef
groups
Data type: Optional[Array[String]]
An array of groups in the userlist. See http://cbonte.github.io/haproxy-dconv/configuration-1.4.html#3.4-group
Default value: undef
config_file
Data type: Optional[Stdlib::Absolutepath]
Optional. Path of the config file where this entry will be added. Assumes that the parent directory exists. Default: $haproxy::params::config_file
Default value: undef
instance
Data type: String
Optional. Defaults to 'haproxy'
Default value: 'haproxy'
Change log
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v6.2.1 (2021-08-25)
Fixed
- (IAC-1741) Allow stdlib v8.0.0 #495 (david22swan)
v6.2.0 (2021-08-23)
Added
- pdksync - (IAC-1709) - Add Support for Debian 11 #493 (david22swan)
v6.1.0 (2021-07-06)
Added
- allow type 'default-server' for balancermember #489 (trefzer)
- Use Puppet-Datatype Sensitive #487 (cocker-cc)
v6.0.2 (2021-06-21)
Fixed
v6.0.1 (2021-05-24)
Fixed
v6.0.0 (2021-03-29)
v5.0.0 (2021-02-27)
Changed
- pdksync - Remove Puppet 5 from testing and bump minimal version to 6.0.0 #465 (carabasdaniel)
v4.5.0 (2020-12-14)
Added
- pdksync - (feat) Add support for Puppet 7 #456 (daianamezdrea)
v4.4.0 (2020-11-23)
Added
Fixed
- (bugfix) backend: dont log warnings if not necessary #449 (bastelfreak)
- frontend options: order default_backend after specific backends & test #447 (MajorFlamingo)
v4.3.0 (2020-09-18)
Added
- pdksync - (IAC-973) - Update travis/appveyor to run on new default branch main #437 (david22swan)
- (IAC-746) - Add ubuntu 20.04 support #430 (david22swan)
Fixed
- (IAC-988) - Removal of inappropriate terminology #443 (david22swan)
v4.2.1 (2020-05-19)
Fixed
- Ensure multiple instances may be created with the default package. #348 (surprisingb)
v4.2.0 (2019-12-09)
Added
- (FM-8674) - Support added for CentOS 8 #397 (david22swan)
v4.1.0 (2019-09-26)
Added
- pdksync - Add support on Debian10 #380 (lionce)
- FM-8140 Add redhat8 support #374 (sheenaajay)
- (FM-8220) convert to use litmus #373 (tphoney)
Fixed
- MODULES-9783 - Removed option tcplog #376 (uberjew666)
- Add check of OS for the systemd unitfile #347 (surprisingb)
v4.0.0 (2019-05-16)
Changed
- pdksync - (MODULES-8444) - Raise lower Puppet bound #362 (david22swan)
Added
- [FM-7934] - Puppet Strings #365 (carabasdaniel)
Fixed
- (MODULES-8930) Fix stahnma/epel dependency failures #364 (eimlav)
- Remove execute bit on systemd unit file #354 (shanemadden)
3.0.1 (2019-02-19)
Fixed
3.0.0 (2019-02-04)
Changed
- (FM-7675) - Support has been removed for RHEL 6 #345 (david22swan)
Added
- (MODULES-8539) Added 'accepted_payload_size' to resolver #346 (genebean)
- Sergey leskov/servertemplatekwimp #337 (LeskovSergey)
Fixed
- (MODULES-8407) Add option to set the service's name #342 (genebean)
- pdksync - (FM-7655) Fix rubygems-update for ruby \< 2.3 #341 (tphoney)
2.2.0 (2018-09-27)
Added
- pdksync - (MODULES-6805) metadata.json shows support for puppet 6 #333 (tphoney)
- pdksync - (MODULES-7658) use beaker4 in puppet-module-gems #330 (tphoney)
- (MODULES-7562) - Addition of support for Ubuntu 18.04 to haproxy #324 (david22swan)
- (MODULES-5992) Add debian 9 compatibility #321 (hunner)
Fixed
- pdksync - (MODULES-7658) use beaker3 in puppet-module-gems #327 (tphoney)
- (MODULES-7630) - Update README Limitations section #325 (eimlav)
- [FM-6964] Removal of unsupported OS from haproxy #323 (david22swan)
- (maint) Add netstat for debian9 testing #322 (hunner)
- Change bind_options default value #313 (bdandoy)
2.1.0
Summary
This release uses the PDK convert functionality which in return makes the module PDK compliant. It also includes a roll up of maintenance changes.
Added
- PDK convert HAProxy (MODULES-6457).
Fixed
- Bump allowed concat module version to 5.0.0.
- Changes to address additional Rubocop failures.
- Modulesync updates.
- Re-add support for specifying package version in package_ensure.
Supported Release 2.0.1
Summary
A minor release made in order to implement Rubocop within the module.
Added
- Rubocop has been implemented in the module.
Supported Release 2.0.0
Summary
A substantial release made to create a clean base from which Rubocop may be implemented. Notable changes include the addition of HAproxy Resolver and a Puppet 4 update.
Added
- fast_gettext added to gems.
- Locales folder and config.yml added.
- Support added for balancemember weights.
- Concat validate_cmd can be configured.
- Space now added to headers for formatting.
- Haproxy Resolver added, only supported by Haproxy version 1.6+.
- Update to match Puppet 4 datatypes.
Changed
- Tests updated to match ruby version 2.0.0.
- Mocha version updated.
- Multiple Modulesync updates.
- A listen check was added to the code.
- System service flap detection avoided during acceptance tests.
- Undefined values have been dropped from config template.
- Verifyhost parameter added to balancemember resource.
- validate_* replaced with datatypes.
Fixed
- Fix to $bind_options.
- Fix to example ports listening value.
- Fix to lint warnings.
Removed
- spec.opts removed.
- Validate_cmd no longer attempted on puppet versions below 3.5.
- Pe requirement removed from metadata.
- Ubuntu 10.04 and 12.04 entry in 'metadata.json'.
- Debian 6 entry in 'metadata.json'.
Supported Release 1.5.0
Summary
A substantial release with many new feature additions, including added Ubuntu Xenial support. Also includes several bugfixes, including the removal of unsupported platform testing restrictions to allow for easier testing on unsupported OSes.
Features
- Addition of mode to the backend class.
- Addition of Ubuntu 16.04 support.
- Addition of docs example on how to set up stick-tables.
- Updated to current modulesync configs.
- Basic usage now clarified in readme.
- Now uses concat 2.0.
- Addition of mailers.
- New option to use multiple defaults sections.
- Additional option to manage config_dir.
- Adds sysconfig_options param for /etc/sysconfig/haproxy.
Bugfixes
- No longer adds $ensure to balancermember concat fragments.
- Improved the ordering of options.
- Correct class now used for sort_options_alphabetic.
- Netcat has now been replaced with socat.
- Tests adjusted to work under strict_variables.
- Config file now validated before added.
- Removal of unsupported platforms restrictions in testing.
- Removal of the default-server keyword from test.
- Now uses haproxy::config_file instead of deafult config_file.
Supported Release 1.4.0
Summary
This release adds the addition of the capability to create multiple instances of haproxy on a host. It also adds Debian 8 compatibility, some updates on current features and numerous bug fixes.
Features
- Debian 8 compatibility added.
- Adds haproxy::instance for the creation of multiple instances of haproxy on a host (MODULES-1783)
- Addition of
service_options
parameter for/etc/defaults/haproxy
file on Debian. - Merge of global and default options with user-supplied options - Allows the ability to override or add arbitrary keys and values to the
global_options
anddefaults_options
hashes without having to reproduce the whole hash. - Addition of a defined type haproxy::mapfile to manage map files.
Bugfixes
- Prevents warning on puppet 4 from bind_options.
- Value specified for timeout client now in seconds instead of milliseconds.
- Consistent use of ::haproxy::config_file added (MODULES-2704)
- Fixed bug in which Ruby 1.8 doesn't have
.match
for symbols. - Fix determining $haproxy::config_dir in haproxy::instance.
- Removed ssl-hello-chk from default options.
Supported Release 1.3.1
Summary
Small release for support of newer PE versions. This increments the version of PE in the metadata.json file.
2015-07-15 - Supported Release 1.3.0
Summary
This release adds puppet 4 support, and adds the ability to specify the order
of option entries for haproxy::frontend
and haproxy::listen
defined
resources.
Features
- Adds puppet 4 compatibility
- Updated readme
- Gentoo compatibility
- Suse compatibility
- Add ability for frontend and listen to be ordered
2015-03-10 - Supported Release 1.2.0
Summary
This release adds flexibility for configuration of balancermembers and bind settings, and adds support for configuring peers. This release also renames the tests
directory to examples
Features
- Add support for loadbalancer members without ports
- Add
haproxy_version
fact (MODULES-1619) - Add
haproxy::peer
andhaproxy::peers
defines - Make
bind
parameter processing more flexible
Bugfixes
- Fix 'RedHat' name for osfamily case in
haproxy::params
- Fix lint warnings
- Don't set a default for
ipaddress
so bind can be used (MODULES-1497)
2014-11-04 - Supported Release 1.1.0
Summary
This release primarily adds greater flexibility in the listen directive.
Features
- Added
bind
parameter tohaproxy::frontend
Deprecations
bind_options
inhaproxy::frontend
is being deprecated in favor ofbind
- Remove references to deprecated concat::setup class and update concat dependency
2014-07-21 - Supported Release 1.0.0
Summary
This supported release is the first stable release of haproxy! The updates to this release allow you to customize pretty much everything that HAProxy has to offer (that we could find at least).
Features
- Brand new readme
- Add haproxy::userlist defined resource for managing users
- Add haproxy::frontend::bind_options parameter
- Add haproxy::custom_fragment parameter for arbitrary configuration
- Add compatibility with more recent operating system releases
Bugfixes
- Check for listen/backend with the same names to avoid misordering
- Removed warnings when storeconfigs is not being used
- Passing lint
- Fix chroot ownership for global user/group
- Fix ability to uninstall haproxy
- Fix some linting issues
- Add beaker-rspec tests
- Increase unit test coverage
- Fix balancermember server lines with multiple ports
2014-05-28 - Version 0.5.0
Summary
The primary feature of this release is a reorganization of the module to match best practices. There are several new parameters and some bug fixes.
Features
- Reorganized the module to follow install/config/service pattern
- Added bind_options parameter to haproxy::listen
- Updated tests
Fixes
- Add license file
- Whitespace cleanup
- Use correct port in README
- Fix order of concat fragments
2013-10-08 - Version 0.4.1
Summary
Fix the dependency for concat.
Fixes
- Changed the dependency to be the puppetlabs/concat version.
2013-10-03 - Version 0.4.0
Summary
The largest feature in this release is the new haproxy::frontend and haproxy::backend defines. The other changes are mostly to increase flexibility.
Features
- Added parameters to haproxy:
package_name
: Allows alternate package name.- Add haproxy::frontend and haproxy::backend defines.
- Add an ensure parameter to balancermember so they can be removed.
- Made chroot optional
Fixes
- Remove deprecation warnings from templates.
2013-05-25 - Version 0.3.0
Features
- Add travis testing
- Add
haproxy::balancermember
define_cookies
parameter - Add array support to
haproxy::listen
ipaddress
parameter
Bugfixes
- Documentation
- Listen -> Balancermember dependency
- Config line ordering
- Whitespace
- Add template lines for
haproxy::listen
mode
parameter
2012-10-12 - Version 0.2.0
- Initial public release
- Backwards incompatible changes all around
- No longer needs ordering passed for more than one listener
- Accepts multiple listen ips/ports/server_names
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 4.13.1 < 9.0.0)
- puppetlabs/concat (>= 1.2.3 < 8.0.0)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Quality checks
We run a couple of automated scans to help you assess a module’s quality. Each module is given a score based on how well the author has formatted their code and documentation and select modules are also checked for malware using VirusTotal.
Please note, the information below is for guidance only and neither of these methods should be considered an endorsement by Puppet.
Malware scan results
The malware detection service on Puppet Forge is an automated process that identifies known malware in module releases before they’re published. It is not intended to replace your own virus scanning solution.
Learn more about malware scans- Module name:
- puppetlabs-haproxy
- Module version:
- 6.2.1
- Scan initiated:
- August 26th 2021, 1:58:40
- Detections:
- 0 / 56
- Scan stats:
- 56 undetected
- 0 harmless
- 0 failures
- 0 timeouts
- 0 malicious
- 0 suspicious
- 16 unsupported
- Scan report:
- View the detailed scan report