diff --git a/deployment/puppet/openstack_tasks/manifests/swift/parts/proxy.pp b/deployment/puppet/openstack_tasks/manifests/swift/parts/proxy.pp index 3a2e6f0196..6dee0794a0 100644 --- a/deployment/puppet/openstack_tasks/manifests/swift/parts/proxy.pp +++ b/deployment/puppet/openstack_tasks/manifests/swift/parts/proxy.pp @@ -55,7 +55,8 @@ class openstack_tasks::swift::parts::proxy ( $auth_uri = 'http://127.0.0.1:5000', $identity_uri = 'http://127.0.0.1:35357', $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']) { class { 'swift': @@ -114,7 +115,7 @@ class openstack_tasks::swift::parts::proxy ( # configure all of the middlewares 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::staticweb', '::swift::proxy::container_quotas', '::swift::proxy::account_quotas', + '::swift::proxy::container_quotas', '::swift::proxy::account_quotas', '::swift::proxy::slo', '::swift::proxy::container_sync']: } @@ -146,6 +147,10 @@ class openstack_tasks::swift::parts::proxy ( identity_uri => $identity_uri, } + class {'::swift::proxy::staticweb': + url_base => $swift_url_base, + } + if $primary_proxy { # we need to exec swift ringrebuilder commands under swift user Exec { user => 'swift' } diff --git a/deployment/puppet/openstack_tasks/manifests/swift/proxy_storage.pp b/deployment/puppet/openstack_tasks/manifests/swift/proxy_storage.pp index ae1207db66..1605a6a072 100644 --- a/deployment/puppet/openstack_tasks/manifests/swift/proxy_storage.pp +++ b/deployment/puppet/openstack_tasks/manifests/swift/proxy_storage.pp @@ -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_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')) # 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, identity_uri => $identity_uri, transport_url => $transport_url, + swift_url_base => $swift_url_base, } # Check swift proxy and internal VIP are from the same IP network. If no diff --git a/tests/noop/spec/hosts/swift/proxy_storage_spec.rb b/tests/noop/spec/hosts/swift/proxy_storage_spec.rb index 87a9cd22d1..6ad42d2ac5 100644 --- a/tests/noop/spec/hosts/swift/proxy_storage_spec.rb +++ b/tests/noop/spec/hosts/swift/proxy_storage_spec.rb @@ -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_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_url_base) {"#{swift_public_protocol}:"} # Swift if !(storage_hash['images_ceph'] and storage_hash['objects_ceph']) @@ -168,6 +169,12 @@ describe manifest do ) 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 should contain_class('openstack_tasks::swift::parts::proxy').with( :memcached_servers => memcached_servers