- Debian 6 (Squeeze)
- Debian 7 (Wheezy)
node /box/ {
include haproxy
}
node /box/ {
class { 'haproxy':
defaults_maxconn => '32768',
global_chroot => '/usr/share/haproxy',
global_nbproc => '2',
global_ulimit => '65548',
}
}
haproxy::instance { 'http-in':
instance => 'frontend',
bind => '*:80',
default_backend => 'pool1',
}
haproxy::instance { 'http-in':
instance => 'frontend',
bind => '*:80',
default_backend => 'pool1',
acl => 'acl_pool1',
acl_header => 'example.org',
acl_backend => 'pool1',
}
haproxy::instance { 'pool1':
instance => 'backend',
balance => 'roundrobin',
option => [ 'http-server-close', 'checkcache' ],
server => [
'inst1 10.0.1.10:80'
'inst2 10.0.1.20:80'
],
}
haproxy::instance { 'pool2':
instance => 'listen',
bind => '0.0.0.0:80',
mode => 'http',
option => 'persist',
balance => 'roundrobin',
server => [
'inst1 10.0.2.10:80',
'inst2 10.0.2.20:80',
],
}
class { 'haproxy':
stats_enable => true,
stats_listen_address => '0.0.0.0',
stats_listen_port => '8000',
}
class { 'haproxy':
stats_enable => true,
stats_auth_enable => true,
stats_auth_user => 'haproxy',
stats_auth_pass => 'haproxy',
}
class { 'haproxy':
service_hasrestart => false,
service_restart => '/usr/sbin/service haproxy reload'
}
haproxy::instance { 'pool2':
instance => 'listen',
capture => [
'request header Host len 40',
'request header X-Forwarded-For len 50',
'request header Accept-Language len 50',
'request header Referer len 200',
'request header User-Agent len 200',
'response header Content-Type len 30',
'response header Content-Encoding len 10',
'response header Cache-Control len 200',
'response header Last-Modified len 200',
],
class { 'haproxy':
manage_repo => true,
}
Plain RSpec:
$ rake spec
Using bundle:
$ bundle exec rake spec
Test against a specific Puppet or Facter version:
$ PUPPET_VERSION=3.2.1 bundle update && bundle exec rake spec
$ PUPPET_VERSION=2.7.19 bundle update && bundle exec rake spec
$ FACTER_VERSION=1.6.8 bundle update && bundle exec rake spec
