Fix placement URL
In Debian, if using the UWSGI placement thing, then the URL for the placement API is just: http://127.0.0.1:8778/ and not: http://127.0.0.1:8778/placement This patch fixes the endpoint registration for that case. Change-Id: I1d8a7dec1bcc5915d99e7e275dc63de0e727f907
This commit is contained in:
parent
1c0a38e398
commit
adbcfd709b
|
@ -63,13 +63,13 @@ class nova::keystone::auth_placement(
|
|||
$region = 'RegionOne',
|
||||
$tenant = 'services',
|
||||
$email = 'placement@localhost',
|
||||
$public_url = 'http://127.0.0.1/placement',
|
||||
$internal_url = 'http://127.0.0.1/placement',
|
||||
$admin_url = 'http://127.0.0.1/placement',
|
||||
$public_url = $::nova::params::placement_public_url,
|
||||
$internal_url = $::nova::params::placement_internal_url,
|
||||
$admin_url = $::nova::params::placement_admin_url,
|
||||
$configure_endpoint = true,
|
||||
$configure_user = true,
|
||||
$configure_user_role = true,
|
||||
) {
|
||||
) inherits nova::params {
|
||||
|
||||
include ::nova::deps
|
||||
|
||||
|
|
|
@ -55,6 +55,9 @@ class nova::params {
|
|||
$nova_log_group = 'root'
|
||||
$nova_wsgi_script_path = '/var/www/cgi-bin/nova'
|
||||
$nova_api_wsgi_script_source = '/usr/bin/nova-api-wsgi'
|
||||
$placement_public_url = 'http://127.0.0.1/placement'
|
||||
$placement_internal_url = 'http://127.0.0.1/placement'
|
||||
$placement_admin_url = 'http://127.0.0.1/placement'
|
||||
$placement_wsgi_script_source = '/usr/bin/nova-placement-api'
|
||||
$placement_httpd_config_file = '/etc/httpd/conf.d/00-nova-placement-api.conf'
|
||||
case $::operatingsystem {
|
||||
|
@ -131,6 +134,9 @@ class nova::params {
|
|||
$virtlock_service_name = undef
|
||||
$virtlog_service_name = undef
|
||||
$placement_service_name = 'nova-placement-api'
|
||||
$placement_public_url = 'http://127.0.0.1'
|
||||
$placement_internal_url = 'http://127.0.0.1'
|
||||
$placement_admin_url = 'http://127.0.0.1'
|
||||
}
|
||||
default: {
|
||||
$spicehtml5proxy_package_name = 'nova-spiceproxy'
|
||||
|
@ -141,6 +147,9 @@ class nova::params {
|
|||
$virtlock_service_name = 'virtlockd'
|
||||
$virtlog_service_name = 'virtlogd'
|
||||
$placement_service_name = 'httpd'
|
||||
$placement_public_url = 'http://127.0.0.1/placement'
|
||||
$placement_internal_url = 'http://127.0.0.1/placement'
|
||||
$placement_admin_url = 'http://127.0.0.1/placement'
|
||||
}
|
||||
}
|
||||
$libvirt_service_name = 'libvirtd'
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||
describe 'nova::keystone::auth_placement' do
|
||||
|
||||
let :params do
|
||||
{:password => 'placement_password'}
|
||||
{ :password => 'placement_password' }
|
||||
end
|
||||
|
||||
let :default_params do
|
||||
|
@ -11,18 +11,15 @@ describe 'nova::keystone::auth_placement' do
|
|||
:service_name => 'placement',
|
||||
:region => 'RegionOne',
|
||||
:tenant => 'services',
|
||||
:email => 'placement@localhost',
|
||||
:public_url => 'http://127.0.0.1/placement',
|
||||
:internal_url => 'http://127.0.0.1/placement',
|
||||
:admin_url => 'http://127.0.0.1/placement' }
|
||||
:email => 'placement@localhost' }
|
||||
end
|
||||
|
||||
shared_examples 'nova::keystone::auth_placement' do
|
||||
context 'with default parameters' do
|
||||
|
||||
it { is_expected.to contain_keystone_user('placement').with(
|
||||
:ensure => 'present',
|
||||
:password => 'placement_password'
|
||||
) }
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_keystone_user_role('placement@services').with(
|
||||
:ensure => 'present',
|
||||
|
@ -36,11 +33,10 @@ describe 'nova::keystone::auth_placement' do
|
|||
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/placement::placement').with(
|
||||
:ensure => 'present',
|
||||
:public_url => 'http://127.0.0.1/placement',
|
||||
:admin_url => 'http://127.0.0.1/placement',
|
||||
:internal_url => 'http://127.0.0.1/placement'
|
||||
:public_url => platform_params[:public_url],
|
||||
:admin_url => platform_params[:admin_url],
|
||||
:internal_url => platform_params[:internal_url]
|
||||
)}
|
||||
|
||||
end
|
||||
|
||||
context 'when setting auth name' do
|
||||
|
@ -51,7 +47,7 @@ describe 'nova::keystone::auth_placement' do
|
|||
it { is_expected.to contain_keystone_user('foo').with(
|
||||
:ensure => 'present',
|
||||
:password => 'placement_password'
|
||||
) }
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_keystone_user_role('foo@services').with(
|
||||
:ensure => 'present',
|
||||
|
@ -62,7 +58,6 @@ describe 'nova::keystone::auth_placement' do
|
|||
:ensure => 'present',
|
||||
:description => 'Openstack Placement Service'
|
||||
)}
|
||||
|
||||
end
|
||||
|
||||
context 'when overriding endpoint parameters' do
|
||||
|
@ -81,7 +76,6 @@ describe 'nova::keystone::auth_placement' do
|
|||
:internal_url => params[:internal_url],
|
||||
:admin_url => params[:admin_url]
|
||||
)}
|
||||
|
||||
end
|
||||
|
||||
describe 'when disabling endpoint configuration' do
|
||||
|
@ -132,7 +126,7 @@ describe 'nova::keystone::auth_placement' do
|
|||
end
|
||||
|
||||
let :facts do
|
||||
@default_facts.merge({ :osfamily => "Debian"})
|
||||
facts.merge({ :osfamily => "Debian"})
|
||||
end
|
||||
|
||||
let :params do
|
||||
|
@ -143,7 +137,6 @@ describe 'nova::keystone::auth_placement' do
|
|||
end
|
||||
|
||||
describe 'when overriding service names' do
|
||||
|
||||
let :params do
|
||||
{
|
||||
:service_name => 'nova_service',
|
||||
|
@ -155,7 +148,48 @@ describe 'nova::keystone::auth_placement' do
|
|||
it { is_expected.to contain_keystone_user_role('placement@services') }
|
||||
it { is_expected.to contain_keystone_service('nova_service::placement') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/nova_service::placement') }
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'nova::keystone::auth_placement on Debian' do
|
||||
before do
|
||||
facts.merge!( :os_package_type => 'debian' )
|
||||
end
|
||||
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/placement::placement').with(
|
||||
:ensure => 'present',
|
||||
:public_url => platform_params[:public_url],
|
||||
:admin_url => platform_params[:admin_url],
|
||||
:internal_url => platform_params[:internal_url]
|
||||
)}
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
let(:platform_params) do
|
||||
if facts[:os_package_type] == 'debian'
|
||||
{ :public_url => 'http://127.0.0.1',
|
||||
:internal_url => 'http://127.0.0.1',
|
||||
:admin_url => 'http://127.0.0.1' }
|
||||
else
|
||||
{ :public_url => 'http://127.0.0.1/placement',
|
||||
:internal_url => 'http://127.0.0.1/placement',
|
||||
:admin_url => 'http://127.0.0.1/placement' }
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'nova::keystone::auth_placement'
|
||||
|
||||
if facts[:operatingsystem] == 'Debian'
|
||||
it_behaves_like 'nova::keystone::auth_placement on Debian'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue