Add default auth_uri setting for auth token.

The latest keystoneclient code now gives a Warning if auth_uri
isn't explicitly specified.

Change-Id: I0feb52f7a9140ea750254f80b6a3e6855b25f1d3
This commit is contained in:
Dan Prince 2013-08-08 17:16:42 -04:00
parent 3d3c342bb3
commit adcb347abd
4 changed files with 22 additions and 0 deletions

View File

@ -33,6 +33,7 @@
# (where '/keystone/admin' is auth_admin_prefix)
# Defaults to false for empty. If defined, should be a string with a leading '/' and no trailing '/'.
# * auth_protocol - Protocol to use for auth. Optional. Defaults to 'http'.
# * auth_uri - Complete public Identity API endpoint.
# * keystone_tenant - tenant to authenticate to. Optioal. Defaults to admin.
# * keystone_user User to authenticate as with keystone Optional. Defaults to admin.
# * enabled Whether to enable services. Optional. Defaults to true.
@ -54,6 +55,7 @@ class glance::api(
$auth_host = '127.0.0.1',
$auth_url = 'http://localhost:5000/v2.0',
$auth_port = '35357',
$auth_uri = false,
$auth_admin_prefix = false,
$auth_protocol = 'http',
$pipeline = 'keystone+cachemanagement',
@ -133,6 +135,12 @@ class glance::api(
'DEFAULT/sql_idle_timeout': value => $sql_idle_timeout;
}
if $auth_uri {
glance_api_config { 'keystone_authtoken/auth_uri': value => $auth_uri; }
} else {
glance_api_config { 'keystone_authtoken/auth_uri': value => "${auth_protocol}://${auth_host}:5000/"; }
}
# auth config
glance_api_config {
'keystone_authtoken/auth_host': value => $auth_host;

View File

@ -50,6 +50,9 @@
# (optional) Protocol to communicate with the admin authentication endpoint.
# Defaults to 'http'. Should be 'http' or 'https'.
#
# [*auth_uri*]
# (optional) Complete public Identity API endpoint.
#
# [*keystone_tenant*]
# (optional) administrative tenant name to connect to keystone.
# Defaults to 'admin'.
@ -74,6 +77,7 @@ class glance::registry(
$auth_host = '127.0.0.1',
$auth_port = '35357',
$auth_admin_prefix = false,
$auth_uri = false,
$auth_protocol = 'http',
$keystone_tenant = 'admin',
$keystone_user = 'admin',
@ -120,6 +124,12 @@ class glance::registry(
'DEFAULT/sql_idle_timeout': value => $sql_idle_timeout;
}
if $auth_uri {
glance_registry_config { 'keystone_authtoken/auth_uri': value => $auth_uri; }
} else {
glance_registry_config { 'keystone_authtoken/auth_uri': value => "${auth_protocol}://${auth_host}:5000/"; }
}
# auth config
glance_registry_config {
'keystone_authtoken/auth_host': value => $auth_host;

View File

@ -25,6 +25,7 @@ describe 'glance::api' do
:auth_host => '127.0.0.1',
:auth_port => '35357',
:auth_protocol => 'http',
:auth_uri => 'http://127.0.0.1:5000/',
:keystone_tenant => 'admin',
:keystone_user => 'admin',
:keystone_password => 'ChangeMe',
@ -49,6 +50,7 @@ describe 'glance::api' do
:auth_host => '127.0.0.2',
:auth_port => '35358',
:auth_protocol => 'https',
:auth_uri => 'https://127.0.0.2:5000/v2.0/',
:keystone_tenant => 'admin2',
:keystone_user => 'admin2',
:keystone_password => 'ChangeMe2',

View File

@ -21,6 +21,7 @@ describe 'glance::registry' do
:auth_host => '127.0.0.1',
:auth_port => '35357',
:auth_protocol => 'http',
:auth_uri => 'http://127.0.0.1:5000/',
:keystone_tenant => 'admin',
:keystone_user => 'admin',
:keystone_password => 'ChangeMe',
@ -42,6 +43,7 @@ describe 'glance::registry' do
:auth_host => '127.0.0.1',
:auth_port => '35357',
:auth_protocol => 'http',
:auth_uri => 'http://127.0.0.1:5000/',
:keystone_tenant => 'admin',
:keystone_user => 'admin',
:keystone_password => 'ChangeMe',