Added user_domain_name and project_domain_name for nova notifications

A few parameters missed in neutron::server::notifications and
there were configured with default params.

Change-Id: I642fec707a669a724961dd0dd900d28522b8f869
This commit is contained in:
Daniel Pawlik 2017-02-21 16:20:39 +00:00 committed by daniel.pawlik
parent 34b479d5c5
commit 00b0c01a70
2 changed files with 34 additions and 8 deletions

View File

@ -54,6 +54,10 @@
# (optional) Nova project's domain ID
# Defaults to 'default'
#
# [*project_domain_name*]
# (Optional) Name of domain for $project_name
# Defaults to 'Default'
#
# [*project_name*]
# (optional) Nova project's name
# Defaults to 'services'
@ -62,6 +66,10 @@
# (optional) User's domain ID for connection to nova in admin context
# Defaults to 'default'
#
# [*user_domain_name*]
# (Optional) Name of domain for $username
# Defaults to 'Default'
#
# [*auth_url*]
# (optional) Authorization URL for connection to nova in admin context.
# If version independent identity plugin is used available versions will be
@ -91,8 +99,10 @@ class neutron::server::notifications (
$tenant_id = $::os_service_default,
$tenant_name = 'services',
$project_domain_id = 'default',
$project_domain_name = 'Default',
$project_name = 'services',
$user_domain_id = 'default',
$user_domain_name = 'Default',
$auth_url = 'http://127.0.0.1:35357',
$region_name = $::os_service_default,
# DEPRECATED PARAMETERS
@ -109,13 +119,15 @@ class neutron::server::notifications (
}
neutron_config {
'nova/auth_url': value => $auth_url;
'nova/username': value => $username;
'nova/password': value => $password, secret => true;
'nova/project_domain_id': value => $project_domain_id;
'nova/project_name': value => $project_name;
'nova/user_domain_id': value => $user_domain_id;
'nova/region_name': value => $region_name;
'nova/auth_url': value => $auth_url;
'nova/username': value => $username;
'nova/password': value => $password, secret => true;
'nova/project_domain_id': value => $project_domain_id;
'nova/project_domain_name': value => $project_domain_name;
'nova/project_name': value => $project_name;
'nova/user_domain_id': value => $user_domain_id;
'nova/user_domain_name': value => $user_domain_name;
'nova/region_name': value => $region_name;
}
if ! is_service_default ($auth_plugin) and ($auth_plugin) {
warning('auth_plugin parameter is deprecated, auth_type should be used instead')

View File

@ -26,8 +26,10 @@ describe 'neutron::server::notifications' do
:password => 'secrete',
:tenant_name => 'services',
:project_domain_id => 'default',
:project_domain_name => 'Default',
:project_name => 'services',
:user_domain_id => 'default',
:user_domain_name => 'Default',
:auth_url => 'http://127.0.0.1:35357',
}
end
@ -51,6 +53,10 @@ describe 'neutron::server::notifications' do
is_expected.to contain_neutron_config('nova/password').with_secret( true )
is_expected.to contain_neutron_config('nova/tenant_name').with_value('services')
is_expected.to contain_neutron_config('nova/region_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('nova/project_domain_id').with_value('default')
is_expected.to contain_neutron_config('nova/project_domain_name').with_value('Default')
is_expected.to contain_neutron_config('nova/user_domain_id').with_value('default')
is_expected.to contain_neutron_config('nova/user_domain_name').with_value('Default')
is_expected.not_to contain_neutron_config('nova/auth_plugin')
end
@ -64,7 +70,11 @@ describe 'neutron::server::notifications' do
:auth_type => 'v2password',
:username => 'joe',
:region_name => 'MyRegion',
:tenant_id => 'UUID2'
:tenant_id => 'UUID2',
:project_domain_id => 'default_1',
:project_domain_name => 'Default_2',
:user_domain_id => 'default_3',
:user_domain_name => 'Default_4',
)
end
it 'should configure neutron server with overrided parameters' do
@ -78,6 +88,10 @@ describe 'neutron::server::notifications' do
is_expected.to contain_neutron_config('nova/password').with_secret( true )
is_expected.to contain_neutron_config('nova/region_name').with_value('MyRegion')
is_expected.to contain_neutron_config('nova/tenant_id').with_value('UUID2')
is_expected.to contain_neutron_config('nova/project_domain_id').with_value('default_1')
is_expected.to contain_neutron_config('nova/project_domain_name').with_value('Default_2')
is_expected.to contain_neutron_config('nova/user_domain_id').with_value('default_3')
is_expected.to contain_neutron_config('nova/user_domain_name').with_value('Default_4')
end
end