diff --git a/manifests/keystone/domain.pp b/manifests/keystone/domain.pp index b0c44d10..9217c746 100644 --- a/manifests/keystone/domain.pp +++ b/manifests/keystone/domain.pp @@ -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; + } } } diff --git a/releasenotes/notes/heat-domain-user-config-d1396bc6e3f17a2a.yaml b/releasenotes/notes/heat-domain-user-config-d1396bc6e3f17a2a.yaml new file mode 100644 index 00000000..d673bca2 --- /dev/null +++ b/releasenotes/notes/heat-domain-user-config-d1396bc6e3f17a2a.yaml @@ -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. diff --git a/spec/classes/heat_keystone_domain_spec.rb b/spec/classes/heat_keystone_domain_spec.rb index c5e20658..5fdba0eb 100644 --- a/spec/classes/heat_keystone_domain_spec.rb +++ b/spec/classes/heat_keystone_domain_spec.rb @@ -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