~seyeongkim/charms/trusty/nova-compute/lp1417891

« back to all changes in this revision

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

  • Committer: james.page at ubuntu
  • Date: 2014-10-06 21:57:43 UTC
  • mfrom: (80.1.3 nova-compute)
  • Revision ID: james.page@ubuntu.com-20141006215743-auucleyomgjcjche
[coreycb,r=james-page] Fixup amulet tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    stats uri /
35
35
    stats auth admin:password
36
36
 
37
 
{% if units -%}
 
37
{% if frontends -%}
38
38
{% for service, ports in service_ports.iteritems() -%}
39
 
listen {{ service }}_ipv4 0.0.0.0:{{ ports[0] }}
40
 
    balance roundrobin
41
 
    {% for unit, address in units.iteritems() -%}
42
 
    server {{ unit }} {{ address }}:{{ ports[1] }} check
43
 
    {% endfor %}
44
 
listen {{ service }}_ipv6 :::{{ ports[0] }}
45
 
    balance roundrobin
46
 
    {% for unit, address in units.iteritems() -%}
47
 
    server {{ unit }} {{ address }}:{{ ports[1] }} check
48
 
    {% endfor %}
 
39
frontend tcp-in_{{ service }}
 
40
    bind *:{{ ports[0] }}
 
41
    bind :::{{ ports[0] }}
 
42
    {% for frontend in frontends -%}
 
43
    acl net_{{ frontend }} dst {{ frontends[frontend]['network'] }}
 
44
    use_backend {{ service }}_{{ frontend }} if net_{{ frontend }}
 
45
    {% endfor %}
 
46
{% for frontend in frontends -%}
 
47
backend {{ service }}_{{ frontend }}
 
48
    balance leastconn
 
49
    {% for unit, address in frontends[frontend]['backends'].iteritems() -%}
 
50
    server {{ unit }} {{ address }}:{{ ports[1] }} check
 
51
    {% endfor %}
 
52
{% endfor -%}
49
53
{% endfor -%}
50
54
{% endif -%}