Revert "loadbalancer: Allow user to bind multiple public/private ips"

Error to compile the catalog:
Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: member(): Requires array to work with at
/etc/puppet/modules/cloud/manifests/loadbalancer.pp:262 on node
os-ci-test10
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

The patch is going to be reverted and redone by spredzy.
This reverts commit 78397ab240.

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
Emilien Macchi
2014-09-16 13:24:37 -04:00
parent 6e48cbc9d5
commit b86b09c252
6 changed files with 8 additions and 27 deletions

View File

@@ -98,7 +98,7 @@ fixtures:
ref: '4592bfd59cd5d4795069798a14b483e16c98c1ff' ref: '4592bfd59cd5d4795069798a14b483e16c98c1ff'
'stdlib': 'stdlib':
repo: 'git://github.com/enovance/puppetlabs-stdlib.git' repo: 'git://github.com/enovance/puppetlabs-stdlib.git'
ref: '8a9b2dfc0e463bec39c00c82c30e0a8a8b7867f3' ref: '224b8f9a191f635b03ee900a9bf87bfdb0f1a6ed'
'xinetd': 'xinetd':
repo: 'git://github.com/enovance/puppetlabs-xinetd.git' repo: 'git://github.com/enovance/puppetlabs-xinetd.git'
ref: '7557af0e418d1a587df04fe7d01322ff2473c32e' ref: '7557af0e418d1a587df04fe7d01322ff2473c32e'

View File

@@ -140,11 +140,9 @@ mod 'ssh',
mod 'rsyslog', mod 'rsyslog',
:git => 'git://github.com/enovance/puppet-rsyslog.git', :git => 'git://github.com/enovance/puppet-rsyslog.git',
:ref => '67c7c501b916ebd1a27a8a218d49602339526c4f' :ref => '67c7c501b916ebd1a27a8a218d49602339526c4f'
#TODO(Spredzy) come back to upstream after
# https://github.com/puppetlabs/puppetlabs-stdlib/pull/319
mod 'stdlib', mod 'stdlib',
:git => 'git://github.com/enovance/puppetlabs-stdlib.git', :git => 'git://github.com/enovance/puppetlabs-stdlib.git',
:ref => '8a9b2dfc0e463bec39c00c82c30e0a8a8b7867f3' :ref => '224b8f9a191f635b03ee900a9bf87bfdb0f1a6ed'
mod 'sysctl', mod 'sysctl',
:git => 'git://github.com/enovance/puppet-sysctl.git', :git => 'git://github.com/enovance/puppet-sysctl.git',
:ref => '4a463384e844f51b270428643a5b8beb3628e854' :ref => '4a463384e844f51b270428643a5b8beb3628e854'

View File

@@ -259,13 +259,13 @@ class cloud::loadbalancer(
# end of deprecation support # end of deprecation support
# Fail if OpenStack and Galera VIP are not in the VIP list # Fail if OpenStack and Galera VIP are not in the VIP list
if $vip_public_ip and !(member($keepalived_public_ipvs_real, $vip_public_ip)) { if $vip_public_ip and !($vip_public_ip in $keepalived_public_ipvs_real) {
fail('vip_public_ip should be part of keepalived_public_ipvs.') fail('vip_public_ip should be part of keepalived_public_ipvs.')
} }
if $vip_internal_ip and !(member($keepalived_internal_ipvs,$vip_internal_ip)) { if $vip_internal_ip and !($vip_internal_ip in $keepalived_internal_ipvs) {
fail('vip_internal_ip should be part of keepalived_internal_ipvs.') fail('vip_internal_ip should be part of keepalived_internal_ipvs.')
} }
if $galera_ip and !((member($keepalived_public_ipvs_real,$galera_ip)) or (member($keepalived_internal_ipvs,$galera_ip))) { if $galera_ip and !(($galera_ip in $keepalived_public_ipvs_real) or ($galera_ip in $keepalived_internal_ipvs)) {
fail('galera_ip should be part of keepalived_public_ipvs or keepalived_internal_ipvs.') fail('galera_ip should be part of keepalived_public_ipvs or keepalived_internal_ipvs.')
} }
@@ -484,7 +484,7 @@ class cloud::loadbalancer(
bind_options => $horizon_ssl_bind_options, bind_options => $horizon_ssl_bind_options,
} }
if (member($keepalived_public_ipvs_real, $galera_ip)) { if ($galera_ip in $keepalived_public_ipvs_real) {
warning('Exposing Galera cluster to public network is a security issue.') warning('Exposing Galera cluster to public network is a security issue.')
} }
haproxy::listen { 'galera_cluster': haproxy::listen { 'galera_cluster':

View File

@@ -49,7 +49,7 @@ define cloud::loadbalancer::binding (
$listen_ip_real = $all_vip_array $listen_ip_real = $all_vip_array
} else { } else {
# when binding is specified in parameter # when binding is specified in parameter
if (member($all_vip_array, $ip)) { if ($ip in $all_vip_array) {
$listen_ip_real = $ip $listen_ip_real = $ip
} else { } else {
fail("${ip} is not part of VIP pools.") fail("${ip} is not part of VIP pools.")

View File

@@ -22,7 +22,7 @@ define cloud::loadbalancer::listen_http(
$httpchk = 'httpchk', $httpchk = 'httpchk',
$options = {}, $options = {},
$bind_options = [], $bind_options = [],
$listen_ip = ['0.0.0.0']) { $listen_ip = '0.0.0.0') {
$options_basic = {'mode' => 'http', $options_basic = {'mode' => 'http',
'balance' => 'roundrobin', 'balance' => 'roundrobin',

View File

@@ -247,23 +247,6 @@ describe 'cloud::loadbalancer' do
)} )}
end end
context 'configure OpenStack binding on IPv4 and IPv6 public ip' do
before do
params.merge!(
:nova_api => true,
:galera_ip => '172.16.0.1',
:vip_public_ip => ['172.16.0.1', '2001:0db8:85a3:0000:0000:8a2e:0370:7334'],
:vip_internal_ip => '192.168.0.1',
:keepalived_public_ipvs => ['172.16.0.1', '172.16.0.2', '2001:0db8:85a3:0000:0000:8a2e:0370:7334'],
:keepalived_internal_ipvs => ['192.168.0.1', '192.168.0.2']
)
end
it { should contain_haproxy__listen('nova_api_cluster').with(
:ipaddress => ['172.16.0.1', '2001:0db8:85a3:0000:0000:8a2e:0370:7334', '192.168.0.1'],
:ports => '8774'
)}
end
context 'disable an OpenStack service binding' do context 'disable an OpenStack service binding' do
before do before do
params.merge!(:metadata_api => false) params.merge!(:metadata_api => false)