loadbalancer/horizon: check real Horizon URL

On Red Hat and Debian, Horizon URL are not the same. HAproxy is now able
to check the real URL to get a HTTP 200 is Horizon is actually working.
This commit is contained in:
Emilien Macchi
2014-04-29 15:27:25 +02:00
parent f12ffaf920
commit 32e17370fb

View File

@@ -518,11 +518,18 @@ class cloud::loadbalancer(
listen_ip => $vip_public_ip;
}
} else {
# Horizon URL is not the same on Red Hat and Debian/Ubuntu
if $::operatingsystem == 'RedHat' {
$horizon_auth_url = 'dashboard'
} else {
$horizon_auth_url = 'horizon'
}
cloud::loadbalancer::listen_http{
'horizon_cluster':
ports => $horizon_port,
httpchk => "httpchk GET / HTTP/1.0\r\nUser-Agent:\ ${::hostname}",
options => {'cookie' => 'sessionid prefix', 'balance' => 'leastconn' },
httpchk => "httpchk GET /$horizon_auth_url HTTP/1.0\r\nUser-Agent:\ HAproxy-${::hostname}",
options => { 'cookie' => 'sessionid prefix', 'balance' => 'leastconn' },
listen_ip => $vip_public_ip;
}
}