Skip to content

Commit

Permalink
Implement auth_endpoint_type parameter
Browse files Browse the repository at this point in the history
Add auth_endpoint_type which is the type of endpoint in Identity service
catalog to use for communication with OpenStack services. Default to
undef.

Change-Id: Ia62186b3a4520e1f323a4fa96d8a925874b3604a
  • Loading branch information
EmilienM committed Sep 24, 2015
1 parent 31879ee commit 22723cc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
24 changes: 18 additions & 6 deletions manifests/agent/auth.pp
Expand Up @@ -29,14 +29,20 @@
# [*auth_cacert*]
# Certificate chain for SSL validation. Optional; Defaults to 'None'
#
# [*auth_endpoint_type*]
# Type of endpoint in Identity service catalog to use for
# communication with OpenStack services.
# Optional. Defaults to undef.
#
class ceilometer::agent::auth (
$auth_password,
$auth_url = 'http://localhost:5000/v2.0',
$auth_region = 'RegionOne',
$auth_user = 'ceilometer',
$auth_tenant_name = 'services',
$auth_tenant_id = undef,
$auth_cacert = undef,
$auth_url = 'http://localhost:5000/v2.0',
$auth_region = 'RegionOne',
$auth_user = 'ceilometer',
$auth_tenant_name = 'services',
$auth_tenant_id = undef,
$auth_cacert = undef,
$auth_endpoint_type = undef,
) {

if ! $auth_cacert {
Expand All @@ -59,4 +65,10 @@
}
}

if $auth_endpoint_type {
ceilometer_config {
'service_credentials/os_endpoint_type' : value => $auth_endpoint_type;
}
}

}
6 changes: 5 additions & 1 deletion spec/classes/ceilometer_agent_auth_spec.rb
Expand Up @@ -29,9 +29,13 @@

context 'when overriding parameters' do
before do
params.merge!(:auth_cacert => '/tmp/dummy.pem')
params.merge!(
:auth_cacert => '/tmp/dummy.pem',
:auth_endpoint_type => 'internalURL',
)
end
it { is_expected.to contain_ceilometer_config('service_credentials/os_cacert').with_value(params[:auth_cacert]) }
it { is_expected.to contain_ceilometer_config('service_credentials/os_endpoint_type').with_value(params[:auth_endpoint_type]) }
end

end
Expand Down

0 comments on commit 22723cc

Please sign in to comment.