Add region_name for service_auth

Add region_name for service_auth configuration, so that we can specify
the keystone region where octavia user is created.

Change-Id: I4fc556fad4f5051a7a0272f1cb2001afa6d0b05e
This commit is contained in:
Takashi Kajinami 2020-02-15 20:58:57 +09:00
parent e5a5219dd9
commit 43ab03de72
3 changed files with 14 additions and 1 deletions

View File

@ -31,7 +31,10 @@
# (optional) keystone authentication type
# Defaults to $::os_service_default
#
# [*region_name*]
# (Optional) The region in which the identity server can be found.
# Defaults to $::os_service_default.
#
class octavia::service_auth (
$auth_url = $::os_service_default,
$username = $::os_service_default,
@ -40,6 +43,7 @@ class octavia::service_auth (
$user_domain_name = $::os_service_default,
$project_domain_name = $::os_service_default,
$auth_type = $::os_service_default,
$region_name = $::os_service_default,
) {
include octavia::deps
@ -52,5 +56,6 @@ class octavia::service_auth (
'service_auth/user_domain_name' : value => $user_domain_name;
'service_auth/project_domain_name' : value => $project_domain_name;
'service_auth/auth_type' : value => $auth_type;
'service_auth/region_name' : value => $region_name;
}
}

View File

@ -0,0 +1,5 @@
---
features:
- |
The new octavia::service_auth::region_name parameter was added to specify
keystone region where we expect service auth indentity is created

View File

@ -12,6 +12,7 @@ describe 'octavia::service_auth' do
is_expected.to contain_octavia_config('service_auth/user_domain_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('service_auth/project_domain_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('service_auth/auth_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('service_auth/region_name').with_value('<SERVICE DEFAULT>')
end
end
@ -24,6 +25,7 @@ describe 'octavia::service_auth' do
:user_domain_name => 'my_domain_name',
:project_domain_name => 'our_domain_name',
:auth_type => 'password',
:region_name => 'region2',
}
end
@ -35,6 +37,7 @@ describe 'octavia::service_auth' do
is_expected.to contain_octavia_config('service_auth/user_domain_name').with_value('my_domain_name')
is_expected.to contain_octavia_config('service_auth/project_domain_name').with_value('our_domain_name')
is_expected.to contain_octavia_config('service_auth/auth_type').with_value('password')
is_expected.to contain_octavia_config('service_auth/region_name').with_value('region2')
end
end
end