Skip to content

Commit dac48e6

Browse files
committed
update README for remix
1 parent 5b3afb3 commit dac48e6

File tree

1 file changed

+49
-41
lines changed

1 file changed

+49
-41
lines changed

README.md

Lines changed: 49 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
11
PuppetLabs Module for haproxy (phrawzty remix)
22
==============================================
33

4-
*IMPORTANT* This documentation needs to be updated due to phrawzty's edits.
5-
64
HAProxy is an HA proxying daemon for load-balancing to clustered services. It
75
can proxy TCP directly, or other kinds of traffic such as HTTP.
86

9-
Basic Usage
10-
-----------
7+
This module is based on Puppetlabs' official HAProxy module; however, it has
8+
been "remixed" for use at Mozilla. There are two major areas where the original
9+
module has been changed :
1110

12-
This haproxy uses storeconfigs to collect and realize balancer member servers
13-
on a load balancer server. Currently Redhat family OSes are supported.
11+
* Storeconfigs, while present, are no longer required.
12+
* The "listen" stanza format has been abandoned in favour of a frontend /
13+
backend style configuration.
1414

15-
*To install and configure HAProxy server listening on port 80*
15+
Basic Usage
16+
-----------
17+
18+
A very simple configuration to proxy unrelated Redis nodes :
1619

1720
```puppet
18-
node 'haproxy-server' {
1921
class { 'haproxy': }
20-
haproxy::listen { 'puppet00':
21-
ipaddress => $::ipaddress,
22-
ports => '8140',
23-
}
24-
}
25-
```
2622
27-
*To add backend loadbalance members*
23+
haproxy::frontend { 'in_redis':
24+
ipaddress => $::ipaddress,
25+
ports => '6379',
26+
default_backend => 'out_redis',
27+
options => { 'balance' => 'roundrobin' }
28+
}
2829
29-
```puppet
30-
node 'webserver01' {
31-
@@haproxy::balancermember { $fqdn:
32-
listening_service => 'puppet00',
33-
server_names => $::hostname,
34-
ipaddresses => $::ipaddress,
35-
ports => '8140',
30+
haproxy::backend { 'out_redis':
31+
listening_service => 'redis',
32+
server_names => ['node01', 'node02'],
33+
ipaddresses => ['node01.redis.server.foo', 'node02.redis.server.foo'],
34+
ports => '6379',
3635
options => 'check'
3736
}
38-
}
3937
```
4038

4139
Configuring haproxy options
@@ -47,23 +45,34 @@ behaviour of the haproxy server daemon:
4745
- `global_options` to configure the `global` section in `haproxy.cfg`
4846
- `defaults_options` to configure the `defaults` section in `haproxy.cfg`
4947

50-
Configuring haproxy daemon listener
51-
-----------------------------------
48+
Configuring haproxy daemon listener (frontend)
49+
----------------------------------------------
50+
51+
One `haproxy::frontend` defined resource should be defined for each HAProxy
52+
loadbalanced set of backend servers. The title of the `haproxy::frontend`
53+
resource is the key to which balancer members will be proxied to. The
54+
`ipaddress` field should be the public ip address which the loadbalancer will
55+
be contacted on. The `ports` attribute can accept an array or comma-separated
56+
list of ports which should be proxied to the `haproxy::backend` nodes.
5257

53-
One `haproxy::listen` defined resource should be defined for each HAProxy loadbalanced set of backend servers. The title of the `haproxy::listen` resource is the key to which balancer members will be proxied to. The `ipaddress` field should be the public ip address which the loadbalancer will be contacted on. The `ports` attribute can accept an array or comma-separated list of ports which should be proxied to the `haproxy::balancermemeber` nodes.
58+
Configuring haproxy loadbalanced member nodes (backend)
59+
-------------------------------------------------------
5460

55-
Configuring haproxy loadbalanced member nodes
56-
---------------------------------------------
61+
The `haproxy::backend` resource should be defined for every backend service
62+
that is serving loadbalanced traffic. The `listening_service` attribute will
63+
associate it with `haproxy::frontend` directives on the haproxy node.
64+
`ipaddresses` and `ports` will be assigned to the member to be contacted on. If
65+
an array of `ipaddresses` and `server_names` are provided then they will be
66+
added to the config in lock-step.
5767

58-
The `haproxy::balacemember` defined resource should be exported from each node
59-
which is serving loadbalanced traffic. the `listening_service` attribute will
60-
associate it with `haproxy::listen` directives on the haproxy node.
61-
`ipaddresses` and `ports` will be assigned to the member to be contacted on. If an array of `ipaddresses` and `server_names` are provided then they will be added to the config in lock-step.
68+
If you're not using storeconfigs, then `listening_service` is useless - just
69+
put whatever you want in there. :P
6270

6371
Dependencies
6472
------------
6573

66-
Tested and built on Ubuntu and CentOS
74+
* Tested and built on Ubuntu and CentOS.
75+
* Requires ripienaar's excellent puppet-concat(https://github.com/ripienaar/puppet-concat) module.
6776

6877
Copyright and License
6978
---------------------
@@ -72,14 +81,13 @@ Copyright (C) 2012 [Puppet Labs](https://www.puppetlabs.com/) Inc
7281

7382
Puppet Labs can be contacted at: [email protected]
7483

75-
Licensed under the Apache License, Version 2.0 (the "License");
76-
you may not use this file except in compliance with the License.
77-
You may obtain a copy of the License at
84+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
85+
this file except in compliance with the License. You may obtain a copy of the
86+
License at
7887

7988
http://www.apache.org/licenses/LICENSE-2.0
8089

81-
Unless required by applicable law or agreed to in writing, software
82-
distributed under the License is distributed on an "AS IS" BASIS,
83-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
84-
See the License for the specific language governing permissions and
85-
limitations under the License.
90+
Unless required by applicable law or agreed to in writing, software distributed
91+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
92+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
93+
specific language governing permissions and limitations under the License.

0 commit comments

Comments
 (0)