From b961bb112215e6a38086fde604a61adbc15d66dd Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 11 Feb 2014 09:47:34 +0100 Subject: [PATCH] identity: ability to disable swift Close bug #178 Signed-off-by: Emilien Macchi --- manifests/identity.pp | 27 +++++++++++++++------------ spec/classes/cloud_identity_spec.rb | 11 +++++++++++ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/manifests/identity.pp b/manifests/identity.pp index fcce82ee..a73eb482 100644 --- a/manifests/identity.pp +++ b/manifests/identity.pp @@ -324,6 +324,7 @@ # Defaults value in params # class cloud::identity ( + $swift_enabled = $os_params::swift, $identity_roles_addons = $os_params::identity_roles_addons, $keystone_db_host = $os_params::keystone_db_host, $keystone_db_user = $os_params::keystone_db_user, @@ -454,19 +455,21 @@ class cloud::identity ( # ssl => false # } - class {'swift::keystone::auth': - address => $ks_swift_internal_host, - password => $ks_swift_password, - public_address => $ks_swift_public_host, - public_port => $ks_swift_public_port, - public_protocol => $ks_swift_public_proto, - admin_address => $ks_swift_admin_host, - internal_address => $ks_swift_internal_host, - region => $region - } + if $swift_enabled { + class {'swift::keystone::auth': + address => $ks_swift_internal_host, + password => $ks_swift_password, + public_address => $ks_swift_public_host, + public_port => $ks_swift_public_port, + public_protocol => $ks_swift_public_proto, + admin_address => $ks_swift_admin_host, + internal_address => $ks_swift_internal_host, + region => $region + } - class {'swift::keystone::dispersion': - auth_pass => $ks_swift_dispersion_password + class {'swift::keystone::dispersion': + auth_pass => $ks_swift_dispersion_password + } } class {'ceilometer::keystone::auth': diff --git a/spec/classes/cloud_identity_spec.rb b/spec/classes/cloud_identity_spec.rb index 2cc42c8a..870b3696 100644 --- a/spec/classes/cloud_identity_spec.rb +++ b/spec/classes/cloud_identity_spec.rb @@ -24,6 +24,7 @@ describe 'cloud::identity' do let :params do { :identity_roles_addons => ['SwiftOperator', 'ResellerAdmin'], + :swift_enabled => true, :keystone_db_host => '10.0.0.1', :keystone_db_user => 'keystone', :keystone_db_password => 'secrete', @@ -253,6 +254,16 @@ describe 'cloud::identity' do ) end + context 'without Swift' do + before :each do + params.merge!(:swift_enabled => false) + end + it 'should not configure swift endpoints and users' do + should_not contain_class('swift::keystone::auth') + should_not contain_class('swift::keystone::dispersion') + end + end + end context 'on Debian platforms' do