Merge "Add support for rbd-backed volumes to ::all class"

This commit is contained in:
Jenkins
2013-09-20 08:02:47 +00:00
committed by Gerrit Code Review
4 changed files with 59 additions and 0 deletions

View File

@@ -196,6 +196,10 @@ class openstack::all (
$setup_test_volume = false,
$volume_group = 'cinder-volumes',
$iscsi_ip_address = '127.0.0.1',
$cinder_volume_driver = 'iscsi',
$cinder_rbd_user = 'volumes',
$cinder_rbd_pool = 'volumes',
$cinder_rbd_secret_uuid = false,
# Neutron
$neutron = true,
$bridge_interface = undef,
@@ -512,6 +516,10 @@ class openstack::all (
db_type => $db_type,
db_host => $db_host,
iscsi_ip_address => $iscsi_ip_address,
volume_driver => $cinder_volume_driver,
rbd_user => $cinder_rbd_user,
rbd_pool => $cinder_rbd_pool,
rbd_secret_uuid => $cinder_rbd_secret_uuid,
setup_test_volume => $setup_test_volume,
manage_volumes => $manage_volumes,
volume_group => $volume_group,

View File

@@ -29,6 +29,9 @@ class openstack::cinder::all(
$volume_group = 'cinder-volumes',
$volume_driver = 'iscsi',
$iscsi_ip_address = '127.0.0.1',
$rbd_user = 'volumes',
$rbd_pool = 'volumes',
$rbd_secret_uuid = false,
$setup_test_volume = false,
$manage_volumes = true,
$debug = false,
@@ -95,6 +98,12 @@ class openstack::cinder::all(
volume_name => $volume_group,
}
}
} elsif $volume_driver == 'rbd' {
class { 'cinder::volume::rbd':
rbd_pool => $rbd_pool,
rbd_user => $rbd_user,
rbd_secret_uuid => $rbd_secret_uuid,
}
} else {
warning("Unsupported volume driver: ${volume_driver}, make sure you are configuring this yourself")
}

View File

@@ -225,6 +225,30 @@ describe 'openstack::all' do
end
end
context 'cinder enabled and Ceph RBD as the backend' do
before do
params.merge!(
:neutron_user_password => 'neutron_user_password',
:neutron_db_password => 'neutron_db_password',
:bridge_interface => 'eth0',
:ovs_local_ip => '10.0.1.1',
:metadata_shared_secret => 'shared_md_secret',
:cinder_db_password => 'cinder_db_password',
:cinder_user_password => 'cinder_user_password',
:cinder_volume_driver => 'rbd',
:cinder_rbd_secret_uuid => 'e80afa94-a64c-486c-9e34-d55e85f26406'
)
end
it 'should have cinder::volume::rbd' do
should contain_class('cinder::volume::rbd').with(
:rbd_pool => 'volumes',
:rbd_user => 'volumes',
:rbd_secret_uuid => 'e80afa94-a64c-486c-9e34-d55e85f26406'
)
end
end
context 'cinder and neutron enabled (which is the default)' do
before do
params.merge!(

View File

@@ -76,6 +76,24 @@ describe 'openstack::cinder::all' do
it { should_not contain_class('cinder::volume::iscsi') }
end
describe 'with a volume driver other than rbd' do
before do
params.merge!(
:volume_driver => 'netapp'
)
end
it { should_not contain_class('cinder::volume::rbd') }
end
describe 'with the rbd volume driver' do
before do
params.merge!(
:volume_driver => 'rbd'
)
end
it { should contain_class('cinder::volume::rbd') }
end
describe 'when setting up test volumes for iscsi' do
before do
params.merge!(