From a7fa92aab70841d0ae9391fc5b9f78752690937a Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 17 Jun 2014 16:04:45 +0200 Subject: [PATCH] loadbalancer: fix an error in HTTP binding In a previous pull-request, we broke 80 tcp binding. Let's fix it and also add one more test to ensure we won't break it again. --- manifests/loadbalancer.pp | 2 +- spec/classes/cloud_loadbalancer_spec.rb | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/manifests/loadbalancer.pp b/manifests/loadbalancer.pp index 7f6c8c65..ba3c64b1 100644 --- a/manifests/loadbalancer.pp +++ b/manifests/loadbalancer.pp @@ -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 diff --git a/spec/classes/cloud_loadbalancer_spec.rb b/spec/classes/cloud_loadbalancer_spec.rb index ce21585d..602c27a5 100644 --- a/spec/classes/cloud_loadbalancer_spec.rb +++ b/spec/classes/cloud_loadbalancer_spec.rb @@ -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']