diff --git a/charmhelpers/contrib/openstack/context.py b/charmhelpers/contrib/openstack/context.py index 4821633..61073cd 100644 --- a/charmhelpers/contrib/openstack/context.py +++ b/charmhelpers/contrib/openstack/context.py @@ -626,6 +626,12 @@ class HAProxyContext(OSContextGenerator): if config('haproxy-client-timeout'): ctxt['haproxy_client_timeout'] = config('haproxy-client-timeout') + if config('haproxy-queue-timeout'): + ctxt['haproxy_queue_timeout'] = config('haproxy-queue-timeout') + + if config('haproxy-connect-timeout'): + ctxt['haproxy_connect_timeout'] = config('haproxy-connect-timeout') + if config('prefer-ipv6'): ctxt['ipv6'] = True ctxt['local_host'] = 'ip6-localhost' diff --git a/charmhelpers/contrib/openstack/templates/haproxy.cfg b/charmhelpers/contrib/openstack/templates/haproxy.cfg index 4a3e2d7..8721d8a 100644 --- a/charmhelpers/contrib/openstack/templates/haproxy.cfg +++ b/charmhelpers/contrib/openstack/templates/haproxy.cfg @@ -12,27 +12,26 @@ defaults option tcplog option dontlognull retries 3 -{% if haproxy_queue_timeout -%} +{%- if haproxy_queue_timeout %} timeout queue {{ haproxy_queue_timeout }} -{% else -%} +{%- else %} timeout queue 5000 -{% endif -%} -{% if haproxy_connect_timeout -%} +{%- endif %} +{%- if haproxy_connect_timeout %} timeout connect {{ haproxy_connect_timeout }} -{% else -%} +{%- else %} timeout connect 5000 -{% endif -%} -{% if haproxy_client_timeout -%} +{%- endif %} +{%- if haproxy_client_timeout %} timeout client {{ haproxy_client_timeout }} -{% else -%} +{%- else %} timeout client 30000 -{% endif -%} - -{% if haproxy_server_timeout -%} +{%- endif %} +{%- if haproxy_server_timeout %} timeout server {{ haproxy_server_timeout }} -{% else -%} +{%- else %} timeout server 30000 -{% endif -%} +{%- endif %} listen stats {{ stat_port }} mode http