Browse Source

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
Samuel Cassiba 10 months ago
parent
commit
c6195859d9

+ 3
- 7
recipes/default.rb View File

@@ -77,8 +77,8 @@ if node['openstack']['mq']['service_type'] == 'rabbit'
77 77
   node.default['openstack']['network']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'network'
78 78
 end
79 79
 
80
-identity_public_endpoint = public_endpoint 'identity'
81
-auth_url = identity_public_endpoint.to_s
80
+identity_endpoint = public_endpoint 'identity'
81
+auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version']
82 82
 
83 83
 db_user = node['openstack']['db']['network']['username']
84 84
 db_pass = get_password 'db', 'neutron'
@@ -88,12 +88,8 @@ bind_service_address = bind_address bind_service
88 88
 # The auth_url in nova section follows auth_type
89 89
 nova_auth_url = nil
90 90
 case node['openstack']['network']['conf']['nova']['auth_type']
91
-when 'password'
92
-  nova_auth_url = auth_uri
93
-when 'v2password'
94
-  nova_auth_url = auth_uri_transform(identity_public_endpoint.to_s, 'v2.0')
95 91
 when 'v3password'
96
-  nova_auth_url = auth_uri_transform(identity_public_endpoint.to_s, 'v3.0')
92
+  nova_auth_url = auth_url
97 93
 end
98 94
 
99 95
 node.default['openstack']['network']['conf'].tap do |conf|

+ 2
- 3
recipes/identity_registration.rb View File

@@ -26,9 +26,8 @@ class ::Chef::Recipe
26 26
   include ::Openstack
27 27
 end
28 28
 
29
-identity_admin_endpoint = admin_endpoint 'identity'
30
-
31
-auth_url = ::URI.decode identity_admin_endpoint.to_s
29
+identity_endpoint = public_endpoint 'identity'
30
+auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version']
32 31
 
33 32
 interfaces = {
34 33
   public: { url: public_endpoint('network') },

+ 0
- 2
spec/default_spec.rb View File

@@ -92,7 +92,6 @@ describe 'openstack-network' do
92 92
         /^username = neutron$/,
93 93
         /^user_domain_name = Default/,
94 94
         /^project_domain_name = Default/,
95
-        %r{^auth_url = http://127\.0\.0\.1:5000/v3$},
96 95
         /^password = neutron-pass$/,
97 96
         /^auth_type = v3password$/,
98 97
       ].each do |line|
@@ -104,7 +103,6 @@ describe 'openstack-network' do
104 103
       [
105 104
         /^region_name = RegionOne$/,
106 105
         /^auth_type = v3password$/,
107
-        %r{^auth_url = http://127\.0\.0\.1:5000/v3$},
108 106
         /^username = nova$/,
109 107
         /^user_domain_name = Default/,
110 108
         /^project_domain_name = Default/,

+ 1
- 1
spec/identity_registration_spec.rb View File

@@ -14,7 +14,7 @@ describe 'openstack-network::identity_registration' do
14 14
     include_context 'neutron-stubs'
15 15
 
16 16
     connection_params = {
17
-      openstack_auth_url: 'http://127.0.0.1:35357/v3/auth/tokens',
17
+      openstack_auth_url: 'http://127.0.0.1:5000/v3/auth/tokens',
18 18
       openstack_username: 'admin',
19 19
       openstack_api_key: 'admin-pass',
20 20
       openstack_project_name: 'admin',

+ 8
- 6
spec/spec_helper.rb View File

@@ -7,21 +7,23 @@ ChefSpec::Coverage.start! { add_filter 'openstack-network' }
7 7
 
8 8
 require 'chef/application'
9 9
 
10
-LOG_LEVEL = :fatal
10
+RSpec.configure do |config|
11
+  config.color = true
12
+  config.formatter = :documentation
13
+  config.log_level = :fatal
14
+end
15
+
11 16
 REDHAT_OPTS = {
12 17
   platform: 'redhat',
13
-  version: '7.3',
14
-  log_level: LOG_LEVEL,
18
+  version: '7.4',
15 19
 }.freeze
16 20
 UBUNTU_OPTS = {
17 21
   platform: 'ubuntu',
18 22
   version: '16.04',
19
-  log_level: LOG_LEVEL,
20 23
 }.freeze
21 24
 CENTOS_OPTS = {
22 25
   platform: 'centos',
23
-  version: '7.3.1611',
24
-  log_level: LOG_LEVEL,
26
+  version: '7.4.1708',
25 27
 }.freeze
26 28
 
27 29
 shared_context 'neutron-stubs' do

Loading…
Cancel
Save