Ability to manage domain config seperately

This change allows a user of the heat::keystone::domain class to manage
the user creation seperately from the user configuration for the heat
services.

Previously one could disable the management of the users but could not
prevent the configuration file from being updated if all they wanted to
do was create the users.

Change-Id: Iab8204d3dfd727149d41ad86616a8f95a6f720dc
This commit is contained in:
Alex Schultz 2016-11-01 13:55:58 -06:00
parent eecda65a11
commit 08488e3686
3 changed files with 31 additions and 4 deletions

View File

@ -30,6 +30,10 @@
# Whether manage or not the user role creation.
# Defaults to 'true'.
#
# [*manage_config*]
# Should the stack configuration be updated with the user information
# Defaults to 'true'
#
class heat::keystone::domain (
$domain_name = 'heat',
$domain_admin = 'heat_admin',
@ -38,6 +42,7 @@ class heat::keystone::domain (
$manage_domain = true,
$manage_user = true,
$manage_role = true,
$manage_config = true,
) {
include ::heat::deps
@ -63,9 +68,11 @@ class heat::keystone::domain (
})
}
heat_config {
'DEFAULT/stack_domain_admin': value => $domain_admin;
'DEFAULT/stack_domain_admin_password': value => $domain_password, secret => true;
'DEFAULT/stack_user_domain_name': value => $domain_name;
if $manage_config {
heat_config {
'DEFAULT/stack_domain_admin': value => $domain_admin;
'DEFAULT/stack_domain_admin_password': value => $domain_password, secret => true;
'DEFAULT/stack_user_domain_name': value => $domain_name;
}
}
}

View File

@ -0,0 +1,5 @@
---
other:
- Management of heat configuration is now optional for
heat::keystone::domain which allows you to manage the
users and domain seperately from the service configuration.

View File

@ -65,6 +65,21 @@ describe 'heat::keystone::domain' do
it { is_expected.to_not contain_keystone_user_role("#{params[:domain_admin]}::#{params[:domain_name]}@::#{params[:domain_name]}") }
end
context 'when not managing the config' do
before do
params.merge!(
:manage_config => false
)
end
it 'does not write out the heat admin user configuration settings' do
is_expected.to_not contain_heat_config('DEFAULT/stack_domain_admin')
is_expected.to_not contain_heat_config('DEFAULT/stack_domain_admin_password')
is_expected.to_not contain_heat_config('DEFAULT/stack_user_domain_name')
end
end
end