Added v3 domain env variables
The current authfile class does not currently specify domains and if someone is using v3 api, it will fail with messages about a domain not being specified. This change exposes two new parameters to specify domain for project and user that are both defaulted to false. When they're specified they will add two env vars in openrc. Change-Id: I4ed3d440e2171e0220e307363e1b7595127dadc7 Closes-Bug: 1534901
This commit is contained in:
parent
950a90ab7a
commit
364abe6647
|
@ -68,6 +68,15 @@
|
||||||
# (optional) File path
|
# (optional) File path
|
||||||
# Defaults to '/root/openrc'.
|
# Defaults to '/root/openrc'.
|
||||||
#
|
#
|
||||||
|
# [*project_domain*]
|
||||||
|
# (optional) Project domain in v3 api.
|
||||||
|
# Defaults to false
|
||||||
|
#
|
||||||
|
# [*user_domain*]
|
||||||
|
# (optional) User domain in v3 api.
|
||||||
|
# Defaults to false
|
||||||
|
#
|
||||||
|
|
||||||
class openstack_extras::auth_file(
|
class openstack_extras::auth_file(
|
||||||
$password = undef,
|
$password = undef,
|
||||||
$auth_url = 'http://127.0.0.1:5000/v2.0/',
|
$auth_url = 'http://127.0.0.1:5000/v2.0/',
|
||||||
|
@ -77,6 +86,8 @@ class openstack_extras::auth_file(
|
||||||
$tenant_name = 'openstack',
|
$tenant_name = 'openstack',
|
||||||
$region_name = 'RegionOne',
|
$region_name = 'RegionOne',
|
||||||
$use_no_cache = true,
|
$use_no_cache = true,
|
||||||
|
$project_domain = false,
|
||||||
|
$user_domain = false,
|
||||||
$cinder_endpoint_type = 'publicURL',
|
$cinder_endpoint_type = 'publicURL',
|
||||||
$glance_endpoint_type = 'publicURL',
|
$glance_endpoint_type = 'publicURL',
|
||||||
$keystone_endpoint_type = 'publicURL',
|
$keystone_endpoint_type = 'publicURL',
|
||||||
|
|
|
@ -44,6 +44,8 @@ describe 'openstack_extras::auth_file' do
|
||||||
:nova_endpoint_type => 'internalURL',
|
:nova_endpoint_type => 'internalURL',
|
||||||
:neutron_endpoint_type => 'internalURL',
|
:neutron_endpoint_type => 'internalURL',
|
||||||
:auth_strategy => 'no_auth',
|
:auth_strategy => 'no_auth',
|
||||||
|
:user_domain => 'Default',
|
||||||
|
:project_domain => 'Default'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -58,6 +60,8 @@ describe 'openstack_extras::auth_file' do
|
||||||
'export OS_AUTH_URL=\'http://127.0.0.2:5000/v2.0/\'',
|
'export OS_AUTH_URL=\'http://127.0.0.2:5000/v2.0/\'',
|
||||||
'export OS_AUTH_STRATEGY=\'no_auth\'',
|
'export OS_AUTH_STRATEGY=\'no_auth\'',
|
||||||
'export OS_REGION_NAME=\'myregion\'',
|
'export OS_REGION_NAME=\'myregion\'',
|
||||||
|
'export OS_PROJECT_DOMAIN_NAME=\'Default\'',
|
||||||
|
'export OS_USER_DOMAIN_NAME=\'Default\'',
|
||||||
'export CINDER_ENDPOINT_TYPE=\'internalURL\'',
|
'export CINDER_ENDPOINT_TYPE=\'internalURL\'',
|
||||||
'export GLANCE_ENDPOINT_TYPE=\'internalURL\'',
|
'export GLANCE_ENDPOINT_TYPE=\'internalURL\'',
|
||||||
'export KEYSTONE_ENDPOINT_TYPE=\'internalURL\'',
|
'export KEYSTONE_ENDPOINT_TYPE=\'internalURL\'',
|
||||||
|
|
|
@ -10,6 +10,12 @@ export OS_PASSWORD='<%= @password.gsub(/'/){ %q(\') } %>'
|
||||||
export OS_AUTH_URL='<%= @auth_url %>'
|
export OS_AUTH_URL='<%= @auth_url %>'
|
||||||
export OS_AUTH_STRATEGY='<%= @auth_strategy %>'
|
export OS_AUTH_STRATEGY='<%= @auth_strategy %>'
|
||||||
export OS_REGION_NAME='<%= @region_name %>'
|
export OS_REGION_NAME='<%= @region_name %>'
|
||||||
|
<% if @project_domain -%>
|
||||||
|
export OS_PROJECT_DOMAIN_NAME='<%= @project_domain %>'
|
||||||
|
<% end -%>
|
||||||
|
<% if @user_domain -%>
|
||||||
|
export OS_USER_DOMAIN_NAME='<%= @user_domain %>'
|
||||||
|
<% end -%>
|
||||||
export CINDER_ENDPOINT_TYPE='<%= @cinder_endpoint_type %>'
|
export CINDER_ENDPOINT_TYPE='<%= @cinder_endpoint_type %>'
|
||||||
export GLANCE_ENDPOINT_TYPE='<%= @glance_endpoint_type %>'
|
export GLANCE_ENDPOINT_TYPE='<%= @glance_endpoint_type %>'
|
||||||
export KEYSTONE_ENDPOINT_TYPE='<%= @keystone_endpoint_type %>'
|
export KEYSTONE_ENDPOINT_TYPE='<%= @keystone_endpoint_type %>'
|
||||||
|
|
Loading…
Reference in New Issue