From 656e08cb98303aa157c877a3532de4785db5e847 Mon Sep 17 00:00:00 2001 From: Venkata Mahesh Jonnalagadda Date: Thu, 2 Jun 2016 04:41:40 -0400 Subject: [PATCH] Add user & user_role parameters in auth manifest and related tests Add configure_user & configure_user_role parameters in auth manifest and so that users can disable if required. By default, these are set to true. And add related tests for disable user & user_role params. Change-Id: Ic45e636d2b8e6b8c2684389d1d4836900d7e8911 Closes-Bug: #1587859 --- manifests/keystone/auth.pp | 14 ++++++++++++-- spec/classes/designate_keystone_auth_spec.rb | 14 ++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index 3b7c24a2..d63cf7af 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -16,6 +16,14 @@ # [*configure_endpoint*] # Should designate endpoint be configured? Optional. Defaults to 'true'. # +# [*configure_user*] +# Should designate user be configured? +# Defaults to 'true'. +# +# [*configure_user_role*] +# Should designate user_role be configured? +# Defaults to 'true'. +# # [*service_name*] # (optional) Name of the service. # Defaults to the value of auth_name. @@ -106,6 +114,8 @@ class designate::keystone::auth ( $service_description = 'Openstack DNSaas Service', $region = 'RegionOne', $tenant = 'services', + $configure_user = true, + $configure_user_role = true, $configure_endpoint = true, $public_url = 'http://127.0.0.1:9001/v1', $admin_url = 'http://127.0.0.1:9001/v1', @@ -189,8 +199,8 @@ class designate::keystone::auth ( Service <| name == 'designate-api' |> keystone::resource::service_identity { 'designate': - configure_user => true, - configure_user_role => true, + configure_user => $configure_user, + configure_user_role => $configure_user_role, configure_endpoint => $configure_endpoint, service_name => $real_service_name, service_type => $service_type, diff --git a/spec/classes/designate_keystone_auth_spec.rb b/spec/classes/designate_keystone_auth_spec.rb index b0434823..30c1237f 100644 --- a/spec/classes/designate_keystone_auth_spec.rb +++ b/spec/classes/designate_keystone_auth_spec.rb @@ -95,6 +95,20 @@ describe 'designate::keystone::auth' do end end + describe 'when disabling user and user_role configuration' do + let :params do + { :configure_user => false, + :configure_user_role => false, + :service_name => 'designate', + :auth_name => 'designate', + :password => 'designate_password' } + end + it { is_expected.to_not contain_keystone_user('designate') } + it { is_expected.to_not contain_keystone_user_role('designate@services') } + it { is_expected.to contain_keystone_service('designate::dns') } + it { is_expected.to contain_keystone_endpoint('RegionOne/designate::dns') } + end + on_supported_os({ :supported_os => OSDefaults.get_supported_os }).each do |os,facts|