loadbalancer: Use binding class but keep listen_https compat
Remove the use of the listen_https class but remain compatible with previous use of listen_https
This commit is contained in:
parent
4ea212488b
commit
4b74492e1e
@ -55,15 +55,6 @@ define cloud::loadbalancer::binding (
|
|||||||
fail("${ip} is not part of VIP pools.")
|
fail("${ip} is not part of VIP pools.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if 'ssl' in $bind_options {
|
|
||||||
cloud::loadbalancer::listen_https { $name :
|
|
||||||
ports => $port,
|
|
||||||
httpchk => $httpchk,
|
|
||||||
options => $options,
|
|
||||||
listen_ip => $listen_ip_real,
|
|
||||||
bind_options => $bind_options;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
cloud::loadbalancer::listen_http { $name :
|
cloud::loadbalancer::listen_http { $name :
|
||||||
ports => $port,
|
ports => $port,
|
||||||
httpchk => $httpchk,
|
httpchk => $httpchk,
|
||||||
@ -72,6 +63,5 @@ define cloud::loadbalancer::binding (
|
|||||||
bind_options => $bind_options;
|
bind_options => $bind_options;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ define cloud::loadbalancer::listen_http(
|
|||||||
$options_basic = {'mode' => 'http',
|
$options_basic = {'mode' => 'http',
|
||||||
'balance' => 'roundrobin',
|
'balance' => 'roundrobin',
|
||||||
'http-check' => 'expect ! rstatus ^5',
|
'http-check' => 'expect ! rstatus ^5',
|
||||||
'option' => ['tcpka', 'tcplog', $httpchk] }
|
'option' => ['tcpka', 'forwardfor', 'tcplog', $httpchk] }
|
||||||
|
|
||||||
$options_custom = merge($options_basic, $options)
|
$options_custom = merge($options_basic, $options)
|
||||||
|
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
# not use this file except in compliance with the License. You may obtain
|
|
||||||
# a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
# License for the specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
#
|
|
||||||
# Define::
|
|
||||||
#
|
|
||||||
# cloud::loadbalancer::listen_https
|
|
||||||
#
|
|
||||||
define cloud::loadbalancer::listen_https(
|
|
||||||
$ports = 'unset',
|
|
||||||
$httpchk = 'ssl-hello-chk',
|
|
||||||
$options = {},
|
|
||||||
$bind_options = [],
|
|
||||||
$listen_ip = '0.0.0.0') {
|
|
||||||
|
|
||||||
$options_basic = {'mode' => 'http',
|
|
||||||
'balance' => 'roundrobin',
|
|
||||||
'http-check' => 'expect ! rstatus ^5',
|
|
||||||
'option' => ['tcpka', 'forwardfor', 'tcplog', $httpchk] }
|
|
||||||
|
|
||||||
$options_custom = merge($options_basic, $options)
|
|
||||||
|
|
||||||
haproxy::listen { $name:
|
|
||||||
ipaddress => $listen_ip,
|
|
||||||
ports => $ports,
|
|
||||||
options => $options_custom,
|
|
||||||
bind_options => $bind_options,
|
|
||||||
}
|
|
||||||
}
|
|
@ -207,7 +207,7 @@ describe 'cloud::loadbalancer' do
|
|||||||
:ports => '6082',
|
:ports => '6082',
|
||||||
:options => {
|
:options => {
|
||||||
'mode' => 'http',
|
'mode' => 'http',
|
||||||
'option' => ['tcpka','tcplog','httpchk GET /'],
|
'option' => ['tcpka', 'forwardfor', 'tcplog','httpchk GET /'],
|
||||||
'http-check' => 'expect ! rstatus ^5',
|
'http-check' => 'expect ! rstatus ^5',
|
||||||
'balance' => 'leastconn',
|
'balance' => 'leastconn',
|
||||||
'timeout server' => '120m',
|
'timeout server' => '120m',
|
||||||
@ -309,7 +309,7 @@ describe 'cloud::loadbalancer' do
|
|||||||
:ports => '8774',
|
:ports => '8774',
|
||||||
:options => {
|
:options => {
|
||||||
'mode' => 'http',
|
'mode' => 'http',
|
||||||
'option' => ['tcpka','forwardfor','tcplog','ssl-hello-chk'],
|
'option' => ['tcpka','forwardfor','tcplog','httpchk'],
|
||||||
'http-check' => 'expect ! rstatus ^5',
|
'http-check' => 'expect ! rstatus ^5',
|
||||||
'balance' => 'roundrobin',
|
'balance' => 'roundrobin',
|
||||||
},
|
},
|
||||||
@ -328,7 +328,7 @@ describe 'cloud::loadbalancer' do
|
|||||||
:ports => '8776',
|
:ports => '8776',
|
||||||
:options => {
|
:options => {
|
||||||
'mode' => 'http',
|
'mode' => 'http',
|
||||||
'option' => ['tcpka','tcplog','httpchk'],
|
'option' => ['tcpka','forwardfor','tcplog', 'httpchk'],
|
||||||
'http-check' => 'expect ! rstatus ^5',
|
'http-check' => 'expect ! rstatus ^5',
|
||||||
'balance' => 'roundrobin',
|
'balance' => 'roundrobin',
|
||||||
},
|
},
|
||||||
@ -349,7 +349,7 @@ describe 'cloud::loadbalancer' do
|
|||||||
:options => {
|
:options => {
|
||||||
'mode' => 'tcp',
|
'mode' => 'tcp',
|
||||||
'http-check' => 'expect ! rstatus ^5',
|
'http-check' => 'expect ! rstatus ^5',
|
||||||
'option' => ['tcpka','tcplog','ssl-hello-chk'],
|
'option' => ['tcpka','forwardfor','tcplog', 'ssl-hello-chk'],
|
||||||
'cookie' => 'sessionid prefix',
|
'cookie' => 'sessionid prefix',
|
||||||
'balance' => 'leastconn',
|
'balance' => 'leastconn',
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user