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
This commit is contained in:
Venkata Mahesh Jonnalagadda 2016-06-02 04:41:40 -04:00
parent 752e69aaae
commit 656e08cb98
2 changed files with 26 additions and 2 deletions

View File

@ -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,

View File

@ -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|