Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/enableit/eit_haproxy/manifests/basic_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
class eit_haproxy::basic_config (
Eit_haproxy::Domains $domains,
Eit_haproxy::Listen $listens = {},
Eit_haproxy::Timeout $frontend_timeout = {},
Boolean $ddos_protection = false,
Boolean $https = true,
Boolean $http = false,
Expand Down Expand Up @@ -204,12 +205,18 @@
{ 'http-request' => 'deny deny_status 429 if !is_priority ww_rl_reached' },
]

$_frontend_timeout = Hash(
$frontend_timeout.map |$k, $v| {
["timeout ${k}", $v]
}
)

haproxy::frontend { 'web':
mode => $mode,
bind => $binds,
options => [
{'option' => "${mode}log"},
$_frontend_timeout,
if $https and $use_lets_encrypt {
{ 'acl is_letsencrypt' => 'path_beg /.well-known/acme-challenge/' }
},
Expand Down
2 changes: 2 additions & 0 deletions modules/enableit/eit_haproxy/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Enum['auto', 'manual'] $configure,
Eit_haproxy::Domains $domains,
Eit_haproxy::Listen $listens,
Eit_haproxy::Timeout $frontend_timeout,
Hash[Eit_types::IP,Variant[
Array[Stdlib::Port],
Stdlib::Port
Expand Down Expand Up @@ -64,6 +65,7 @@
listens => $listens,
mode => $mode,
listen_on => $listen_on,
frontend_timeout => $frontend_timeout,
encryption_ciphers => $encryption_ciphers,
}
}
Expand Down
14 changes: 14 additions & 0 deletions modules/enableit/eit_haproxy/types/timeout.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Haproxy Timeouts

type Eit_haproxy::Timeout = Struct[{
client => Optional[String],
connect => Optional[String],
server => Optional[String],
queue => Optional[String],
tunnel => Optional[String],
check => Optional[String],
http-request => Optional[String],
http-keep-alive => Optional[String],
http-connection => Optional[String],
tarpit => Optional[String],
}]
2 changes: 2 additions & 0 deletions modules/enableit/profile/manifests/haproxy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Optional[String] $manual_config,
Eit_haproxy::Domains $domains = {},
Eit_haproxy::Listen $listens = {},
Eit_haproxy::Timeout $frontend_timeout = {},
Boolean $ddos_protection = false,
Boolean $https = true,
Boolean $http = false,
Expand Down Expand Up @@ -49,6 +50,7 @@
use_hsts => $use_hsts,
mode => $mode,
listen_on => $listen_on,
frontend_timeout => $frontend_timeout,
manual_config => $manual_config,
configure => $configure,
firewall => $firewall,
Expand Down
2 changes: 2 additions & 0 deletions modules/enableit/role/manifests/web/haproxy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
Optional[String] $manual_config = undef,
Eit_haproxy::Domains $domains = {},
Eit_haproxy::Listen $listens = {},
Eit_haproxy::Timeout $frontend_timeout = {},
Boolean $ddos_protection = false,
Boolean $https = true,
Boolean $http = false,
Expand Down Expand Up @@ -91,6 +92,7 @@
version => $version,
configure => $configure,
listen_on => $listen_on,
frontend_timeout => $frontend_timeout,
encryption_ciphers => $encryption_ciphers,
firewall => $firewall,
service_options => $service_options,
Expand Down