From facfe5955b5362659bd4866b98e180bf5a98e9bd Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Wed, 17 Dec 2014 12:45:19 +0100 Subject: [PATCH] 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 --- manifests/identity.pp | 27 +++++++++++++++++---------- spec/classes/cloud_identity_spec.rb | 10 ++++++++++ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/manifests/identity.pp b/manifests/identity.pp index cf078c81..83252486 100644 --- a/manifests/identity.pp +++ b/manifests/identity.pp @@ -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': diff --git a/spec/classes/cloud_identity_spec.rb b/spec/classes/cloud_identity_spec.rb index 46eff32c..5b225e51 100644 --- a/spec/classes/cloud_identity_spec.rb +++ b/spec/classes/cloud_identity_spec.rb @@ -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)