Use domain_name instead of domain_id
... because domain name is more predictable than domain id. Also, we generally use domain_name instead of domain_id in other puppet modules, so it's more consistent to use domain_name. Change-Id: Ibd38fcfd9cec7f266d35fd9851a8a744b497d32a
This commit is contained in:
parent
657750b907
commit
f9e8066d34
@ -20,13 +20,13 @@
|
|||||||
# (Optional) The keystone tenant name for vitrage services
|
# (Optional) The keystone tenant name for vitrage services
|
||||||
# Defaults to 'services'
|
# Defaults to 'services'
|
||||||
#
|
#
|
||||||
# [*project_domain_id*]
|
# [*project_domain_name*]
|
||||||
# (Optional) The keystone project domain id for vitrage services
|
# (Optional) The keystone project domain name for vitrage services
|
||||||
# Defaults to 'default'
|
# Defaults to 'Default'
|
||||||
#
|
#
|
||||||
# [*user_domain_id*]
|
# [*user_domain_name*]
|
||||||
# (Optional) The keystone user domain id for vitrage services
|
# (Optional) The keystone user domain id name vitrage services
|
||||||
# Defaults to 'default'
|
# Defaults to 'Default'
|
||||||
#
|
#
|
||||||
# [*auth_type*]
|
# [*auth_type*]
|
||||||
# (Optional) An authentication type to use with an OpenStack Identity server.
|
# (Optional) An authentication type to use with an OpenStack Identity server.
|
||||||
@ -57,21 +57,31 @@
|
|||||||
# (Optional) The keystone tenant id for vitrage services.
|
# (Optional) The keystone tenant id for vitrage services.
|
||||||
# Defaults to undef..
|
# Defaults to undef..
|
||||||
#
|
#
|
||||||
|
# [*project_domain_id*]
|
||||||
|
# (Optional) The keystone project domain id for vitrage services
|
||||||
|
# Defaults to 'default'
|
||||||
|
#
|
||||||
|
# [*user_domain_id*]
|
||||||
|
# (Optional) The keystone user domain id for vitrage services
|
||||||
|
# Defaults to 'default'
|
||||||
|
#
|
||||||
class vitrage::auth (
|
class vitrage::auth (
|
||||||
$auth_password,
|
$auth_password,
|
||||||
$auth_url = 'http://localhost:5000/v3',
|
$auth_url = 'http://localhost:5000/v3',
|
||||||
$auth_region = 'RegionOne',
|
$auth_region = 'RegionOne',
|
||||||
$auth_user = 'vitrage',
|
$auth_user = 'vitrage',
|
||||||
$auth_project_name = 'services',
|
$auth_project_name = 'services',
|
||||||
$project_domain_id = 'default',
|
$project_domain_name = 'Default',
|
||||||
$user_domain_id = 'default',
|
$user_domain_name = 'Default',
|
||||||
$auth_type = 'password',
|
$auth_type = 'password',
|
||||||
$auth_cacert = $::os_service_default,
|
$auth_cacert = $::os_service_default,
|
||||||
$interface = $::os_service_default,
|
$interface = $::os_service_default,
|
||||||
# DEPRECATED PARAMETERS
|
# DEPRECATED PARAMETERS
|
||||||
$auth_endpoint_type = undef,
|
$auth_endpoint_type = undef,
|
||||||
$auth_tenant_name = undef,
|
$auth_tenant_name = undef,
|
||||||
$auth_tenant_id = undef,
|
$auth_tenant_id = undef,
|
||||||
|
$project_domain_id = undef,
|
||||||
|
$user_domain_id = undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include vitrage::deps
|
include vitrage::deps
|
||||||
@ -104,9 +114,31 @@ Use auth_project_name instead')
|
|||||||
'service_credentials/project_name' : value => $auth_project_name_real;
|
'service_credentials/project_name' : value => $auth_project_name_real;
|
||||||
'service_credentials/cacert' : value => $auth_cacert;
|
'service_credentials/cacert' : value => $auth_cacert;
|
||||||
'service_credentials/interface' : value => $interface_real;
|
'service_credentials/interface' : value => $interface_real;
|
||||||
'service_credentials/project_domain_id' : value => $project_domain_id;
|
|
||||||
'service_credentials/user_domain_id' : value => $user_domain_id;
|
|
||||||
'service_credentials/auth_type' : value => $auth_type;
|
'service_credentials/auth_type' : value => $auth_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $project_domain_id != undef {
|
||||||
|
warning('vitrage::auth::project_domain_id is deprecated and will be removed \
|
||||||
|
in a future release. Use project_domain_name instead.')
|
||||||
|
vitrage_config{
|
||||||
|
'service_credentials/project_domain_id' : value => $project_domain_id;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vitrage_config{
|
||||||
|
'service_credentials/project_domain_name' : value => $project_domain_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if $user_domain_id != undef {
|
||||||
|
warning('vitrage::auth::user_domain_id is deprecated and will be removed \
|
||||||
|
in a future release. Use user_domain_name instead.')
|
||||||
|
vitrage_config{
|
||||||
|
'service_credentials/user_domain_id' : value => $user_domain_id;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vitrage_config{
|
||||||
|
'service_credentials/user_domain_name' : value => $user_domain_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- |
|
||||||
|
``user_domain_id`` and ``project_domain_id`` in ``vitrage::auth`` class
|
||||||
|
were deprecated and will be removed in a future release. Use
|
||||||
|
``user_domain_name`` and ``project_domain_name`` instead.
|
@ -16,8 +16,8 @@ describe 'vitrage::auth' do
|
|||||||
it 'configures authentication' do
|
it 'configures authentication' do
|
||||||
is_expected.to contain_vitrage_config('service_credentials/auth_url').with_value('http://localhost:5000/v3')
|
is_expected.to contain_vitrage_config('service_credentials/auth_url').with_value('http://localhost:5000/v3')
|
||||||
is_expected.to contain_vitrage_config('service_credentials/region_name').with_value('RegionOne')
|
is_expected.to contain_vitrage_config('service_credentials/region_name').with_value('RegionOne')
|
||||||
is_expected.to contain_vitrage_config('service_credentials/project_domain_id').with_value('default')
|
is_expected.to contain_vitrage_config('service_credentials/project_domain_name').with_value('Default')
|
||||||
is_expected.to contain_vitrage_config('service_credentials/user_domain_id').with_value('default')
|
is_expected.to contain_vitrage_config('service_credentials/user_domain_name').with_value('Default')
|
||||||
is_expected.to contain_vitrage_config('service_credentials/auth_type').with_value('password')
|
is_expected.to contain_vitrage_config('service_credentials/auth_type').with_value('password')
|
||||||
is_expected.to contain_vitrage_config('service_credentials/username').with_value('vitrage')
|
is_expected.to contain_vitrage_config('service_credentials/username').with_value('vitrage')
|
||||||
is_expected.to contain_vitrage_config('service_credentials/password').with_value('password').with_secret(true)
|
is_expected.to contain_vitrage_config('service_credentials/password').with_value('password').with_secret(true)
|
||||||
@ -25,6 +25,22 @@ describe 'vitrage::auth' do
|
|||||||
is_expected.to contain_vitrage_config('service_credentials/cacert').with(:value => '<SERVICE DEFAULT>')
|
is_expected.to contain_vitrage_config('service_credentials/cacert').with(:value => '<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when deprecated domain_id is set' do
|
||||||
|
before do
|
||||||
|
params.merge!(
|
||||||
|
:user_domain_id => 'default',
|
||||||
|
:project_domain_id => 'default',
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'configures domain_id instead of domain_name' do
|
||||||
|
is_expected.to_not contain_vitrage_config('service_credentials/project_domain_name')
|
||||||
|
is_expected.to contain_vitrage_config('service_credentials/project_domain_id').with_value('default')
|
||||||
|
is_expected.to_not contain_vitrage_config('service_credentials/user_domain_name')
|
||||||
|
is_expected.to contain_vitrage_config('service_credentials/user_domain_id').with_value('default')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'when overriding parameters' do
|
context 'when overriding parameters' do
|
||||||
before do
|
before do
|
||||||
params.merge!(
|
params.merge!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user