Add RadosGW readiness check
After radosgw service start it requires some time to get operational state
This change introduces check script which waits until radosgw start to serve
http requests.
Change-Id: Iaeb3f60c0da114de1fea3f0ec3aa69acd05b037a
Closes-bug: #1545651
(cherry picked from commit 3d15997434
)
This commit is contained in:
parent
c55b1242a2
commit
2ab7c95205
|
@ -2,6 +2,10 @@ class osnailyfacter::ceph::enable_rados {
|
|||
|
||||
notice('MODULAR: ceph/enable_rados.pp')
|
||||
|
||||
$management_vip = hiera('management_vip', '')
|
||||
$service_endpoint = hiera('service_endpoint', '')
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
||||
include ::ceph::params
|
||||
|
||||
$radosgw_service = $::ceph::params::service_radosgw
|
||||
|
@ -30,13 +34,31 @@ class osnailyfacter::ceph::enable_rados {
|
|||
|
||||
Service['radosgw'] ->
|
||||
File[$radosgw_override_file] ~>
|
||||
Service['radosgw-all']
|
||||
Service['radosgw-all'] ->
|
||||
::Osnailyfacter::Wait_for_backend['object-storage']
|
||||
}
|
||||
else {
|
||||
service { $radosgw_service:
|
||||
ensure => running,
|
||||
enable => true,
|
||||
}
|
||||
|
||||
Service[$radosgw_service] -> ::Osnailyfacter::Wait_for_backend['object-storage']
|
||||
}
|
||||
|
||||
$rgw_protocol = get_ssl_property($ssl_hash, {}, 'radosgw', 'internal', 'protocol', 'http')
|
||||
$rgw_address = get_ssl_property($ssl_hash, {}, 'radosgw', 'internal', 'hostname', [$service_endpoint, $management_vip])
|
||||
$rgw_url = "${rgw_protocol}://${rgw_address}:8080"
|
||||
|
||||
$lb_hash = {
|
||||
'object-storage' => {
|
||||
name => 'object-storage',
|
||||
provider => 'http',
|
||||
url => $rgw_url
|
||||
}
|
||||
}
|
||||
|
||||
::osnailyfacter::wait_for_backend {'object-storage':
|
||||
lb_hash => $lb_hash
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ manifest = 'ceph/enable_rados.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
it "should contain radowgw service" do
|
||||
it "should contain radosgw service" do
|
||||
|
||||
if facts[:operatingsystem] == 'Ubuntu'
|
||||
should contain_service('radosgw').with(
|
||||
|
@ -46,6 +46,20 @@ describe manifest do
|
|||
)
|
||||
end
|
||||
end
|
||||
|
||||
it "should wait until radosgw get ready" do
|
||||
ssl_hash = Noop.hiera_hash('use_ssl', {})
|
||||
service_endpoint = Noop.hiera('service_endpoint', '')
|
||||
management_vip = Noop.hiera('management_vip', '')
|
||||
rgw_protocol = Noop.puppet_function 'get_ssl_property', ssl_hash, {}, 'radosgw', 'internal', 'protocol', 'http'
|
||||
rgw_address = Noop.puppet_function 'get_ssl_property', ssl_hash, {}, 'radosgw', 'internal', 'hostname', [service_endpoint, management_vip]
|
||||
rgw_url = "#{rgw_protocol}://#{rgw_address}:8080"
|
||||
|
||||
should contain_haproxy_backend_status('object-storage').with(
|
||||
:url => rgw_url,
|
||||
:provider => 'http'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
test_ubuntu_and_centos manifest
|
||||
|
|
Loading…
Reference in New Issue