]> review.fuel-infra Code Review - puppet-modules/puppet-ceilometer.git/commitdiff
Implement auth_endpoint_type parameter
authorEmilien Macchi <emilien@redhat.com>
Thu, 24 Sep 2015 13:35:59 +0000 (09:35 -0400)
committerEmilien Macchi <emilien@redhat.com>
Fri, 22 Jan 2016 16:58:01 +0000 (11:58 -0500)
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
(cherry picked from commit 22723cce88a65a44afac3065ad800b4c0008f75d)

manifests/agent/auth.pp
spec/classes/ceilometer_agent_auth_spec.rb

index 2b6f536e21cb8d29c9d1abd8a14dab30a1b7ac58..47f04026abc4575b2cebc8304272f00144499384 100644 (file)
 #  [*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   = '',
-  $auth_cacert      = undef,
+  $auth_url           = 'http://localhost:5000/v2.0',
+  $auth_region        = 'RegionOne',
+  $auth_user          = 'ceilometer',
+  $auth_tenant_name   = 'services',
+  $auth_tenant_id     = '',
+  $auth_cacert        = undef,
+  $auth_endpoint_type = undef,
 ) {
 
   if ! $auth_cacert {
@@ -59,4 +65,10 @@ class ceilometer::agent::auth (
     }
   }
 
+  if $auth_endpoint_type {
+    ceilometer_config {
+      'service_credentials/os_endpoint_type' : value => $auth_endpoint_type;
+    }
+  }
+
 }
index f72459315e8ef39465313c26701b1b53956653da..fd1908cd778c492a7e81021e20e598f9ac73c7b4 100644 (file)
@@ -30,9 +30,13 @@ describe 'ceilometer::agent::auth' do
 
     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