Merge "Add ability to set url_base for staticweb middleware"

This commit is contained in:
Jenkins 2017-03-09 15:12:50 +00:00 committed by Gerrit Code Review
commit 5e7b938653
3 changed files with 17 additions and 2 deletions

View File

@ -55,7 +55,8 @@ class openstack_tasks::swift::parts::proxy (
$auth_uri = 'http://127.0.0.1:5000', $auth_uri = 'http://127.0.0.1:5000',
$identity_uri = 'http://127.0.0.1:35357', $identity_uri = 'http://127.0.0.1:35357',
$swift_operator_roles = ['admin', 'SwiftOperator'], $swift_operator_roles = ['admin', 'SwiftOperator'],
$transport_url = 'rabbit://guest:password@127.0.0.1:5672/' $transport_url = 'rabbit://guest:password@127.0.0.1:5672/',
$swift_url_base = 'http:',
) { ) {
if !defined(Class['swift']) { if !defined(Class['swift']) {
class { 'swift': class { 'swift':
@ -114,7 +115,7 @@ class openstack_tasks::swift::parts::proxy (
# configure all of the middlewares # configure all of the middlewares
class { ['::swift::proxy::catch_errors', '::swift::proxy::crossdomain', '::swift::proxy::healthcheck', class { ['::swift::proxy::catch_errors', '::swift::proxy::crossdomain', '::swift::proxy::healthcheck',
'::swift::proxy::bulk', '::swift::proxy::tempurl', '::swift::proxy::formpost', '::swift::proxy::swift3', '::swift::proxy::bulk', '::swift::proxy::tempurl', '::swift::proxy::formpost', '::swift::proxy::swift3',
'::swift::proxy::staticweb', '::swift::proxy::container_quotas', '::swift::proxy::account_quotas', '::swift::proxy::container_quotas', '::swift::proxy::account_quotas',
'::swift::proxy::slo', '::swift::proxy::container_sync']: '::swift::proxy::slo', '::swift::proxy::container_sync']:
} }
@ -146,6 +147,10 @@ class openstack_tasks::swift::parts::proxy (
identity_uri => $identity_uri, identity_uri => $identity_uri,
} }
class {'::swift::proxy::staticweb':
url_base => $swift_url_base,
}
if $primary_proxy { if $primary_proxy {
# we need to exec swift ringrebuilder commands under swift user # we need to exec swift ringrebuilder commands under swift user
Exec { user => 'swift' } Exec { user => 'swift' }

View File

@ -53,6 +53,8 @@ class openstack_tasks::swift::proxy_storage {
$swift_public_protocol = get_ssl_property($ssl_hash, $public_ssl_hash, 'swift', 'public', 'protocol', 'http') $swift_public_protocol = get_ssl_property($ssl_hash, $public_ssl_hash, 'swift', 'public', 'protocol', 'http')
$swift_public_address = get_ssl_property($ssl_hash, $public_ssl_hash, 'swift', 'public', 'hostname', [hiera('public_vip')]) $swift_public_address = get_ssl_property($ssl_hash, $public_ssl_hash, 'swift', 'public', 'hostname', [hiera('public_vip')])
$swift_url_base = "${swift_public_protocol}:"
$swift_proxies_num = size(hiera('swift_proxies')) $swift_proxies_num = size(hiera('swift_proxies'))
# Use Swift if it isn't replaced by Ceph for BOTH images and objects # Use Swift if it isn't replaced by Ceph for BOTH images and objects
@ -102,6 +104,7 @@ class openstack_tasks::swift::proxy_storage {
auth_uri => $auth_uri, auth_uri => $auth_uri,
identity_uri => $identity_uri, identity_uri => $identity_uri,
transport_url => $transport_url, transport_url => $transport_url,
swift_url_base => $swift_url_base,
} }
# Check swift proxy and internal VIP are from the same IP network. If no # Check swift proxy and internal VIP are from the same IP network. If no

View File

@ -68,6 +68,7 @@ describe manifest do
let(:swift_interal_address) { Noop.puppet_function 'get_ssl_property',ssl_hash,{},'swift','internal','hostname',[swift_api_ipaddr, management_vip] } let(:swift_interal_address) { Noop.puppet_function 'get_ssl_property',ssl_hash,{},'swift','internal','hostname',[swift_api_ipaddr, management_vip] }
let(:swift_public_protocol) { Noop.puppet_function 'get_ssl_property',ssl_hash,public_ssl_hash,'swift','public','protocol','http' } let(:swift_public_protocol) { Noop.puppet_function 'get_ssl_property',ssl_hash,public_ssl_hash,'swift','public','protocol','http' }
let(:swift_public_address) { Noop.puppet_function 'get_ssl_property',ssl_hash,public_ssl_hash,'swift','public','hostname',[Noop.hiera('public_vip')] } let(:swift_public_address) { Noop.puppet_function 'get_ssl_property',ssl_hash,public_ssl_hash,'swift','public','hostname',[Noop.hiera('public_vip')] }
let(:swift_url_base) {"#{swift_public_protocol}:"}
# Swift # Swift
if !(storage_hash['images_ceph'] and storage_hash['objects_ceph']) if !(storage_hash['images_ceph'] and storage_hash['objects_ceph'])
@ -168,6 +169,12 @@ describe manifest do
) )
end end
it 'should contain correct swift url base' do
should contain_class('openstack_tasks::swift::parts::proxy').with(
:swift_url_base => swift_url_base
)
end
it 'should contain memcached params' do it 'should contain memcached params' do
should contain_class('openstack_tasks::swift::parts::proxy').with( should contain_class('openstack_tasks::swift::parts::proxy').with(
:memcached_servers => memcached_servers :memcached_servers => memcached_servers