Forge Home

11,943 downloads

10,782 latest version

4.5 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
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.

Version information

  • 0.0.5 (latest)
  • 0.0.4
  • 0.0.3
  • 0.0.2
  • 0.0.1
released Jul 16th 2014
This version is compatible with:

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'arioch-haproxy', '0.0.5'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add arioch-haproxy
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install arioch-haproxy --version 0.0.5

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

arioch/haproxy — version 0.0.5 Jul 16th 2014

Puppet HAProxy

Build status

Build Status

Requirements

Tested on...

  • Debian 6 (Squeeze)
  • Debian 7 (Wheezy)

Example usage

Install HAProxy

node /box/ {
  include haproxy
}

Adjust configuration settings

node /box/ {
  class { 'haproxy':
    defaults_maxconn => '32768',
    global_chroot    => '/usr/share/haproxy',
    global_nbproc    => '2',
    global_ulimit    => '65548',
  }
}

Create split frontend instance

haproxy::instance { 'http-in':
  instance        => 'frontend',
  bind            => '*:80',
  default_backend => 'pool1',
}

Create split frontend instance, with ACL

haproxy::instance { 'http-in':
  instance        => 'frontend',
  bind            => '*:80',
  default_backend => 'pool1',
  acl             => 'acl_pool1',
  acl_header      => 'example.org',
  acl_backend     => 'pool1',
}

Create split backend instance

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

Create combined listen instance

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

Enable HAProxy stats page

class { 'haproxy':
  stats_enable         => true,
  stats_listen_address => '0.0.0.0',
  stats_listen_port    => '8000',
}

Enable HAProxy stats page with authentication

class { 'haproxy':
  stats_enable      => true,
  stats_auth_enable => true,
  stats_auth_user   => 'haproxy',
  stats_auth_pass   => 'haproxy',
}

Unit testing

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