Merge "Add RadosGW readiness check" into stable/mitaka

This commit is contained in:
Jenkins 2016-04-14 10:16:09 +00:00 committed by Gerrit Code Review
commit e65eecdbc8
2 changed files with 38 additions and 2 deletions

View File

@ -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
}
}

View File

@ -7,7 +7,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(
@ -40,6 +40,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