Skip to content

Instantly share code, notes, and snippets.

@reidmv
Last active April 4, 2018 22:09
Show Gist options
  • Save reidmv/80b8033e3c3c22a8c49bf7d3f3822370 to your computer and use it in GitHub Desktop.
Save reidmv/80b8033e3c3c22a8c49bf7d3f3822370 to your computer and use it in GitHub Desktop.
HAProxy configuration for forwarding to Puppet webhook
class { 'haproxy':
global_options => {
'log' => "${::ipaddress} local2",
'chroot' => '/var/lib/haproxy',
'pidfile' => '/var/run/haproxy.pid',
'maxconn' => 5000,
'user' => 'haproxy',
'group' => 'haproxy',
'daemon' => '',
'stats' => 'socket /var/lib/haproxy/stats',
},
defaults_options => {
'timeout' => [
'connect 10s',
'queue 1m',
'client 2m',
'server 2m',
'http-request 120s',
]
}
}
haproxy::listen { 'code-manager-webhook':
mode => 'http',
collect_exported => false,
bind => {
"${::ipaddress}:9170" => ['ssl', 'crt', '/tmp/letsencrypt.key.crt.pem'], # concatenated private key and cert
},
}
haproxy::balancermember { 'localhost':
listening_service => 'code-manager-webhook',
server_names => 'localhost',
ipaddresses => '127.0.0.1',
ports => '8170',
options => 'ssl verify none',
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment