Skip to content
Snippets Groups Projects
Commit 2eb81c30 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-inventories/arocom#185 Make HaProxy maxconn values configurable, per inventory or per host

parent 9aae7acc
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,8 @@ proxy_timeout_connect: '5s' ...@@ -5,6 +5,8 @@ proxy_timeout_connect: '5s'
proxy_timeout_client: '20s' proxy_timeout_client: '20s'
proxy_timeout_server: '45s' proxy_timeout_server: '45s'
proxy_redirect_aliase: false proxy_redirect_aliase: false
proxy_maxconn: 100
proxy_varnish_maxconn: 1000
proxy_blacklist: proxy_blacklist:
ip: ip:
- '146.185.176.158' - '146.185.176.158'
......
...@@ -216,7 +216,7 @@ backend backend_{{host}} ...@@ -216,7 +216,7 @@ backend backend_{{host}}
{% if host == inventory_hostname or host == 'localhost' %} {% if host == inventory_hostname or host == 'localhost' %}
http-response deny http-response deny
{% else %} {% else %}
server server_{{host}} {{hostvars[host]['static_ipv4']}}:80 maxconn 100 server server_{{host}} {{hostvars[host]['static_ipv4']}}:80 maxconn {{hostvars[host]['proxy_maxconn']|default(proxy_maxconn)}}
{% endif %} {% endif %}
backend backend_{{host}}_bigpipe backend backend_{{host}}_bigpipe
...@@ -224,7 +224,7 @@ backend backend_{{host}}_bigpipe ...@@ -224,7 +224,7 @@ backend backend_{{host}}_bigpipe
http-response deny http-response deny
{% else %} {% else %}
no option http-buffer-request no option http-buffer-request
server server_{{host}} {{hostvars[host]['static_ipv4']}}:80 maxconn 100 server server_{{host}} {{hostvars[host]['static_ipv4']}}:80 maxconn {{hostvars[host]['proxy_maxconn']|default(proxy_maxconn)}}
{% endif %} {% endif %}
backend backend_{{host}}_https backend backend_{{host}}_https
...@@ -232,7 +232,7 @@ backend backend_{{host}}_https ...@@ -232,7 +232,7 @@ backend backend_{{host}}_https
http-response deny http-response deny
{% else %} {% else %}
http-response set-header Strict-Transport-Security "max-age=16000000; includeSubDomains; preload;" http-response set-header Strict-Transport-Security "max-age=16000000; includeSubDomains; preload;"
server server_{{host}} {{hostvars[host]['static_ipv4']}}:80 maxconn 100 server server_{{host}} {{hostvars[host]['static_ipv4']}}:80 maxconn {{hostvars[host]['proxy_maxconn']|default(proxy_maxconn)}}
{% endif %} {% endif %}
backend backend_{{host}}_https_bigpipe backend backend_{{host}}_https_bigpipe
...@@ -241,7 +241,7 @@ backend backend_{{host}}_https_bigpipe ...@@ -241,7 +241,7 @@ backend backend_{{host}}_https_bigpipe
{% else %} {% else %}
no option http-buffer-request no option http-buffer-request
http-response set-header Strict-Transport-Security "max-age=16000000; includeSubDomains; preload;" http-response set-header Strict-Transport-Security "max-age=16000000; includeSubDomains; preload;"
server server_{{host}} {{hostvars[host]['static_ipv4']}}:80 maxconn 100 server server_{{host}} {{hostvars[host]['static_ipv4']}}:80 maxconn {{hostvars[host]['proxy_maxconn']|default(proxy_maxconn)}}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if varnish_host|default(false) %} {% if varnish_host|default(false) %}
...@@ -253,9 +253,9 @@ backend backend_varnish ...@@ -253,9 +253,9 @@ backend backend_varnish
option forwardfor option forwardfor
hash-type consistent hash-type consistent
{% if varnish_host == inventory_hostname %} {% if varnish_host == inventory_hostname %}
server varnish 127.0.0.1:6081 maxconn 1000 server varnish 127.0.0.1:6081 maxconn {{proxy_varnish_maxconn}}
{% else %} {% else %}
server varnish {{ varnish_host_ip|default('') }}:6081 maxconn 1000 server varnish {{ varnish_host_ip|default('') }}:6081 maxconn {{proxy_varnish_maxconn}}
{% endif %} {% endif %}
backend backend_varnish_bigpipe backend backend_varnish_bigpipe
...@@ -265,9 +265,9 @@ backend backend_varnish_bigpipe ...@@ -265,9 +265,9 @@ backend backend_varnish_bigpipe
option forwardfor option forwardfor
hash-type consistent hash-type consistent
{% if varnish_host == inventory_hostname %} {% if varnish_host == inventory_hostname %}
server varnish 127.0.0.1:6081 maxconn 1000 server varnish 127.0.0.1:6081 maxconn {{proxy_varnish_maxconn}}
{% else %} {% else %}
server varnish {{ varnish_host_ip|default('') }}:6081 maxconn 1000 server varnish {{ varnish_host_ip|default('') }}:6081 maxconn {{proxy_varnish_maxconn}}
{% endif %} {% endif %}
{% endif %} {% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment