diff --git a/manifests/auth_file.pp b/manifests/auth_file.pp index ab21a2f..7da0b31 100644 --- a/manifests/auth_file.pp +++ b/manifests/auth_file.pp @@ -68,6 +68,15 @@ # (optional) File path # 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( $password = undef, $auth_url = 'http://127.0.0.1:5000/v2.0/', @@ -77,6 +86,8 @@ class openstack_extras::auth_file( $tenant_name = 'openstack', $region_name = 'RegionOne', $use_no_cache = true, + $project_domain = false, + $user_domain = false, $cinder_endpoint_type = 'publicURL', $glance_endpoint_type = 'publicURL', $keystone_endpoint_type = 'publicURL', diff --git a/spec/classes/openstack_extras_auth_file_spec.rb b/spec/classes/openstack_extras_auth_file_spec.rb index 343d2fd..e7fa6ad 100644 --- a/spec/classes/openstack_extras_auth_file_spec.rb +++ b/spec/classes/openstack_extras_auth_file_spec.rb @@ -44,6 +44,8 @@ describe 'openstack_extras::auth_file' do :nova_endpoint_type => 'internalURL', :neutron_endpoint_type => 'internalURL', :auth_strategy => 'no_auth', + :user_domain => 'Default', + :project_domain => 'Default' } 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_STRATEGY=\'no_auth\'', 'export OS_REGION_NAME=\'myregion\'', + 'export OS_PROJECT_DOMAIN_NAME=\'Default\'', + 'export OS_USER_DOMAIN_NAME=\'Default\'', 'export CINDER_ENDPOINT_TYPE=\'internalURL\'', 'export GLANCE_ENDPOINT_TYPE=\'internalURL\'', 'export KEYSTONE_ENDPOINT_TYPE=\'internalURL\'', diff --git a/templates/openrc.erb b/templates/openrc.erb index 9b39f39..964a6c8 100644 --- a/templates/openrc.erb +++ b/templates/openrc.erb @@ -10,6 +10,12 @@ export OS_PASSWORD='<%= @password.gsub(/'/){ %q(\') } %>' export OS_AUTH_URL='<%= @auth_url %>' export OS_AUTH_STRATEGY='<%= @auth_strategy %>' 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 GLANCE_ENDPOINT_TYPE='<%= @glance_endpoint_type %>' export KEYSTONE_ENDPOINT_TYPE='<%= @keystone_endpoint_type %>'