From 33b308f27316c5f99a6bcea2175a8324da81ccc7 Mon Sep 17 00:00:00 2001 From: "R. Daneel Olivaw" Date: Wed, 8 Apr 2015 19:51:26 -0400 Subject: [PATCH] added timeout settings for listen, frontend and backend Up to now, only the default section could be used to set timeouts. This adds supprot for timeouts in listen, frontend and backend sections. Note that all timeout parameters do not apply to all sections but will not be checked for sanity by this playbook. --- templates/backend.cfg | 5 +++++ templates/frontend.cfg | 6 ++++++ templates/listen.cfg | 6 +++++- vars/main.yml | 11 +++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/templates/backend.cfg b/templates/backend.cfg index fca2958..a430595 100644 --- a/templates/backend.cfg +++ b/templates/backend.cfg @@ -48,3 +48,8 @@ backend {{ item.name }} option {{ option }} {% endfor %} {% endif -%} +{% if item.timeout is defined -%} +{% for entry in item.timeout %} + timeout {{ entry.param }} {{ entry.value }} +{% endfor %} +{% endif -%} diff --git a/templates/frontend.cfg b/templates/frontend.cfg index 1fdc8c1..c076faa 100644 --- a/templates/frontend.cfg +++ b/templates/frontend.cfg @@ -16,6 +16,12 @@ frontend {{ item.name }} {%if item.ip is defined %}{{ item.ip }}{% endif %}{%if maxconn {{ item.maxconn }} {% endif -%} + {% if item.timeout is defined -%} + {% for entry in item.timeout %} + timeout {{ entry.param }} {{ entry.value }} + {% endfor %} + {% endif -%} + {%- if item.monitor is defined -%} {% if item.monitor.uri is defined -%} monitor-uri {{ item.monitor.uri }} diff --git a/templates/listen.cfg b/templates/listen.cfg index 67e3d3f..1fb08e8 100644 --- a/templates/listen.cfg +++ b/templates/listen.cfg @@ -43,4 +43,8 @@ listen {{ item.name }} option {{ option }} {% endfor %} {% endif -%} - +{% if item.timeout is defined -%} +{% for entry in item.timeout %} + timeout {{ entry.param }} {{ entry.value }} +{% endfor %} +{% endif -%} diff --git a/vars/main.yml b/vars/main.yml index 21c09fa..2ef836c 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -77,6 +77,9 @@ empty: true # use_backend: # - name: # condition: +# timeout: +# - param: +# value: # #haproxy_backends: # - name: @@ -86,6 +89,8 @@ empty: true # log: # retries: # contimeout: +# NOTE: contimeout is deprecated +# http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4-contimeout # http-send-name-header: # http-check-expect: # - condition @@ -101,6 +106,9 @@ empty: true # - param1 # options: # - forwardfor +# timeout: +# - param: +# value: # #haproxy_listen: # - name: @@ -128,3 +136,6 @@ empty: true # - param1 # options: # - forwardfor +# timeout: +# - param: +# value: