Merge "Normalize civetweb binding address if IPv6"

This commit is contained in:
Jenkins 2016-11-11 19:23:10 +00:00 committed by Gerrit Code Review
commit d69e7d8217
2 changed files with 30 additions and 6 deletions

View File

@ -18,6 +18,14 @@
# #
# === Parameters # === Parameters
# #
# [*civetweb_bind_ip*]
# IP address where to bind the RGW civetweb instance
# (Optional) Defaults to 127.0.0.1
#
# [*civetweb_bind_port*]
# PORT where to bind the RGW civetweb instance
# (Optional) Defaults to 8080
#
# [*keystone_admin_token*] # [*keystone_admin_token*]
# The keystone admin token # The keystone admin token
# #
@ -36,14 +44,22 @@ class tripleo::profile::base::ceph::rgw (
$keystone_admin_token, $keystone_admin_token,
$keystone_url, $keystone_url,
$rgw_key, $rgw_key,
$step = hiera('step'), $civetweb_bind_ip = '127.0.0.1',
$civetweb_bind_port = '8080',
$step = hiera('step'),
) { ) {
include ::tripleo::profile::base::ceph include ::tripleo::profile::base::ceph
if $step >= 3 { if $step >= 3 {
include ::ceph::profile::rgw
$rgw_name = hiera('ceph::profile::params::rgw_name', 'radosgw.gateway') $rgw_name = hiera('ceph::profile::params::rgw_name', 'radosgw.gateway')
$civetweb_bind_ip_real = normalize_ip_for_uri($civetweb_bind_ip)
include ::ceph::params
include ::ceph::profile::base
ceph::rgw { $rgw_name:
frontend_type => 'civetweb',
rgw_frontends => "civetweb port=${civetweb_bind_ip_real}:${civetweb_bind_port}"
}
ceph::key { "client.${rgw_name}": ceph::key { "client.${rgw_name}":
secret => $rgw_key, secret => $rgw_key,
cap_mon => 'allow *', cap_mon => 'allow *',

View File

@ -30,7 +30,9 @@ describe 'tripleo::profile::base::ceph::rgw' do
{ {
:keystone_admin_token => 'token', :keystone_admin_token => 'token',
:keystone_url => 'url', :keystone_url => 'url',
:rgw_key => 'key' :rgw_key => 'key',
:civetweb_bind_ip => '2001:db8:0:1234:0:567:8:1',
:civetweb_bind_port => '8888',
} }
end end
@ -39,7 +41,7 @@ describe 'tripleo::profile::base::ceph::rgw' do
it 'should do nothing' do it 'should do nothing' do
is_expected.to contain_class('tripleo::profile::base::ceph::rgw') is_expected.to contain_class('tripleo::profile::base::ceph::rgw')
is_expected.to contain_class('tripleo::profile::base::ceph') is_expected.to contain_class('tripleo::profile::base::ceph')
is_expected.to_not contain_class('ceph::profile::rgw') is_expected.to_not contain_class('ceph::rgw')
end end
end end
@ -47,7 +49,10 @@ describe 'tripleo::profile::base::ceph::rgw' do
let(:params) { default_params.merge({ :step => 3 }) } let(:params) { default_params.merge({ :step => 3 }) }
it 'should include rgw configuration' do it 'should include rgw configuration' do
is_expected.to contain_class('tripleo::profile::base::ceph') is_expected.to contain_class('tripleo::profile::base::ceph')
is_expected.to contain_class('ceph::profile::rgw') is_expected.to contain_ceph__rgw('radosgw.gateway').with(
:frontend_type => 'civetweb',
:rgw_frontends => 'civetweb port=[2001:db8:0:1234:0:567:8:1]:8888'
)
is_expected.to contain_ceph__key('client.radosgw.gateway').with( is_expected.to contain_ceph__key('client.radosgw.gateway').with(
:secret => 'key', :secret => 'key',
:cap_mon => 'allow *', :cap_mon => 'allow *',
@ -62,7 +67,10 @@ describe 'tripleo::profile::base::ceph::rgw' do
let(:params) { default_params.merge({ :step => 4 }) } let(:params) { default_params.merge({ :step => 4 }) }
it 'should include rgw configuration' do it 'should include rgw configuration' do
is_expected.to contain_class('tripleo::profile::base::ceph') is_expected.to contain_class('tripleo::profile::base::ceph')
is_expected.to contain_class('ceph::profile::rgw') is_expected.to contain_ceph__rgw('radosgw.gateway').with(
:frontend_type => 'civetweb',
:rgw_frontends => 'civetweb port=[2001:db8:0:1234:0:567:8:1]:8888'
)
is_expected.to contain_ceph__key('client.radosgw.gateway').with( is_expected.to contain_ceph__key('client.radosgw.gateway').with(
:secret => 'key', :secret => 'key',
:cap_mon => 'allow *', :cap_mon => 'allow *',