Set OS_INTERFACE and OS_ENDPOINT_TYPE in auth file

OSC does not use service-specific environment variables for choosing
endpoints. It requires a common OS_INTERFACE variable that is used for
--os-interface.
OS_ENDPOINT_TYPE is the analog for older service-specific clients and is
used for --os-endpoint-type.

Change-Id: I5dd8de00e72631d578cf7e0b7028705a5cda1ddb
This commit is contained in:
Matthias Bastian 2018-02-01 18:47:48 +01:00
parent 8c29d64f5f
commit 80cf00dffe
3 changed files with 18 additions and 0 deletions

View File

@ -45,6 +45,14 @@
# (optional) Do not use the auth token cache.
# Defaults to true.
#
# [*os_interface*]
# (optional) The common endpoint to use with OSC
# Defaults to 'public'.
#
# [*os_endpoint_type*]
# (optional) The common endpoint to use with service-specific clients
# Defaults to 'publicURL'.
#
# [*cinder_endpoint_type*]
# (optional) The Cinder endpoint to use
# Defaults to 'publicURL'.
@ -103,6 +111,8 @@ class openstack_extras::auth_file(
$project_domain = 'default',
$user_domain = 'default',
$auth_type = undef,
$os_interface = 'public',
$os_endpoint_type = 'publicURL',
$cinder_endpoint_type = 'publicURL',
$glance_endpoint_type = 'publicURL',
$keystone_endpoint_type = 'publicURL',

View File

@ -19,6 +19,8 @@ describe 'openstack_extras::auth_file' do
'export OS_REGION_NAME=\'RegionOne\'',
'export OS_PROJECT_DOMAIN_NAME=\'default\'',
'export OS_USER_DOMAIN_NAME=\'default\'',
'export OS_INTERFACE=\'public\'',
'export OS_ENDPOINT_TYPE=\'publicURL\'',
'export CINDER_ENDPOINT_TYPE=\'publicURL\'',
'export GLANCE_ENDPOINT_TYPE=\'publicURL\'',
'export KEYSTONE_ENDPOINT_TYPE=\'publicURL\'',
@ -42,6 +44,8 @@ describe 'openstack_extras::auth_file' do
:project_name => 'myproject',
:region_name => 'myregion',
:use_no_cache => 'false',
:os_interface => 'internal',
:os_endpoint_type => 'internalURL',
:cinder_endpoint_type => 'internalURL',
:glance_endpoint_type => 'internalURL',
:keystone_endpoint_type => 'internalURL',
@ -68,6 +72,8 @@ describe 'openstack_extras::auth_file' do
'export OS_REGION_NAME=\'myregion\'',
'export OS_PROJECT_DOMAIN_NAME=\'anotherdomain\'',
'export OS_USER_DOMAIN_NAME=\'anotherdomain\'',
'export OS_INTERFACE=\'internal\'',
'export OS_ENDPOINT_TYPE=\'internalURL\'',
'export CINDER_ENDPOINT_TYPE=\'internalURL\'',
'export GLANCE_ENDPOINT_TYPE=\'internalURL\'',
'export KEYSTONE_ENDPOINT_TYPE=\'internalURL\'',

View File

@ -24,6 +24,8 @@ export OS_USER_DOMAIN_NAME='<%= @user_domain %>'
<% if @auth_type -%>
export OS_AUTH_TYPE='<%= @auth_type %>'
<% end -%>
export OS_INTERFACE='<%= @os_interface %>'
export OS_ENDPOINT_TYPE='<%= @os_endpoint_type %>'
export CINDER_ENDPOINT_TYPE='<%= @cinder_endpoint_type %>'
export GLANCE_ENDPOINT_TYPE='<%= @glance_endpoint_type %>'
export KEYSTONE_ENDPOINT_TYPE='<%= @keystone_endpoint_type %>'