From c6195859d98884d33a12bde0344de5dfdbff06c0 Mon Sep 17 00:00:00 2001 From: Samuel Cassiba Date: Tue, 12 Jun 2018 22:16:31 -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: I833cc80421be375aed202c208cf93a0165761226 Implements: blueprint simplify-identity-endpoint --- recipes/default.rb | 10 +++------- recipes/identity_registration.rb | 5 ++--- spec/default_spec.rb | 2 -- spec/identity_registration_spec.rb | 2 +- spec/spec_helper.rb | 14 ++++++++------ 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/recipes/default.rb b/recipes/default.rb index ab36fd66..dc2468a0 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -77,8 +77,8 @@ if node['openstack']['mq']['service_type'] == 'rabbit' node.default['openstack']['network']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'network' end -identity_public_endpoint = public_endpoint 'identity' -auth_url = identity_public_endpoint.to_s +identity_endpoint = public_endpoint 'identity' +auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version'] db_user = node['openstack']['db']['network']['username'] db_pass = get_password 'db', 'neutron' @@ -88,12 +88,8 @@ bind_service_address = bind_address bind_service # The auth_url in nova section follows auth_type nova_auth_url = nil case node['openstack']['network']['conf']['nova']['auth_type'] -when 'password' - nova_auth_url = auth_uri -when 'v2password' - nova_auth_url = auth_uri_transform(identity_public_endpoint.to_s, 'v2.0') when 'v3password' - nova_auth_url = auth_uri_transform(identity_public_endpoint.to_s, 'v3.0') + nova_auth_url = auth_url end node.default['openstack']['network']['conf'].tap do |conf| diff --git a/recipes/identity_registration.rb b/recipes/identity_registration.rb index 8b994eee..17c5349f 100644 --- a/recipes/identity_registration.rb +++ b/recipes/identity_registration.rb @@ -26,9 +26,8 @@ class ::Chef::Recipe include ::Openstack end -identity_admin_endpoint = admin_endpoint 'identity' - -auth_url = ::URI.decode identity_admin_endpoint.to_s +identity_endpoint = public_endpoint 'identity' +auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version'] interfaces = { public: { url: public_endpoint('network') }, diff --git a/spec/default_spec.rb b/spec/default_spec.rb index d90167b4..57c32a3f 100644 --- a/spec/default_spec.rb +++ b/spec/default_spec.rb @@ -92,7 +92,6 @@ describe 'openstack-network' do /^username = neutron$/, /^user_domain_name = Default/, /^project_domain_name = Default/, - %r{^auth_url = http://127\.0\.0\.1:5000/v3$}, /^password = neutron-pass$/, /^auth_type = v3password$/, ].each do |line| @@ -104,7 +103,6 @@ describe 'openstack-network' do [ /^region_name = RegionOne$/, /^auth_type = v3password$/, - %r{^auth_url = http://127\.0\.0\.1:5000/v3$}, /^username = nova$/, /^user_domain_name = Default/, /^project_domain_name = Default/, diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb index 488a3d8d..01a8adc8 100644 --- a/spec/identity_registration_spec.rb +++ b/spec/identity_registration_spec.rb @@ -14,7 +14,7 @@ describe 'openstack-network::identity_registration' do include_context 'neutron-stubs' 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 b3221ce1..f5f33517 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,21 +7,23 @@ ChefSpec::Coverage.start! { add_filter 'openstack-network' } 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 CENTOS_OPTS = { platform: 'centos', - version: '7.3.1611', - log_level: LOG_LEVEL, + version: '7.4.1708', }.freeze shared_context 'neutron-stubs' do