Role haproxy_server for OpenStack-Ansible
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

haproxy.cfg.j2 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # {{ ansible_managed }}
  2. global
  3. log 127.0.0.1 local0
  4. log 127.0.0.1 local1 notice
  5. chroot /var/lib/haproxy
  6. user haproxy
  7. group haproxy
  8. daemon
  9. maxconn {{ haproxy_maxconn }}
  10. {% if haproxy_tuning_params is defined %}
  11. nbproc {{ haproxy_tuning_params.nbproc | default('1') }}
  12. tune.bufsize {{ haproxy_tuning_params.bufsize | default('384000') }}
  13. tune.chksize {{ haproxy_tuning_params.chksize | default('16384') }}
  14. tune.comp.maxlevel {{ haproxy_tuning_params.comp_maxlevel | default('1') }}
  15. tune.http.maxhdr {{ haproxy_tuning_params.http_maxhdr | default('101') }}
  16. tune.maxaccept {{ haproxy_tuning_params.maxaccept | default('64') }}
  17. tune.ssl.cachesize {{ haproxy_tuning_params.ssl_cachesize | default('20000') }}
  18. tune.ssl.lifetime {{ haproxy_tuning_params.ssl_lifetime | default('300') }}
  19. {% endif %}
  20. stats socket /var/run/haproxy.stat level admin mode 600
  21. {% if haproxy_ssl | bool %}
  22. ssl-default-bind-options {{ haproxy_ssl_bind_options }}
  23. tune.ssl.default-dh-param {{haproxy_ssl_dh_param}}
  24. {% endif %}
  25. defaults
  26. log global
  27. option dontlognull
  28. option redispatch
  29. option {{ haproxy_keepalive_mode }}
  30. retries {{ haproxy_retries }}
  31. timeout client {{ haproxy_client_timeout }}
  32. timeout connect {{ haproxy_connect_timeout }}
  33. timeout http-request {{ haproxy_http_request_timeout }}
  34. timeout server {{ haproxy_server_timeout }}
  35. maxconn {{ haproxy_maxconn }}
  36. {% if haproxy_stats_enabled | bool %}
  37. listen stats
  38. bind {{ haproxy_stats_bind_address }}:{{ haproxy_stats_port }} {% if haproxy_ssl | bool %}ssl crt {{ haproxy_ssl_pem }} ciphers {{ haproxy_ssl_cipher_suite }}{% endif %}
  39. mode http
  40. stats enable
  41. stats hide-version
  42. stats realm Haproxy\ Statistics
  43. stats uri /
  44. stats show-node
  45. stats show-legends
  46. stats auth {{ haproxy_username }}:{{ haproxy_stats_password }}
  47. stats admin if TRUE
  48. stats refresh {{ haproxy_stats_refresh_interval }}s
  49. {% endif %}