Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed May 29, 2017
1 parent 61991b8 commit 5768675
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 22 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
* `haproxy_listen.{n}.no_option`: [optional]: Options to set (e.g. `[dontlog-normal]`)
* `haproxy_listen.{n}.tcp_check`: [optional]: Perform health checks using tcp-check send/expect sequences (e.g. `['expect string +OK\ POP3\ ready']`)
* `haproxy_listen.{n}.http_check`: [optional]: Make HTTP health checks consider response contents or specific status codes (e.g. `expect status 403`)
* `haproxy_listen.{n}.stick.table`: [optional]: Configure the stickiness table for the current section (e.g. `type ip size 500k`)
* `haproxy_listen.{n}.stick.stick_on`: [optional]: Define a request pattern to associate a user to a server (e.g. `src`)
* `haproxy_listen.{n}.stick`: [optional]: Stick declarations
* `haproxy_listen.{n}.stick.{n}.table`: [required]: Configure the stickiness table for the current section (e.g. `type ip size 500k`)
* `haproxy_listen.{n}.stick.{n}.stick_on`: [required]: Define a request pattern to associate a user to a server (e.g. `src`)
* `haproxy_listen.{n}.timeout`: [optional]: Timeout declarations
* `haproxy_listen.{n}.timeout.type`: [required]: The type (e.g. `connect`, `client`, `server`)
* `haproxy_listen.{n}.timeout.timeout`: [required]: The timeout (in in milliseconds by default, but can be in any other unit if the number is suffixed by the unit) (e.g. `5000`, `50000`)
Expand Down Expand Up @@ -126,8 +127,9 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
* `haproxy_frontend.{n}.bind_process`: [optional]: Limits the declaration to a certain set of processes numbers (e.g. `[all]`, `[1]`, `[2 ,3, 4]`)
* `haproxy_frontend.{n}.mode`: [required]: Set the running mode or protocol of the section (e.g. `http`)
* `haproxy_frontend.{n}.maxconn`: [optional]: Fix the maximum number of concurrent connections
* `haproxy_frontend.{n}.stick.table`: [optional]: Configure the stickiness table for the current section (e.g. `type ip size 500k`)
* `haproxy_frontend.{n}.stick.stick_on`: [optional]: Define a request pattern to associate a user to a server (e.g. `src`)
* `haproxy_frontend.{n}.stick`: [optional]: Stick declarations
* `haproxy_frontend.{n}.stick.{n}.table`: [required]: Configure the stickiness table for the current section (e.g. `type ip size 500k`)
* `haproxy_frontend.{n}.stick.{n}.stick_on`: [required]: Define a request pattern to associate a user to a server (e.g. `src`)
* `haproxy_frontend.{n}.option`: [optional]: Options to set (e.g. `[tcplog]`)
* `haproxy_frontend.{n}.no_option`: [optional]: Options to unset (e.g. `[forceclose]`)
* `haproxy_frontend.{n}.timeout`: [optional]: Timeout declarations
Expand Down Expand Up @@ -168,8 +170,9 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
* `haproxy_backend.{n}.source`: [optional]: Set the source address or interface for connections from the proxy
* `haproxy_backend.{n}.option`: [optional]: Options to set (e.g. `[forwardfor]`)
* `haproxy_backend.{n}.http_check`: [optional]: Make HTTP health checks consider response contents or specific status codes (e.g. `expect status 403`)
* `haproxy_backend.{n}.stick.table`: [optional]: Configure the stickiness table for the current section (e.g. `type ip size 500k`)
* `haproxy_backend.{n}.stick.stick_on`: [optional]: Define a request pattern to associate a user to a server (e.g. `src`)
* `haproxy_backend.{n}.stick`: [optional]: Stick declarations
* `haproxy_backend.{n}.stick.{n}.table`: [required]: Configure the stickiness table for the current section (e.g. `type ip size 500k`)
* `haproxy_backend.{n}.stick.{n}.stick_on`: [required]: Define a request pattern to associate a user to a server (e.g. `src`)
* `haproxy_backend.{n}.no_option`: [optional]: Options to unset (e.g. `[forceclose]`)
* `haproxy_backend.{n}.tcp_check`: [optional]: Perform health checks using tcp-check send/expect sequences (e.g. `['expect string +OK\ POP3\ ready']`)
* `haproxy_backend.{n}.timeout`: [optional]: Timeout declarations
Expand Down
8 changes: 3 additions & 5 deletions templates/etc/haproxy/backend.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ backend {{ backend.name }}
cookie {{ backend.cookie }}
{% endif %}

{% if backend.stick is defined %}
{% for st in backend.stick | default([])%}
stick-table {{ st.table }}
stick on {{ st.stick_on }}
{% for stick in backend.stick | default([]) %}
stick-table {{ stick.table }}
stick on {{ stick.stick_on }}
{% endfor %}
{% endif %}

{% for option in backend.no_option | default([]) %}
no option {{ option }}
Expand Down
8 changes: 3 additions & 5 deletions templates/etc/haproxy/frontend.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ frontend {{ frontend.name }}
maxconn {{ frontend.maxconn }}
{% endif %}

{% if frontend.stick is defined %}
{% for st in frontend.stick %}
stick-table {{ st.table }}
stick on {{ st.stick_on }}
{% for stick in frontend.stick | default([]) %}
stick-table {{ stick.table }}
stick on {{ stick.stick_on }}
{% endfor %}
{% endif %}

{% for option in frontend.option | default([]) %}
option {{ option }}
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/haproxy/global.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% endfor %}
{% endif %}

{% if haproxy_global_chroot.lower() != 'false' %}
{% if haproxy_global_chroot != false %}
chroot {{ haproxy_global_chroot }}
{% endif %}

Expand Down
8 changes: 3 additions & 5 deletions templates/etc/haproxy/listen.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ listen {{ listen.name }}
http-check {{ listen.http_check }}
{% endif %}

{% if listen.stick is defined %}
{% for st in listen.stick %}
stick-table {{ st.table }}
stick on {{ st.stick_on }}
{% for stick in listen.stick | default([]) %}
stick-table {{ stick.table }}
stick on {{ stick.stick_on }}
{% endfor %}
{% endif %}

{% if listen.source is defined %}
source {{ listen.source }}
Expand Down

0 comments on commit 5768675

Please sign in to comment.