[storage/rbd] Fix Ceph::Key[admin] dependency
Ceph admin key is populated by a fact and exported through a exported resource, a require on Ceph::Key class has no sens here, and this bloc the run. A better solution is to test if the value is empty and run pool creation then. This commit Close #18 and I've successfully tested this on os-ci-test9 ! Please see: https://github.com/enovance/puppet-cloud/issues/18 https://github.com/enovance/openstack-puppet-ci/blob/master/site.pp#L145-L148 https://github.com/enovance/puppet-ceph/blob/master/lib/facter/ceph_osd_bootstrap_key.rb#L18-L21
This commit is contained in:
parent
07345ba9cc
commit
c15e60283b
@ -28,35 +28,32 @@ class cloud::storage::rbd::pools(
|
|||||||
|
|
||||||
if $setup_pools {
|
if $setup_pools {
|
||||||
|
|
||||||
# ceph osd pool create poolname 128 128
|
if !empty($::ceph_admin_key) {
|
||||||
exec { 'create_glance_images_pool':
|
# ceph osd pool create poolname 128 128
|
||||||
command => "rados mkpool ${glance_pool} ${pool_default_pg_num} ${pool_default_pgp_num}",
|
exec { 'create_glance_images_pool':
|
||||||
unless => "rados lspools | grep -sq ${glance_pool}",
|
command => "rados mkpool ${glance_pool} ${pool_default_pg_num} ${pool_default_pgp_num}",
|
||||||
require => Ceph::Key['admin'];
|
unless => "rados lspools | grep -sq ${glance_pool}",
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'create_glance_images_user_and_key':
|
exec { 'create_glance_images_user_and_key':
|
||||||
command => "ceph auth get-or-create client.${glance_user} mon 'allow r' \
|
command => "ceph auth get-or-create client.${glance_user} mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${glance_pool}'",
|
||||||
osd 'allow class-read object_prefix rbd_children, allow rwx pool=${glance_pool}'",
|
unless => "ceph auth list 2> /dev/null | egrep -sq '^client.${glance_user}$'",
|
||||||
unless => "ceph auth list 2> /dev/null | egrep -sq '^client.${glance_user}$'",
|
require => Exec['create_glance_images_pool'];
|
||||||
require => Exec['create_glance_images_pool'];
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
# ceph osd pool create poolname 128 128
|
||||||
|
exec { 'create_cinder_volumes_pool':
|
||||||
|
command => "rados mkpool ${cinder_pool} ${pool_default_pg_num} ${pool_default_pgp_num}",
|
||||||
|
unless => "/usr/bin/rados lspools | grep -sq ${cinder_pool}",
|
||||||
|
}
|
||||||
|
|
||||||
# ceph osd pool create poolname 128 128
|
exec { 'create_cinder_volumes_user_and_key':
|
||||||
exec { 'create_cinder_volumes_pool':
|
# TODO: point PG num with a cluster variable
|
||||||
command => "rados mkpool ${cinder_pool} ${pool_default_pg_num} ${pool_default_pgp_num}",
|
command => "ceph auth get-or-create client.${cinder_user} mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${glance_pool}, allow rx pool=${cinder_pool}'",
|
||||||
unless => "/usr/bin/rados lspools | grep -sq ${cinder_pool}",
|
unless => "ceph auth list 2> /dev/null | egrep -sq '^client.${cinder_user}$'",
|
||||||
require => Ceph::Key['admin'];
|
require => Exec['create_cinder_volumes_pool'];
|
||||||
}
|
}
|
||||||
|
} # !empty($::ceph_admin_key)
|
||||||
exec { 'create_cinder_volumes_user_and_key':
|
|
||||||
# TODO: point PG num with a cluster variable
|
|
||||||
command => "ceph auth get-or-create client.${cinder_user} mon 'allow r' \
|
|
||||||
osd 'allow class-read object_prefix rbd_children, allow rwx pool=${glance_pool}, allow rx pool=${cinder_pool}'",
|
|
||||||
unless => "ceph auth list 2> /dev/null | egrep -sq '^client.${cinder_user}$'",
|
|
||||||
require => Exec['create_cinder_volumes_pool'];
|
|
||||||
}
|
|
||||||
|
|
||||||
# exec { "create cinder backup pool":
|
# exec { "create cinder backup pool":
|
||||||
# # TODO: point PG num with a cluster variable + keyring
|
# # TODO: point PG num with a cluster variable + keyring
|
||||||
|
Loading…
x
Reference in New Issue
Block a user