Browse Source

Change os_auth_url to use identity_endpoint in conf template

Current template ceilometer.conf.erb is using auth_uri for os_auth_url
which is not a correct approach. This auth_uri is dedicated to be used
by auth_uri under section [keystone_authtoken]. On the other hand, the
passed in identity_endpoint param is not used. Actually, by comparison
with other cookbooks, identity_endpoint should be used for keystone
identity service connection.

Change-Id: I50c631000efe9c82cd83723c1bf9a7c6ef54556c
Closes-bug: #1479399
tags/kilo-eol
Yi Ming Yin 4 years ago
parent
commit
76ba93e362
2 changed files with 18 additions and 1 deletions
  1. 17
    0
      spec/common_spec.rb
  2. 1
    1
      templates/default/ceilometer.conf.erb

+ 17
- 0
spec/common_spec.rb View File

@@ -345,6 +345,23 @@ describe 'openstack-telemetry::common' do
345 345
         end
346 346
       end
347 347
 
348
+      context 'set correct os_auth_url' do
349
+        it 'set default value for os_auth_url' do
350
+          node.set['openstack']['telemetry']['api']['auth']['version'] = 'v3.0'
351
+          expect(chef_run).to render_config_file(file.name)\
352
+            .with_section_content('DEFAULT', %r{^os_auth_url = http://127.0.0.1:5000/v2.0$})
353
+        end
354
+
355
+        it 'set customized os_auth_url' do
356
+          node.set['openstack']['endpoints']['identity-internal']['scheme'] = 'https'
357
+          node.set['openstack']['endpoints']['identity-internal']['host'] = 'fakehost'
358
+          node.set['openstack']['endpoints']['identity-internal']['port'] = '8888'
359
+          node.set['openstack']['endpoints']['identity-internal']['path'] = '/v3'
360
+          expect(chef_run).to render_config_file(file.name)\
361
+            .with_section_content('DEFAULT', %r{^os_auth_url = https://fakehost:8888/v3$})
362
+        end
363
+      end
364
+
348 365
       it 'has metering secret' do
349 366
         r = /^metering_secret = metering_secret$/
350 367
         expect(chef_run).to render_file(file.name).with_content(r)

+ 1
- 1
templates/default/ceilometer.conf.erb View File

@@ -1,5 +1,5 @@
1 1
 [DEFAULT]
2
-os_auth_url = <%= @auth_uri %>
2
+os_auth_url = <%= @identity_endpoint %>
3 3
 os_tenant_name = <%= @service_tenant_name %>
4 4
 os_password = <%= @service_pass %>
5 5
 os_username = <%= @service_user %>

Loading…
Cancel
Save