Makes it possible to disable Cinder Service registration

* identity.pp: adds a new optional parameter enable_cinder
* cloud_identity_spec.rb: Add test for disabling cinder service/endpoints

Change-Id: I6b13a70feda845d0c2b70af15bc4a6b21347d595
This commit is contained in:
Mark Chappell 2014-12-17 12:45:19 +01:00
parent a1924ec52f
commit facfe5955b
2 changed files with 27 additions and 10 deletions

View File

@ -391,6 +391,10 @@
# (optional) Amount of time a token should remain valid (in seconds)
# Defaults to '3600' (1 hour)
#
# [*cinder_enabled*]
# (optional) Enable or not Cinder (Block Storage Service)
# Defaults to true
#
# [*trove_enabled*]
# (optional) Enable or not Trove (Database as a Service)
# Experimental feature.
@ -411,6 +415,7 @@
#
class cloud::identity (
$swift_enabled = true,
$cinder_enabled = true,
$trove_enabled = false,
$identity_roles_addons = ['SwiftOperator', 'ResellerAdmin'],
$keystone_db_host = '127.0.0.1',
@ -638,16 +643,18 @@ class cloud::identity (
password => $ks_neutron_password
}
class { 'cinder::keystone::auth':
admin_address => $ks_cinder_admin_host,
internal_address => $ks_cinder_internal_host,
public_address => $ks_cinder_public_host,
port => $ks_cinder_public_port,
public_protocol => $ks_cinder_public_proto,
admin_protocol => $ks_cinder_admin_proto,
internal_protocol => $ks_cinder_internal_proto,
region => $region,
password => $ks_cinder_password
if $cinder_enabled {
class { 'cinder::keystone::auth':
admin_address => $ks_cinder_admin_host,
internal_address => $ks_cinder_internal_host,
public_address => $ks_cinder_public_host,
port => $ks_cinder_public_port,
public_protocol => $ks_cinder_public_proto,
admin_protocol => $ks_cinder_admin_proto,
internal_protocol => $ks_cinder_internal_proto,
region => $region,
password => $ks_cinder_password
}
}
class { 'glance::keystone::auth':

View File

@ -25,6 +25,7 @@ describe 'cloud::identity' do
let :params do
{ :identity_roles_addons => ['SwiftOperator', 'ResellerAdmin'],
:swift_enabled => true,
:cinder_enabled => true,
:keystone_db_host => '10.0.0.1',
:keystone_db_user => 'keystone',
:keystone_db_password => 'secrete',
@ -327,6 +328,15 @@ describe 'cloud::identity' do
end
end
context 'without Cinder' do
before :each do
params.merge!(:cinder_enabled => false)
end
it 'should not configure cinder endpoints and users' do
is_expected.not_to contain_class('cinder::keystone::auth')
end
end
context 'with Trove' do
before :each do
params.merge!(:trove_enabled => true)