Use the library method auth_uri_transform.
Change-Id: Id4f1cf95aaa96164c7eeae40550dac8857b31800 Imlements: blueprint move-keystone-authtoken-move-auth-uri-logic
This commit is contained in:
parent
79a2fa60a0
commit
eb15ff73a5
|
@ -2,6 +2,10 @@ openstack-telemetry Cookbook CHANGELG
|
|||
==============================
|
||||
This file is used to list changes made in each version of the openstack-metering cookbook.
|
||||
|
||||
## 8.4.0
|
||||
### Blue print
|
||||
# Use the library method auth_uri_transform
|
||||
|
||||
## 8.3.0
|
||||
* Rename openstack-metering to openstack-telemetry
|
||||
|
||||
|
|
|
@ -47,6 +47,8 @@ identity_registration
|
|||
Attributes
|
||||
==========
|
||||
|
||||
* `openstack['telemetry']['api']['auth']['version']` - Select v2.0 or v3.0. Default v2.0. The auth API version used to interact with identity service.
|
||||
|
||||
Testing
|
||||
=====
|
||||
|
||||
|
|
|
@ -32,6 +32,8 @@ default['openstack']['telemetry']['debug'] = 'false'
|
|||
|
||||
default['openstack']['telemetry']['api']['auth']['cache_dir'] = '/var/cache/ceilometer/api'
|
||||
|
||||
default['openstack']['telemetry']['api']['auth']['version'] = node['openstack']['api']['auth']['version']
|
||||
|
||||
default['openstack']['telemetry']['user'] = 'ceilometer'
|
||||
default['openstack']['telemetry']['group'] = 'ceilometer'
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ maintainer_email 'cookbooks@lists.tfoundry.com'
|
|||
license 'Apache 2.0'
|
||||
description 'The OpenStack Metering service Ceilometer.'
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version '8.3.0'
|
||||
version '8.4.0'
|
||||
|
||||
recipe 'openstack-telemetry::agent-central', 'Installs agent central service.'
|
||||
recipe 'openstack-telemetry::agent-compute', 'Installs agent compute service.'
|
||||
|
|
|
@ -53,6 +53,8 @@ identity_endpoint = endpoint 'identity-api'
|
|||
identity_admin_endpoint = endpoint 'identity-admin'
|
||||
image_endpoint = endpoint 'image-api'
|
||||
|
||||
auth_uri = auth_uri_transform identity_endpoint.to_s, node['openstack']['telemetry']['api']['auth']['version']
|
||||
|
||||
Chef::Log.debug("openstack-telemetry::common:service_user|#{service_user}")
|
||||
Chef::Log.debug("openstack-telemetry::common:service_tenant|#{service_tenant}")
|
||||
Chef::Log.debug("openstack-telemetry::common:identity_endpoint|#{identity_endpoint.to_s}")
|
||||
|
@ -72,7 +74,7 @@ template node['openstack']['telemetry']['conf'] do
|
|||
mode 00640
|
||||
|
||||
variables(
|
||||
auth_uri: ::URI.decode(identity_endpoint.to_s),
|
||||
auth_uri: auth_uri,
|
||||
database_connection: db_uri,
|
||||
image_endpoint: image_endpoint,
|
||||
identity_endpoint: identity_endpoint,
|
||||
|
|
|
@ -86,6 +86,53 @@ describe 'openstack-telemetry::common' do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'has keystone authtoken configuration' do
|
||||
it 'has auth_uri' do
|
||||
expect(@chef_run).to render_file(@filename).with_content(
|
||||
/^#{Regexp.quote('auth_uri = http://127.0.0.1:5000/v2.0')}$/)
|
||||
end
|
||||
|
||||
it 'has auth_host' do
|
||||
expect(@chef_run).to render_file(@filename).with_content(
|
||||
/^#{Regexp.quote('auth_host = 127.0.0.1')}$/)
|
||||
end
|
||||
|
||||
it 'has auth_port' do
|
||||
expect(@chef_run).to render_file(@filename).with_content(
|
||||
/^auth_port = 35357$/)
|
||||
end
|
||||
|
||||
it 'has auth_protocol' do
|
||||
expect(@chef_run).to render_file(@filename).with_content(
|
||||
/^auth_protocol = http$/)
|
||||
end
|
||||
|
||||
it 'has no auth_version' do
|
||||
expect(@chef_run).not_to render_file(@filename).with_content(
|
||||
/^auth_version = v2.0$/)
|
||||
end
|
||||
|
||||
it 'has admin_tenant_name' do
|
||||
expect(@chef_run).to render_file(@filename).with_content(
|
||||
/^admin_tenant_name = service$/)
|
||||
end
|
||||
|
||||
it 'has admin_user' do
|
||||
expect(@chef_run).to render_file(@filename).with_content(
|
||||
/^admin_user = ceilometer$/)
|
||||
end
|
||||
|
||||
it 'has admin_password' do
|
||||
expect(@chef_run).to render_file(@filename).with_content(
|
||||
/^admin_password = ceilometer-pass$/)
|
||||
end
|
||||
|
||||
it 'has signing_dir' do
|
||||
expect(@chef_run).to render_file(@filename).with_content(
|
||||
/^#{Regexp.quote('signing_dir = /var/cache/ceilometer/api')}$/)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'installs the /etc/ceilometer/policy.json file' do
|
||||
|
|
|
@ -54,10 +54,13 @@ periodic_interval = <%= node["openstack"]["telemetry"]["periodic_interval"] %>
|
|||
|
||||
[keystone_authtoken]
|
||||
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
|
||||
auth_uri = <%= @identity_endpoint.to_s %>
|
||||
auth_uri = <%= @auth_uri %>
|
||||
auth_host = <%= @identity_admin_endpoint.host %>
|
||||
auth_port = <%= @identity_admin_endpoint.port %>
|
||||
auth_protocol = <%= @identity_admin_endpoint.scheme %>
|
||||
<% if node['openstack']['telemetry']['api']['auth']['version'] != 'v2.0' %>
|
||||
auth_version = <%= node['openstack']['telemetry']['api']['auth']['version'] %>
|
||||
<% end %>
|
||||
admin_tenant_name = <%= @service_tenant_name %>
|
||||
admin_user = <%= @service_user %>
|
||||
admin_password = <%= @service_pass %>
|
||||
|
|
Loading…
Reference in New Issue