Move haproxy.cfg to haproxy resource templates
This commit is contained in:
parent
c8f796d16d
commit
8b92e6d3ed
@ -18,4 +18,4 @@
|
||||
tasks:
|
||||
- file: path={{ config_dir.value['src'] }}/ state=directory
|
||||
- file: path={{ config_dir.value['src'] }}/haproxy.cfg state=touch
|
||||
- template: src=/vagrant/haproxy.cfg dest={{ config_dir.value['src'] }}/haproxy.cfg
|
||||
- template: src={{ resource_dir }}/templates/haproxy.cfg dest={{ config_dir.value['src'] }}/haproxy.cfg
|
||||
|
46
resources/haproxy/templates/haproxy.cfg
Normal file
46
resources/haproxy/templates/haproxy.cfg
Normal file
@ -0,0 +1,46 @@
|
||||
global
|
||||
log 127.0.0.1 local0
|
||||
log 127.0.0.1 local1 notice
|
||||
maxconn 4096
|
||||
tune.ssl.default-dh-param 2048
|
||||
pidfile /var/run/haproxy.pid
|
||||
user haproxy
|
||||
group haproxy
|
||||
daemon
|
||||
stats socket /var/run/haproxy.stats level admin
|
||||
ssl-default-bind-options no-sslv3
|
||||
|
||||
defaults
|
||||
log global
|
||||
mode http
|
||||
option redispatch
|
||||
option httplog
|
||||
option dontlognull
|
||||
option forwardfor
|
||||
timeout connect 5000
|
||||
timeout client 50000
|
||||
timeout server 50000
|
||||
|
||||
#frontend default_frontend
|
||||
# bind 0.0.0.0:80
|
||||
# default_backend default_service
|
||||
|
||||
#backend default_service
|
||||
# balance roundrobin
|
||||
|
||||
{% for service in haproxy_services %}
|
||||
listen {{ service['name'] }} 0.0.0.0:{{ service['listen_port'] }}
|
||||
mode http
|
||||
stats enable
|
||||
stats uri /haproxy?stats
|
||||
stats realm Strictly\ Private
|
||||
stats auth A_Username:YourPassword
|
||||
stats auth Another_User:passwd
|
||||
balance roundrobin
|
||||
option httpclose
|
||||
option forwardfor
|
||||
{% for server in service['servers'] %}
|
||||
server {{ server['name'] }} {{ server['ip'] }}:{{ server['port'] }} check
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
Loading…
x
Reference in New Issue
Block a user