# This file is managed by Puppet
global
  daemon  
  group  haproxy
  log  /dev/log local0
  maxconn  20480
  pidfile  /var/run/haproxy.pid
  ssl-default-bind-ciphers  !SSLv2:kEECDH:kRSA:kEDH:kPSK:+3DES:!aNULL:!eNULL:!MD5:!EXP:!RC4:!SEED:!IDEA:!DES
  ssl-default-bind-options  no-sslv3 no-tlsv10
  stats  socket /var/lib/haproxy/stats mode 600 level user
  stats  timeout 2m
  user  haproxy

defaults
  log  global
  maxconn  4096
  mode  tcp
  retries  3
  timeout  http-request 10s
  timeout  queue 2m
  timeout  connect 10s
  timeout  client 2m
  timeout  server 2m
  timeout  check 10s

listen cinder
  bind {{ ctlplane_vip }}:8776 transparent
  mode http
  balance leastconn
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Port %[dst_port]
  option httpchk GET /healthcheck
  option httplog
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:8776 check fall 5 inter 2000 rise 2
{% endfor %}

listen glance_api
  bind {{ ctlplane_vip }}:9292 transparent
  mode http
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Port %[dst_port]
  option httpchk GET /healthcheck
  option httplog
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:9292 check fall 5 inter 2000 rise 2
{% endfor %}

listen haproxy.stats
  bind 127.0.0.1:1993 transparent
  bind {{ ctlplane_vip }}:1993 transparent
  mode http
  stats enable
  stats uri /
  stats auth admin:vvKCRY6Kz0Qe412dacdQ1RV5C

listen heat_api
  bind {{ ctlplane_vip }}:8004 transparent
  mode http
  balance leastconn
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Port %[dst_port]
  option tcpka
  option httpchk GET /healthcheck
  option httplog
  timeout client 10m
  timeout server 10m
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:8004 check fall 5 inter 2000 rise 2
{% endfor %}

listen heat_cfn
  bind {{ ctlplane_vip }}:8000 transparent
  mode http
  balance leastconn
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Port %[dst_port]
  option tcpka
  option httpchk GET /healthcheck
  option httplog
  timeout client 10m
  timeout server 10m
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:8000 check fall 5 inter 2000 rise 2
{% endfor %}

listen horizon
  bind {{ ctlplane_vip }}:80 transparent
  mode http
  cookie SERVERID insert indirect nocache
  option forwardfor
  option httpchk
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:80 check cookie {{ k }} fall 5 inter 2000 rise 2
{% endfor %}

listen keystone_admin
  bind {{ ctlplane_vip }}:35357 transparent
  mode http
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Port %[dst_port]
  option httpchk GET /healthcheck
  option httplog
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:5000 check fall 5 inter 2000 rise 2
{% endfor %}

listen keystone_public
  bind {{ ctlplane_vip }}:5000 transparent
  mode http
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Port %[dst_port]
  option httpchk GET /healthcheck
  option httplog
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:5000 check fall 5 inter 2000 rise 2
{% endfor %}

listen mysql
  bind {{ ctlplane_vip }}:3306 transparent
  option tcpka
  option httpchk
  option tcplog
  stick on dst
  stick-table type ip size 1000
  timeout client 90m
  timeout server 90m
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:3306 backup check inter 1s on-marked-down shutdown-sessions port 9200
{% endfor %}

listen neutron
  bind {{ ctlplane_vip }}:9696 transparent
  mode http
  balance leastconn
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Port %[dst_port]
  option httpchk GET /healthcheck
  option httplog
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:9696 check fall 5 inter 2000 rise 2
{% endfor %}

listen nova_metadata
  bind {{ ctlplane_vip }}:8775 transparent
  mode http
  balance source
  hash-type consistent
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Port %[dst_port]
  option httpchk
  option httplog
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:8775 check fall 5 inter 2000 rise 2
{% endfor %}

listen nova_novncproxy
  bind {{ ctlplane_vip }}:6080 transparent
  mode http
  balance source
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Port %[dst_port]
  option tcpka
  option tcplog
  timeout tunnel 1h
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:6080 check fall 5 inter 2000 rise 2
{% endfor %}

listen nova_osapi
  bind {{ ctlplane_vip }}:8774 transparent
  mode http
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Port %[dst_port]
  option httpchk
  option httplog
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:8774 check fall 5 inter 2000 rise 2
{% endfor %}

listen placement
  bind {{ ctlplane_vip }}:8778 transparent
  mode http
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Port %[dst_port]
  option httpchk
  option httplog
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:8778 check fall 5 inter 2000 rise 2
{% endfor %}

listen swift_proxy_server
  bind {{ ctlplane_vip }}:8080 transparent
  mode http
  balance leastconn
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Port %[dst_port]
  option httpchk GET /healthcheck
  option httplog
  timeout client 2m
  timeout server 2m
{% for k, v in tripleo_controller_ips.items() %}
  server {{ k }} {{ v }}:8080 check fall 5 inter 2000 rise 2
{% endfor %}

