From 5058033a1af25fe3f7900751abc8bfe965f95b72 Mon Sep 17 00:00:00 2001 From: Samuel Cassiba Date: Tue, 12 Jun 2018 21:51:49 -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: Iafb0db54b3589eea0402c0f18687344667d0208a Implements: blueprint simplify-identity-endpoint --- recipes/horizon.rb | 7 ++----- spec/horizon_spec.rb | 4 ---- spec/spec_helper.rb | 11 +++++++---- templates/default/local_settings.py.erb | 3 +-- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/recipes/horizon.rb b/recipes/horizon.rb index 3ae3ad9..8b1d0cf 100644 --- a/recipes/horizon.rb +++ b/recipes/horizon.rb @@ -30,10 +30,8 @@ end include_recipe 'openstack-identity' platform_options = node['openstack']['dashboard']['platform'] -identity_admin_endpoint = admin_endpoint 'identity' -auth_admin_uri = auth_uri_transform identity_admin_endpoint.to_s, node['openstack']['dashboard']['api']['auth']['version'] identity_endpoint = public_endpoint 'identity' -auth_uri = auth_uri_transform identity_endpoint.to_s, node['openstack']['dashboard']['api']['auth']['version'] +auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version'] http_bind = node['openstack']['bind_service']['dashboard_http'] http_bind_address = bind_address http_bind @@ -78,8 +76,7 @@ template node['openstack']['dashboard']['local_settings_path'] do variables( db_pass: db_pass, db_info: db_info, - auth_uri: auth_uri, - auth_admin_uri: auth_admin_uri, + auth_url: auth_url, memcached_servers: memcached, host: horizon_host ) diff --git a/spec/horizon_spec.rb b/spec/horizon_spec.rb index 477592f..0d18b8e 100644 --- a/spec/horizon_spec.rb +++ b/spec/horizon_spec.rb @@ -367,10 +367,6 @@ describe 'openstack-dashboard::horizon' do expect(chef_run).to render_file(file.name).with_content(%r{OPENSTACK_KEYSTONE_URL = "http://127.0.0.1:5000/v3"}) end - it 'has a keystone admin url' do - expect(chef_run).to render_file(file.name).with_content(%r{OPENSTACK_KEYSTONE_ADMIN_URL = "http://127.0.0.1:35357/v3"}) - end - it 'has a keystone default role' do node.set['openstack']['dashboard']['keystone_default_role'] = 'keystone_default_role_value' expect(chef_run).to render_file(file.name).with_content(/^OPENSTACK_KEYSTONE_DEFAULT_ROLE = "keystone_default_role_value"$/) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6bccd8d..a92773c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,16 +4,19 @@ require 'chefspec/berkshelf' ChefSpec::Coverage.start! { add_filter 'openstack-dashboard' } -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 # Build a regex for a section of lines diff --git a/templates/default/local_settings.py.erb b/templates/default/local_settings.py.erb index 9c05cf2..168b474 100644 --- a/templates/default/local_settings.py.erb +++ b/templates/default/local_settings.py.erb @@ -170,8 +170,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # ] OPENSTACK_HOST = "<%= @host %>" -OPENSTACK_KEYSTONE_URL = "<%= @auth_uri %>" -OPENSTACK_KEYSTONE_ADMIN_URL = "<%= @auth_admin_uri %>" +OPENSTACK_KEYSTONE_URL = "<%= @auth_url %>" OPENSTACK_KEYSTONE_DEFAULT_ROLE = "<%= node["openstack"]["dashboard"]["keystone_default_role"] %>" OPENSTACK_KEYSTONE_ADMIN_ROLES = ["admin"]