Make endpoint configuration in glance::keystone::auth optional in case not using templated catalog file for defining endpoints. (keystone_endpoint type seems to assume always using SQL driver.)

This commit is contained in:
John Chilton 2012-05-03 16:19:32 -05:00
parent 232c66be29
commit f1df5e64d1
2 changed files with 30 additions and 16 deletions

View File

@ -15,14 +15,15 @@
# $region :: Region where endpoint is set.
#
class glance::keystone::auth(
$auth_name = 'glance',
$password = 'glance_password',
$service_type = 'image',
$public_address = '127.0.0.1',
$admin_address = '127.0.0.1',
$internal_address = '127.0.0.1',
$port = '9292',
$region = 'RegionOne'
$auth_name = 'glance',
$password = 'glance_password',
$configure_endpoint = 'true',
$service_type = 'image',
$public_address = '127.0.0.1',
$admin_address = '127.0.0.1',
$internal_address = '127.0.0.1',
$port = '9292',
$region = 'RegionOne'
) {
Keystone_user_role["${auth_name}@services"] ~> Service <| name == 'glance-registry' |>
@ -40,13 +41,14 @@ class glance::keystone::auth(
ensure => present,
type => $service_type,
description => "Openstack Image Service",
}
keystone_endpoint { $auth_name:
ensure => present,
region => $region,
public_url => "http://${public_address}:${port}/v1",
admin_url => "http://${admin_address}:${port}/v1",
internal_url => "http://${internal_address}:${port}/v1",
}
if $configure_endpoint {
keystone_endpoint { $auth_name:
ensure => present,
region => $region,
public_url => "http://${public_address}:${port}/v1",
admin_url => "http://${admin_address}:${port}/v1",
internal_url => "http://${internal_address}:${port}/v1",
}
}
}

View File

@ -80,4 +80,16 @@ describe 'glance::keystone::auth' do
end
describe 'when endpoint is not set' do
let :params do
{
:configure_endpoint => false,
}
end
it { should_not contain_keystone_endpoint('glance') }
end
end