From 7a073e01bcb1f3bc53af53fa48b043d1eee45c8a Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 18 Sep 2014 22:27:21 -0400 Subject: [PATCH] identity: disable trove by default Trove (Database as a service) is still experimental and should be disabled by default to avoid error with current default configuration. This patchs does it by adding a new parameter trove_enabled (False by default) and only create Keystone endpoint if this parameter is at True. It also avoids to see the Database panel in Horizon by default. --- manifests/identity.pp | 28 +++++++++++++++--------- spec/classes/cloud_identity_spec.rb | 33 ++++++++++++++++++----------- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/manifests/identity.pp b/manifests/identity.pp index 9e23b345..92612326 100644 --- a/manifests/identity.pp +++ b/manifests/identity.pp @@ -350,8 +350,14 @@ # (optional) Amount of time a token should remain valid (in seconds) # Defaults to '3600' (1 hour) # +# [*trove_enabled*] +# (optional) Enable or not Trove (Database as a Service) +# Experimental feature. +# Defaults to false +# class cloud::identity ( $swift_enabled = true, + $trove_enabled = false, $identity_roles_addons = ['SwiftOperator', 'ResellerAdmin'], $keystone_db_host = '127.0.0.1', $keystone_db_user = 'keystone', @@ -623,16 +629,18 @@ class cloud::identity ( password => $ks_heat_password } - class {'trove::keystone::auth': - admin_address => $ks_trove_admin_host, - internal_address => $ks_trove_internal_host, - public_address => $ks_trove_public_host, - public_protocol => $ks_trove_public_proto, - admin_protocol => $ks_trove_admin_proto, - internal_protocol => $ks_trove_internal_proto, - port => $ks_trove_public_port, - region => $region, - password => $ks_trove_password + if $trove_enabled { + class {'trove::keystone::auth': + admin_address => $ks_trove_admin_host, + internal_address => $ks_trove_internal_host, + public_address => $ks_trove_public_host, + public_protocol => $ks_trove_public_proto, + admin_protocol => $ks_trove_admin_proto, + internal_protocol => $ks_trove_internal_proto, + port => $ks_trove_public_port, + region => $region, + password => $ks_trove_password + } } # Purge expored tokens every days at midnight diff --git a/spec/classes/cloud_identity_spec.rb b/spec/classes/cloud_identity_spec.rb index bcd164c0..a715772e 100644 --- a/spec/classes/cloud_identity_spec.rb +++ b/spec/classes/cloud_identity_spec.rb @@ -211,18 +211,8 @@ describe 'cloud::identity' do ) end - it 'configure trove endpoints' do - should contain_class('trove::keystone::auth').with( - :admin_address => '10.0.0.1', - :internal_address => '10.0.0.1', - :password => 'secrete', - :port => '8779', - :public_address => '10.0.0.1', - :public_protocol => 'https', - :admin_protocol => 'https', - :internal_protocol => 'https', - :region => 'BigCloud' - ) + it 'should not configure trove endpoint by default' do + should_not contain_class('trove::keystone::auth') end it 'configure nova endpoints' do @@ -335,6 +325,25 @@ describe 'cloud::identity' do end end + context 'with Trove' do + before :each do + params.merge!(:trove_enabled => true) + end + it 'configure trove endpoints' do + should contain_class('trove::keystone::auth').with( + :admin_address => '10.0.0.1', + :internal_address => '10.0.0.1', + :password => 'secrete', + :port => '8779', + :public_address => '10.0.0.1', + :public_protocol => 'https', + :admin_protocol => 'https', + :internal_protocol => 'https', + :region => 'BigCloud' + ) + end + end + end context 'on Debian platforms' do