compute/hypervisor: configure RBD only if Ceph is enabled

Close bug #87

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
Emilien Macchi 2014-02-10 22:36:46 +01:00
parent c729355ec2
commit 900e16e3f5
2 changed files with 28 additions and 16 deletions

View File

@ -106,6 +106,7 @@ Host *
class { 'nova::compute::neutron': } class { 'nova::compute::neutron': }
if $has_ceph {
# TODO(EmilienM) Temporary, while https://review.openstack.org/#/c/72440 got merged # TODO(EmilienM) Temporary, while https://review.openstack.org/#/c/72440 got merged
nova_config { nova_config {
'DEFAULT/libvirt_images_type': value => 'rbd'; 'DEFAULT/libvirt_images_type': value => 'rbd';
@ -122,7 +123,6 @@ Host *
'DEFAULT/live_migration_flag': value => 'VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST'; 'DEFAULT/live_migration_flag': value => 'VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST';
} }
if $has_ceph {
File <<| tag == 'ceph_compute_secret_file' |>> File <<| tag == 'ceph_compute_secret_file' |>>
Exec <<| tag == 'get_or_set_virsh_secret' |>> Exec <<| tag == 'get_or_set_virsh_secret' |>>
Exec <<| tag == 'set_secret_value_virsh' |>> Exec <<| tag == 'set_secret_value_virsh' |>>

View File

@ -41,6 +41,8 @@ describe 'cloud::compute::hypervisor' do
{ :libvirt_type => 'kvm', { :libvirt_type => 'kvm',
:server_proxyclient_address => '7.0.0.1', :server_proxyclient_address => '7.0.0.1',
:spice_port => '6082', :spice_port => '6082',
:api_eth => '10.0.0.1',
:has_ceph => true,
:nova_ssh_private_key => 'secrete', :nova_ssh_private_key => 'secrete',
:nova_ssh_public_key => 'public', :nova_ssh_public_key => 'public',
:ks_nova_internal_proto => 'http', :ks_nova_internal_proto => 'http',
@ -116,6 +118,16 @@ describe 'cloud::compute::hypervisor' do
should contain_nova_config('DEFAULT/libvirt_inject_partition').with('value' => '-2') should contain_nova_config('DEFAULT/libvirt_inject_partition').with('value' => '-2')
should contain_nova_config('DEFAULT/live_migration_flag').with('value' => 'VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST') should contain_nova_config('DEFAULT/live_migration_flag').with('value' => 'VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST')
end end
context 'without RBD backend' do
before :each do
params.merge!( :has_ceph => false )
end
it 'should not configure nova-compute for RBD backend' do
should_not contain_nova_config('DEFAULT/rbd_user').with('value' => 'nova')
end
end
end end
context 'on Debian platforms' do context 'on Debian platforms' do