Merge pull request #513 from enovance/fix-horizon-80

loadbalancer: fix an error in HTTP binding
This commit is contained in:
Yanis Guenane 2014-06-17 10:28:46 -04:00
commit 95aa26d6fa
2 changed files with 21 additions and 1 deletions

View File

@ -253,7 +253,7 @@ class cloud::loadbalancer(
warning('horizon_ssl_port parameter is deprecated. Specify port with the horizon_port instead.')
$horizon_port_real = $horizon_ssl_port
} else {
$horizon_port_real = '443'
$horizon_port_real = $horizon_port
}
# end of deprecation support

View File

@ -336,6 +336,25 @@ describe 'cloud::loadbalancer' do
)}
end
context 'configure OpenStack Horizon with backward compatibility' do
before do
params.merge!(
:horizon_ssl_port => '80'
)
end
it { should contain_haproxy__listen('horizon_cluster').with(
:ipaddress => [params[:vip_public_ip]],
:ports => '80',
:options => {
'mode' => 'http',
'http-check' => 'expect ! rstatus ^5',
'option' => ["tcpka", "forwardfor", "tcplog", "httpchk GET / \"HTTP/1.0\\r\\nUser-Agent: HAproxy-myhost\""],
'cookie' => 'sessionid prefix',
'balance' => 'leastconn',
},
)}
end
context 'configure OpenStack Horizon SSL with backward compatibility' do
before do
params.merge!(
@ -359,6 +378,7 @@ describe 'cloud::loadbalancer' do
context 'configure OpenStack Horizon SSL binding' do
before do
params.merge!(
:horizon_port => '443',
:horizon_ssl => false,
:horizon_ssl_port => false,
:horizon_bind_options => ['ssl', 'crt']