From 5d727d62792e462765f45d2105783c2065581c66 Mon Sep 17 00:00:00 2001 From: Mathew Odden Date: Mon, 19 May 2014 21:24:13 +0000 Subject: [PATCH] Revert "switch to using auth_url instead of auth_host et al" This reverts commit 6d252ac4841d66eb3ced83bdce09db0e16c7f9b2. keystone_authtoken middleware has no config option for auth_url, so the change breaks neutron-server from being able to contact the correct keystone service (unless it runs on localhost, which is what auth_host defaults to) Related-Bug: #1319280 Change-Id: I41a2ecd0ada3ec59983fd408123b0f3570050bb1 --- CHANGELOG.md | 3 +++ metadata.rb | 2 +- recipes/common.rb | 5 +++-- spec/server_spec.rb | 19 +++++++++++++++++-- templates/default/neutron.conf.erb | 8 +++++++- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cdb594f..d2f519dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG for cookbook-openstack-network This file is used to list changes made in each version of cookbook-openstack-network. +## 9.0.7 +* Revert Switch to using auth_url instead of auth_host et al + ## 9.0.6 * Fix ovs_use_veth default value diff --git a/metadata.rb b/metadata.rb index 7b76100d..053333bb 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,7 +5,7 @@ maintainer 'Jay Pipes ' license 'Apache 2.0' description 'Installs and configures the OpenStack Network API Service and various agents and plugins' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '9.0.6' +version '9.0.7' recipe 'openstack-network::client', 'Install packages required for network client' recipe 'openstack-network::server', 'Installs packages required for a OpenStack Network server' recipe 'openstack-network::openvswitch', 'Installs packages required for OVS' diff --git a/recipes/common.rb b/recipes/common.rb index 81fe7ee8..5d8373af 100644 --- a/recipes/common.rb +++ b/recipes/common.rb @@ -115,8 +115,9 @@ end identity_endpoint = endpoint 'identity-api' identity_admin_endpoint = endpoint 'identity-admin' +auth_uri = ::URI.decode identity_endpoint.to_s -auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['network']['api']['auth']['version'] +auth_uri = auth_uri_transform identity_endpoint.to_s, node['openstack']['network']['api']['auth']['version'] db_user = node['openstack']['db']['network']['username'] db_pass = get_password 'db', 'neutron' @@ -189,7 +190,7 @@ template '/etc/neutron/neutron.conf' do mq_service_type: mq_service_type, mq_password: mq_password, core_plugin: core_plugin, - auth_url: auth_url, + auth_uri: auth_uri, identity_admin_endpoint: identity_admin_endpoint, service_pass: service_pass, sql_connection: sql_connection, diff --git a/spec/server_spec.rb b/spec/server_spec.rb index a04518ae..ab63213f 100644 --- a/spec/server_spec.rb +++ b/spec/server_spec.rb @@ -293,9 +293,24 @@ describe 'openstack-network::server' do 'admin_password = neutron-pass') end - it 'has auth_url' do + it 'has auth_uri' do expect(chef_run).to render_file(file.name).with_content( - 'auth_url = http://127.0.0.1:5000/v2.0') + 'auth_uri = http://127.0.0.1:5000/v2.0') + end + + it 'has auth_host' do + expect(chef_run).to render_file(file.name).with_content( + 'auth_host = 127.0.0.1') + end + + it 'has auth_port' do + expect(chef_run).to render_file(file.name).with_content( + 'auth_port = 35357') + end + + it 'has auth_protocol' do + expect(chef_run).to render_file(file.name).with_content( + 'auth_protocol = http') end it 'has signing_dir' do diff --git a/templates/default/neutron.conf.erb b/templates/default/neutron.conf.erb index af855728..0adff7cc 100644 --- a/templates/default/neutron.conf.erb +++ b/templates/default/neutron.conf.erb @@ -349,7 +349,13 @@ root_helper = "sudo neutron-rootwrap /etc/neutron/rootwrap.conf" report_interval = <%= node["openstack"]["network"]["api"]["agent"]["agent_report_interval"] %> [keystone_authtoken] -auth_url = <%= @auth_url %> +auth_uri = <%= @auth_uri %> +auth_host = <%= @identity_admin_endpoint.host %> +auth_port = <%= @identity_admin_endpoint.port %> +auth_protocol = <%= @identity_admin_endpoint.scheme %> +<% if node['openstack']['network']['api']['auth']['version'] != 'v2.0' %> +auth_version = <%= node['openstack']['network']['api']['auth']['version'] %> +<% end %> admin_tenant_name = <%= node["openstack"]["network"]["service_tenant_name"] %> admin_user = <%= node["openstack"]["network"]["service_user"] %> admin_password = <%= @service_pass %>