Skip to content

Commit

Permalink
Merge pull request #5 from Oefenweb/add-timeout-support
Browse files Browse the repository at this point in the history
Add timeout support
  • Loading branch information
tersmitten committed Oct 2, 2015
2 parents 04da4f7 + b3657ed commit dd001d0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ Set up the latest version of [HAProxy](http://www.haproxy.org/) in Ubuntu system
* `haproxy_listen.{n}.option`: [optional]: Options to set (e.g. `[dontlog-normal]`)
* `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}.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`)
* `haproxy_listen.{n}.stats`: [optional]: Stats declarations
* `haproxy_listen.{n}.stats.enable`: [required]: Enables statistics reporting with default settings
* `haproxy_listen.{n}.stats.uri`: [optional, default `/`]: Define the URI prefix to access statistics
Expand All @@ -83,6 +86,9 @@ Set up the latest version of [HAProxy](http://www.haproxy.org/) in Ubuntu system
* `haproxy_frontend.{n}.maxconn`: [optional]: Fix the maximum number of concurrent connections
* `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
* `haproxy_frontend.{n}.timeout.type`: [required]: The type (e.g. `client`)
* `haproxy_frontend.{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`)
* `haproxy_frontend.{n}.default_backend`: [required]: The backend to use when no `"use_backend"` rule has been matched (e.g. `webservers`)
* `haproxy_frontend.{n}.rspadd`: [optional]: Adds headers at the end of the HTTP response
* `haproxy_frontend.{n}.rspadd.{n}.string`: [required]: The complete line to be added. Any space or known delimiter must be escaped using a backslash (`'\'`)
Expand All @@ -96,6 +102,9 @@ Set up the latest version of [HAProxy](http://www.haproxy.org/) in Ubuntu system
* `haproxy_backend.{n}.option`: [optional]: Options to set (e.g. `[forwardfor]`)
* `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
* `haproxy_backend.{n}.timeout.type`: [required]: The type (e.g. `server`)
* `haproxy_backend.{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`)
* `haproxy_backend.{n}.http_request`: [optional]: Access control for Layer 7 requests
* `haproxy_backend.{n}.http_request.{n}.action`: [required]: The rules action (e.g. `add-header`)
* `haproxy_backend.{n}.http_request.{n}.param`: [optional]: The complete line to be added (e.g. `X-Forwarded-Proto https`)
Expand Down
6 changes: 6 additions & 0 deletions templates/etc/haproxy/backend.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ backend {{ backend.name }}
{% endfor %}
{% endif %}

{% if backend.timeout is defined %}
{% for timeout in backend.timeout %}
timeout {{ timeout.type }} {{ timeout.timeout }}
{% endfor %}
{% endif %}

{% if backend.http_request is defined %}
{% for http_request in backend.http_request %}
http-request {{ http_request.action }}{% if http_request.param is defined %} {{ http_request.param }}{% endif %}{% if http_request.cond is defined %} {{ http_request.cond }}{% endif %}
Expand Down
6 changes: 6 additions & 0 deletions templates/etc/haproxy/frontend.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ frontend {{ frontend.name }}
{% for option in frontend.no_option %}
no option {{ option }}
{% endfor %}
{% endif %}

{% if frontend.timeout is defined %}
{% for timeout in frontend.timeout %}
timeout {{ timeout.type }} {{ timeout.timeout }}
{% endfor %}
{% endif %}

default_backend {{ frontend.default_backend }}
Expand Down
6 changes: 6 additions & 0 deletions templates/etc/haproxy/listen.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ listen {{ listen.name }}
{% endfor %}
{% endif %}

{% if listen.timeout is defined %}
{% for timeout in listen.timeout %}
timeout {{ timeout.type }} {{ timeout.timeout }}
{% endfor %}
{% endif %}

{% if listen.stats is defined %}
{% if listen.stats.enable is defined and listen.stats.enable | bool == true %}
stats enable
Expand Down

0 comments on commit dd001d0

Please sign in to comment.