Created
June 30, 2017 15:15
-
-
Save stackdump/aa23031df3efce38bf73735648bde2b3 to your computer and use it in GitHub Desktop.
haproxy template for ansible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log 127.0.0.1 local2 | |
stats socket /etc/haproxy/haproxy.stat mode 777 level admin | |
chroot /var/lib/haproxy | |
pidfile /var/run/haproxy.pid | |
maxconn 4000 | |
user root | |
group root | |
daemon | |
# turn on stats unix socket | |
stats socket /var/lib/haproxy/stats level admin | |
defaults | |
mode {{ mode }} | |
log global | |
option tcplog | |
option dontlognull | |
option http-server-close | |
option redispatch | |
retries 3 | |
timeout http-request 10s | |
timeout queue 1m | |
timeout connect 10s | |
timeout client 1m | |
timeout server 1m | |
timeout http-keep-alive 10s | |
timeout check 10s | |
maxconn 3000 | |
frontend admin | |
bind *:8080 | |
mode http | |
stats admin if TRUE | |
stats uri /haproxy?stats | |
stats enable | |
stats realm Haproxy\ Statistics | |
stats auth admin:admin | |
stats refresh 5s | |
backend cloudifycluster | |
{% for host in groups.proxy %} | |
listen {{ daemonname }} 0.0.0.0:{{ listenport }} | |
{% endfor %} | |
balance {{ balance }} | |
{% for host in groups.managers %} | |
server {{ host }} {{ hostvars[host]['ansible_default_ipv4'].address }}:{{ httpd_port }} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment