summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Cassiba <s@cassiba.com>2018-06-12 21:04:02 -0700
committerSamuel Cassiba <s@cassiba.com>2018-06-14 21:28:42 -0700
commit93882de60329d91fdb9ba6ad5515a94312f570a8 (patch)
treed1e442b16fb76585094cfbd47d4b787ec49baa94
parentc26101bfbad23f19dddb5b31a1937490495ff569 (diff)
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: I188edfcfbd6f8261a648c03b6e46532b960d3ac6 Implements: blueprint simplify-identity-endpoint
Notes
Notes (review): Code-Review+2: Jan Klare <j.klare@cloudbau.de> Workflow+1: Christoph Albers <c.albers@x-ion.de> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 28 Jun 2018 15:38:32 +0000 Reviewed-on: https://review.openstack.org/574977 Project: openstack/cookbook-openstack-block-storage Branch: refs/heads/master
-rw-r--r--recipes/cinder-common.rb8
-rw-r--r--recipes/identity_registration.rb4
-rw-r--r--spec/cinder_common_spec.rb9
-rw-r--r--spec/identity_registration_spec.rb2
-rw-r--r--spec/spec_helper.rb14
5 files changed, 14 insertions, 23 deletions
diff --git a/recipes/cinder-common.rb b/recipes/cinder-common.rb
index 6d5b860..09c50c4 100644
--- a/recipes/cinder-common.rb
+++ b/recipes/cinder-common.rb
@@ -48,13 +48,12 @@ end
48glance_api_endpoint = internal_endpoint 'image_api' 48glance_api_endpoint = internal_endpoint 'image_api'
49cinder_api_bind = node['openstack']['bind_service']['all']['block-storage'] 49cinder_api_bind = node['openstack']['bind_service']['all']['block-storage']
50cinder_api_bind_address = bind_address cinder_api_bind 50cinder_api_bind_address = bind_address cinder_api_bind
51identity_endpoint = internal_endpoint 'identity' 51identity_endpoint = public_endpoint 'identity'
52identity_admin_endpoint = admin_endpoint 'identity'
53node.default['openstack']['block-storage']['conf_secrets'] 52node.default['openstack']['block-storage']['conf_secrets']
54 .[]('keystone_authtoken')['password'] = 53 .[]('keystone_authtoken')['password'] =
55 get_password 'service', 'openstack-block-storage' 54 get_password 'service', 'openstack-block-storage'
56auth_uri = identity_endpoint.to_s 55
57auth_url = identity_admin_endpoint.to_s 56auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version']
58 57
59directory '/etc/cinder' do 58directory '/etc/cinder' do
60 group node['openstack']['block-storage']['group'] 59 group node['openstack']['block-storage']['group']
@@ -68,7 +67,6 @@ node.default['openstack']['block-storage']['conf'].tap do |conf|
68 conf['DEFAULT']['glance_api_servers'] = glance_api_endpoint.to_s 67 conf['DEFAULT']['glance_api_servers'] = glance_api_endpoint.to_s
69 conf['DEFAULT']['osapi_volume_listen'] = cinder_api_bind_address 68 conf['DEFAULT']['osapi_volume_listen'] = cinder_api_bind_address
70 conf['DEFAULT']['osapi_volume_listen_port'] = cinder_api_bind['port'] 69 conf['DEFAULT']['osapi_volume_listen_port'] = cinder_api_bind['port']
71 conf['keystone_authtoken']['auth_uri'] = auth_uri
72 conf['keystone_authtoken']['auth_url'] = auth_url 70 conf['keystone_authtoken']['auth_url'] = auth_url
73end 71end
74 72
diff --git a/recipes/identity_registration.rb b/recipes/identity_registration.rb
index 20862a6..4eb8a66 100644
--- a/recipes/identity_registration.rb
+++ b/recipes/identity_registration.rb
@@ -26,8 +26,8 @@ class ::Chef::Recipe
26 include ::Openstack 26 include ::Openstack
27end 27end
28 28
29identity_admin_endpoint = admin_endpoint 'identity' 29identity_endpoint = public_endpoint 'identity'
30auth_url = ::URI.decode identity_admin_endpoint.to_s 30auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version']
31 31
32interfaces = { 32interfaces = {
33 public: { url: public_endpoint('block-storage') }, 33 public: { url: public_endpoint('block-storage') },
diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb
index 6e06650..5182cd9 100644
--- a/spec/cinder_common_spec.rb
+++ b/spec/cinder_common_spec.rb
@@ -69,15 +69,6 @@ describe 'openstack-block-storage::cinder-common' do
69 end 69 end
70 70
71 context 'keystone authtoken attributes' do 71 context 'keystone authtoken attributes' do
72 context 'endpoint related' do
73 it 'has auth_uri' do
74 expect(chef_run).to render_config_file(file.name).with_section_content('keystone_authtoken', %r{^auth_uri = http://127.0.0.1:5000/v3$})
75 end
76 it 'has auth_url' do
77 expect(chef_run).to render_config_file(file.name).with_section_content('keystone_authtoken', %r{^auth_url = http://127.0.0.1:35357/v3$})
78 end
79 end
80
81 it do 72 it do
82 expect(chef_run).not_to render_file(file.name).with_content(/^auth_version = v2.0$/) 73 expect(chef_run).not_to render_file(file.name).with_content(/^auth_version = v2.0$/)
83 end 74 end
diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb
index c0cdfec..f53ad31 100644
--- a/spec/identity_registration_spec.rb
+++ b/spec/identity_registration_spec.rb
@@ -13,7 +13,7 @@ describe 'openstack-block-storage::identity_registration' do
13 include_context 'block-storage-stubs' 13 include_context 'block-storage-stubs'
14 14
15 connection_params = { 15 connection_params = {
16 openstack_auth_url: 'http://127.0.0.1:35357/v3/auth/tokens', 16 openstack_auth_url: 'http://127.0.0.1:5000/v3/auth/tokens',
17 openstack_username: 'admin', 17 openstack_username: 'admin',
18 openstack_api_key: 'emc_test_pass', 18 openstack_api_key: 'emc_test_pass',
19 openstack_project_name: 'admin', 19 openstack_project_name: 'admin',
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 1e774ca..40f131f 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -9,16 +9,19 @@ ChefSpec::Coverage.start! { add_filter 'openstack-block-storage' }
9 9
10require 'chef/application' 10require 'chef/application'
11 11
12LOG_LEVEL = :fatal 12RSpec.configure do |config|
13 config.color = true
14 config.formatter = :documentation
15 config.log_level = :fatal
16end
17
13REDHAT_OPTS = { 18REDHAT_OPTS = {
14 platform: 'redhat', 19 platform: 'redhat',
15 version: '7.3', 20 version: '7.4',
16 log_level: LOG_LEVEL,
17}.freeze 21}.freeze
18UBUNTU_OPTS = { 22UBUNTU_OPTS = {
19 platform: 'ubuntu', 23 platform: 'ubuntu',
20 version: '16.04', 24 version: '16.04',
21 log_level: LOG_LEVEL,
22}.freeze 25}.freeze
23 26
24shared_context 'block-storage-stubs' do 27shared_context 'block-storage-stubs' do
@@ -110,8 +113,7 @@ shared_examples 'creates_cinder_conf' do |service, user, group, action = :restar
110 /^project_name = service$/, 113 /^project_name = service$/,
111 /^user_domain_name = Default/, 114 /^user_domain_name = Default/,
112 /^project_domain_name = Default/, 115 /^project_domain_name = Default/,
113 %r{^auth_uri = http://127.0.0.1:5000/v3$}, 116 %r{^auth_url = http://127.0.0.1:5000/v3$},
114 %r{^auth_url = http://127.0.0.1:35357/v3$},
115 /^password = cinder-pass$/, 117 /^password = cinder-pass$/,
116 ].each do |line| 118 ].each do |line|
117 expect(chef_run).to render_config_file(file.name) 119 expect(chef_run).to render_config_file(file.name)