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:
parent
ffde8588fd
commit
17711d8230
|
@ -36,6 +36,7 @@ class ceilometer::api (
|
|||
$keystone_user = 'ceilometer',
|
||||
$keystone_tenant = 'services',
|
||||
$keystone_password = false,
|
||||
$keystone_auth_uri = false,
|
||||
) {
|
||||
|
||||
include ceilometer::params
|
||||
|
@ -88,4 +89,14 @@ class ceilometer::api (
|
|||
}
|
||||
}
|
||||
|
||||
if $keystone_auth_uri {
|
||||
ceilometer_config {
|
||||
'keystone_authtoken/auth_uri': value => $keystone_auth_uri;
|
||||
}
|
||||
} else {
|
||||
ceilometer_config {
|
||||
'keystone_authtoken/auth_uri': value => "${keystone_protocol}://${keystone_host}:5000/";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@ describe 'ceilometer::api' do
|
|||
should contain_ceilometer_config('keystone_authtoken/admin_user').with_value( params[:keystone_user] )
|
||||
should contain_ceilometer_config('keystone_authtoken/admin_password').with_value( params[:keystone_password] )
|
||||
should contain_ceilometer_config('keystone_authtoken/auth_admin_prefix').with_ensure('absent')
|
||||
should contain_ceilometer_config('keystone_authtoken/auth_uri').with_value( params[:keystone_protocol] + "://" + params[:keystone_host] + ":5000/" )
|
||||
end
|
||||
|
||||
context 'when specifying keystone_auth_admin_prefix' do
|
||||
|
@ -104,4 +105,19 @@ describe 'ceilometer::api' do
|
|||
|
||||
it_configures 'ceilometer-api'
|
||||
end
|
||||
|
||||
describe 'with custom auth_uri' do
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
end
|
||||
before do
|
||||
params.merge!({
|
||||
:keystone_auth_uri => 'https://foo.bar:1234/',
|
||||
})
|
||||
end
|
||||
it 'should configure custom auth_uri correctly' do
|
||||
should contain_ceilometer_config('keystone_authtoken/auth_uri').with_value( 'https://foo.bar:1234/' )
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue