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: I06d0f98e641a041ddc864f524858edc0cffbbbba
Implements: blueprint simplify-identity-endpoint
changes/83/574983/10
Samuel Cassiba 11 months ago
parent
commit
9b67abe1d8
3 changed files with 21 additions and 19 deletions
  1. 6
    7
      recipes/setup.rb
  2. 7
    7
      spec/setup_spec.rb
  3. 8
    5
      spec/spec_helper.rb

+ 6
- 7
recipes/setup.rb View File

@@ -35,9 +35,8 @@ platform_options['tempest_packages'].each do |pkg|
35 35
   end
36 36
 end
37 37
 
38
-identity_admin_endpoint = admin_endpoint 'identity'
39
-identity_public_endpoint = public_endpoint 'identity'
40
-auth_url = ::URI.decode identity_admin_endpoint.to_s
38
+identity_endpoint = public_endpoint 'identity'
39
+auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version']
41 40
 
42 41
 admin_user = node['openstack']['identity']['admin_user']
43 42
 admin_pass = get_password 'user', admin_user
@@ -133,9 +132,9 @@ ruby_block 'Create nano flavor 99' do
133 132
   block do
134 133
     begin
135 134
       env = openstack_command_env(admin_user, admin_project, 'Default', 'Default')
136
-      output = openstack_command('nova', 'flavor-list', env)
135
+      output = openstack_command('openstack', 'flavor list', env)
137 136
       unless output.include? 'm1.nano'
138
-        openstack_command('nova', 'flavor-create m1.nano 99 64 0 1', env)
137
+        openstack_command('openstack', 'flavor create --id 99 --vcpus 1 --ram 64 --disk 1 m1.nano', env)
139 138
       end
140 139
     rescue RuntimeError => e
141 140
       Chef::Log.error("Could not create flavor m1.nano. Error was #{e.message}")
@@ -146,8 +145,8 @@ end
146 145
 node.default['openstack']['integration-test']['conf'].tap do |conf|
147 146
   conf['compute']['image_ref'] = node['openstack']['integration-test']['image1']['id']
148 147
   conf['compute']['image_ref_alt'] = node['openstack']['integration-test']['image2']['id']
149
-  conf['identity']['uri'] = "#{identity_public_endpoint.scheme}://#{identity_public_endpoint.host}:#{identity_public_endpoint.port}/v2.0/"
150
-  conf['identity']['uri_v3'] = "#{identity_public_endpoint.scheme}://#{identity_public_endpoint.host}:#{identity_public_endpoint.port}/v3/"
148
+  conf['identity']['uri'] = "#{identity_endpoint.scheme}://#{identity_endpoint.host}:#{identity_endpoint.port}/v3/"
149
+  conf['identity']['uri_v3'] = "#{identity_endpoint.scheme}://#{identity_endpoint.host}:#{identity_endpoint.port}/v3/"
151 150
 end
152 151
 
153 152
 node.default['openstack']['integration-test']['conf_secrets'].tap do |conf_secrets|

+ 7
- 7
spec/setup_spec.rb View File

@@ -12,7 +12,7 @@ describe 'openstack-integration-test::setup' do
12 12
     include_context 'tempest-stubs'
13 13
 
14 14
     connection_params = {
15
-      openstack_auth_url: 'http://127.0.0.1:35357/v3/auth/tokens',
15
+      openstack_auth_url: 'http://127.0.0.1:5000/v3/auth/tokens',
16 16
       openstack_username: 'admin',
17 17
       openstack_api_key: 'admin',
18 18
       openstack_project_name: 'admin',
@@ -105,7 +105,7 @@ describe 'openstack-integration-test::setup' do
105 105
         identity_user: 'admin',
106 106
         identity_pass: 'admin',
107 107
         identity_tenant: 'admin',
108
-        identity_uri: 'http://127.0.0.1:35357/v3',
108
+        identity_uri: 'http://127.0.0.1:5000/v3',
109 109
         identity_user_domain_name: 'default',
110 110
         identity_project_domain_name: 'default',
111 111
         image_name: 'cirros-test1',
@@ -119,7 +119,7 @@ describe 'openstack-integration-test::setup' do
119 119
         identity_user: 'admin',
120 120
         identity_pass: 'admin',
121 121
         identity_tenant: 'admin',
122
-        identity_uri: 'http://127.0.0.1:35357/v3',
122
+        identity_uri: 'http://127.0.0.1:5000/v3',
123 123
         identity_user_domain_name: 'default',
124 124
         identity_project_domain_name: 'default',
125 125
         image_name: 'cirros-test2',
@@ -151,9 +151,9 @@ describe 'openstack-integration-test::setup' do
151 151
         )
152 152
       end
153 153
 
154
-      it 'has a v2 auth URI with the default scheme' do
154
+      it 'has an auth URI with the default scheme' do
155 155
         expect(chef_run).to render_file(file.name).with_content(
156
-          'uri = http://127.0.0.1:5000/v2.0'
156
+          'uri = http://127.0.0.1:5000/v3'
157 157
         )
158 158
       end
159 159
 
@@ -178,9 +178,9 @@ describe 'openstack-integration-test::setup' do
178 178
       end
179 179
       let(:file) { chef_run.template('/opt/tempest/etc/tempest.conf') }
180 180
 
181
-      it 'has a v2 auth URI with the secure scheme' do
181
+      it 'has an auth URI with the secure scheme' do
182 182
         expect(chef_run).to render_file(file.name).with_content(
183
-          'uri = https://127.0.0.1:5000/v2.0'
183
+          'uri = https://127.0.0.1:5000/v3'
184 184
         )
185 185
       end
186 186
 

+ 8
- 5
spec/spec_helper.rb View File

@@ -6,16 +6,19 @@ ChefSpec::Coverage.start! { add_filter 'openstack-integration-test' }
6 6
 
7 7
 require 'chef/application'
8 8
 
9
-LOG_LEVEL = :fatal
9
+RSpec.configure do |config|
10
+  config.color = true
11
+  config.formatter = :documentation
12
+  config.log_level = :fatal
13
+end
14
+
10 15
 REDHAT_OPTS = {
11 16
   platform: 'redhat',
12
-  version: '7.3',
13
-  log_level: LOG_LEVEL,
17
+  version: '7.4',
14 18
 }.freeze
15 19
 UBUNTU_OPTS = {
16 20
   platform: 'ubuntu',
17 21
   version: '16.04',
18
-  log_level: LOG_LEVEL,
19 22
 }.freeze
20 23
 
21 24
 shared_context 'tempest-stubs' do
@@ -25,7 +28,7 @@ shared_context 'tempest-stubs' do
25 28
         'OS_USERNAME'    => 'admin',
26 29
         'OS_PASSWORD'    => 'admin',
27 30
         'OS_PROJECT_NAME' => 'admin',
28
-        'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3',
31
+        'OS_AUTH_URL' => 'http://127.0.0.1:5000/v3',
29 32
         'OS_USER_DOMAIN_NAME' => 'default',
30 33
         'OS_PROJECT_DOMAIN_NAME' => 'default',
31 34
         'OS_IDENTITY_API_VERSION' => 3,

Loading…
Cancel
Save