From a5d4ce3bd20b0e03be3423c195c61317a66645bc Mon Sep 17 00:00:00 2001 From: Samuel Cassiba Date: Tue, 12 Jun 2018 22:23:55 -0700 Subject: [PATCH] Simplify identity endpoint Per the Keystone Install Guide[1] the admin endpoint is superseded in favor of a single public endpoint. As a result, the admin endpoint is no longer deployed by default. [1] https://docs.openstack.org/keystone/queens/install/keystone-install-ubuntu.html#install-and-configure-components Change-Id: Ic2733d94e776eaa50ad8e4a39e6d2a8c18a45d89 Implements: blueprint simplify-identity-endpoint --- recipes/common.rb | 8 ++------ recipes/gnocchi_configure.rb | 8 ++------ recipes/identity_registration.rb | 4 ++-- spec/identity_registration_spec.rb | 2 +- spec/spec_helper.rb | 11 +++++++---- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/recipes/common.rb b/recipes/common.rb index 927986d..7f2c299 100644 --- a/recipes/common.rb +++ b/recipes/common.rb @@ -63,12 +63,8 @@ node.default['openstack']['telemetry']['conf_secrets'].tap do |conf_secrets| get_password 'service', 'openstack-telemetry' end -identity_public_endpoint = public_endpoint 'identity' -auth_url = - auth_uri_transform( - identity_public_endpoint.to_s, - node['openstack']['telemetry']['identity-api']['auth']['version'] - ) +identity_endpoint = public_endpoint 'identity' +auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version'] node.default['openstack']['telemetry']['conf'].tap do |conf| conf['api']['host'] = bind_service_address diff --git a/recipes/gnocchi_configure.rb b/recipes/gnocchi_configure.rb index 81025d8..1d544f4 100644 --- a/recipes/gnocchi_configure.rb +++ b/recipes/gnocchi_configure.rb @@ -34,12 +34,8 @@ node.default['openstack']['telemetry-metric']['conf_secrets'].tap do |conf_secre get_password 'service', 'openstack-telemetry-metric' end -identity_public_endpoint = public_endpoint 'identity' -auth_url = - auth_uri_transform( - identity_public_endpoint.to_s, - node['openstack']['telemetry-metric']['identity-api']['auth']['version'] - ) +identity_endpoint = public_endpoint 'identity' +auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version'] node.default['openstack']['telemetry-metric']['conf'].tap do |conf| conf['api']['host'] = bind_service_address diff --git a/recipes/identity_registration.rb b/recipes/identity_registration.rb index 3b1319e..f7d3fcb 100644 --- a/recipes/identity_registration.rb +++ b/recipes/identity_registration.rb @@ -25,9 +25,9 @@ class ::Chef::Recipe include ::Openstack end -identity_admin_endpoint = admin_endpoint 'identity' +identity_endpoint = public_endpoint 'identity' -auth_url = ::URI.decode identity_admin_endpoint.to_s +auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version'] admin_user = node['openstack']['identity']['admin_user'] admin_pass = get_password 'user', node['openstack']['identity']['admin_user'] admin_project = node['openstack']['identity']['admin_project'] diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb index d68e76d..08dac5c 100644 --- a/spec/identity_registration_spec.rb +++ b/spec/identity_registration_spec.rb @@ -25,7 +25,7 @@ describe 'openstack-telemetry::identity_registration' do end connection_params = { - openstack_auth_url: 'http://127.0.0.1:35357/v3/auth/tokens', + openstack_auth_url: 'http://127.0.0.1:5000/v3/auth/tokens', openstack_username: 'admin', openstack_api_key: 'admin-pass', openstack_project_name: 'admin', diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9071950..bf7574a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,16 +6,19 @@ ChefSpec::Coverage.start! { add_filter 'openstack-telemetry' } require 'chef/application' -LOG_LEVEL = :fatal +RSpec.configure do |config| + config.color = true + config.formatter = :documentation + config.log_level = :fatal +end + REDHAT_OPTS = { platform: 'redhat', - version: '7.3', - log_level: ::LOG_LEVEL, + version: '7.4', }.freeze UBUNTU_OPTS = { platform: 'ubuntu', version: '16.04', - log_level: ::LOG_LEVEL, }.freeze shared_context 'telemetry-stubs' do