~bjornt/charms/xenial/glance-simplestreams-sync/no-python2

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/openstack/templates/haproxy.cfg

[bradm, r=gnuoy] Add basic nagios checks

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
global
2
 
    log 127.0.0.1 local0
3
 
    log 127.0.0.1 local1 notice
 
2
    log {{ local_host }} local0
 
3
    log {{ local_host }} local1 notice
4
4
    maxconn 20000
5
5
    user haproxy
6
6
    group haproxy
14
14
    retries 3
15
15
    timeout queue 1000
16
16
    timeout connect 1000
 
17
{% if haproxy_client_timeout -%}
 
18
    timeout client {{ haproxy_client_timeout }}
 
19
{% else -%}
17
20
    timeout client 30000
 
21
{% endif -%}
 
22
 
 
23
{% if haproxy_server_timeout -%}
 
24
    timeout server {{ haproxy_server_timeout }}
 
25
{% else -%}
18
26
    timeout server 30000
 
27
{% endif -%}
19
28
 
20
 
listen stats :8888
 
29
listen stats {{ stat_port }}
21
30
    mode http
22
31
    stats enable
23
32
    stats hide-version
25
34
    stats uri /
26
35
    stats auth admin:password
27
36
 
28
 
{% if units -%}
29
 
{% for service, ports in service_ports.iteritems() -%}
30
 
listen {{ service }} 0.0.0.0:{{ ports[0] }}
31
 
    balance roundrobin
32
 
    {% for unit, address in units.iteritems() -%}
 
37
{% if frontends -%}
 
38
{% for service, ports in service_ports.items() -%}
 
39
frontend tcp-in_{{ service }}
 
40
    bind *:{{ ports[0] }}
 
41
    {% if ipv6 -%}
 
42
    bind :::{{ ports[0] }}
 
43
    {% endif -%}
 
44
    {% for frontend in frontends -%}
 
45
    acl net_{{ frontend }} dst {{ frontends[frontend]['network'] }}
 
46
    use_backend {{ service }}_{{ frontend }} if net_{{ frontend }}
 
47
    {% endfor -%}
 
48
    default_backend {{ service }}_{{ default_backend }}
 
49
 
 
50
{% for frontend in frontends -%}
 
51
backend {{ service }}_{{ frontend }}
 
52
    balance leastconn
 
53
    {% for unit, address in frontends[frontend]['backends'].items() -%}
33
54
    server {{ unit }} {{ address }}:{{ ports[1] }} check
34
55
    {% endfor %}
35
56
{% endfor -%}
 
57
{% endfor -%}
36
58
{% endif -%}