
Nova deprecated 2.0 API in Liberty and will remove it in Newton. This patch does 3 things: * in nova::keystone::auth, create nova API 2.1 endpoints by default and not 2.0 anymore that is going to be removed. puppet-keystone will update endpoints for the 'compute' service with the new URL. * in nova::keystone::auth, deprecate all parameters related to v3. They are useless, since we now use v2.1 by default and it's the version that is what v3 started out as. Note: puppet-keystone won't remove the v3 endpoint. You can do it with puppet-keystone or manually. * deprecate osapi_v3 in nova::api. The parameter is useless and does not need to bet set. List of parameters deprecated: * osapi_v3 * auth_name_v3 * service_description_v3 * service_name_v3 * public_url_v3 * internal_url_v3 * admin_url_v3 * configure_endpoint_v3 They have no effect and will be removed in a future release. Change-Id: I8990ce21745fa7a995b92ed337622fa6ffc2756b
161 lines
4.4 KiB
Ruby
161 lines
4.4 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'nova::keystone::auth' do
|
|
|
|
let :params do
|
|
{:password => 'nova_password'}
|
|
end
|
|
|
|
let :default_params do
|
|
{ :auth_name => 'nova',
|
|
:region => 'RegionOne',
|
|
:tenant => 'services',
|
|
:email => 'nova@localhost',
|
|
:public_url => 'http://127.0.0.1:8774/v2.1',
|
|
:internal_url => 'http://127.0.0.1:8774/v2.1',
|
|
:admin_url => 'http://127.0.0.1:8774/v2.1' }
|
|
end
|
|
|
|
context 'with default parameters' do
|
|
|
|
it { is_expected.to contain_keystone_user('nova').with(
|
|
:ensure => 'present',
|
|
:password => 'nova_password'
|
|
) }
|
|
|
|
it { is_expected.to contain_keystone_user_role('nova@services').with(
|
|
:ensure => 'present',
|
|
:roles => ['admin']
|
|
)}
|
|
|
|
it { is_expected.to contain_keystone_service('nova::compute').with(
|
|
:ensure => 'present',
|
|
:description => 'Openstack Compute Service'
|
|
)}
|
|
|
|
it { is_expected.to contain_keystone_endpoint('RegionOne/nova::compute').with(
|
|
:ensure => 'present',
|
|
:public_url => 'http://127.0.0.1:8774/v2.1',
|
|
:admin_url => 'http://127.0.0.1:8774/v2.1',
|
|
:internal_url => 'http://127.0.0.1:8774/v2.1'
|
|
)}
|
|
|
|
end
|
|
|
|
context 'when setting auth name' do
|
|
before do
|
|
params.merge!( :auth_name => 'foo' )
|
|
end
|
|
|
|
it { is_expected.to contain_keystone_user('foo').with(
|
|
:ensure => 'present',
|
|
:password => 'nova_password'
|
|
) }
|
|
|
|
it { is_expected.to contain_keystone_user_role('foo@services').with(
|
|
:ensure => 'present',
|
|
:roles => ['admin']
|
|
)}
|
|
|
|
it { is_expected.to contain_keystone_service('foo::compute').with(
|
|
:ensure => 'present',
|
|
:description => 'Openstack Compute Service'
|
|
)}
|
|
|
|
end
|
|
|
|
context 'when overriding endpoint parameters' do
|
|
before do
|
|
params.merge!(
|
|
:region => 'RegionTwo',
|
|
:public_url => 'https://10.0.0.1:9774/v2.2',
|
|
:internal_url => 'https://10.0.0.3:9774/v2.2',
|
|
:admin_url => 'https://10.0.0.2:9774/v2.2',
|
|
)
|
|
end
|
|
|
|
it { is_expected.to contain_keystone_endpoint('RegionTwo/nova::compute').with(
|
|
:ensure => 'present',
|
|
:public_url => params[:public_url],
|
|
:internal_url => params[:internal_url],
|
|
:admin_url => params[:admin_url]
|
|
)}
|
|
|
|
end
|
|
|
|
describe 'when disabling endpoint configuration' do
|
|
before do
|
|
params.merge!( :configure_endpoint => false )
|
|
end
|
|
|
|
it { is_expected.to_not contain_keystone_endpoint('RegionOne/nova::compute') }
|
|
end
|
|
|
|
describe 'when disabling user configuration' do
|
|
before do
|
|
params.merge!( :configure_user => false )
|
|
end
|
|
|
|
it { is_expected.to_not contain_keystone_user('nova') }
|
|
it { is_expected.to contain_keystone_user_role('nova@services') }
|
|
it { is_expected.to contain_keystone_service('nova::compute').with(
|
|
:ensure => 'present',
|
|
:description => 'Openstack Compute Service'
|
|
)}
|
|
end
|
|
|
|
describe 'when disabling user and user role configuration' do
|
|
let :params do
|
|
{
|
|
:configure_user => false,
|
|
:configure_user_role => false,
|
|
:password => 'nova_password'
|
|
}
|
|
end
|
|
|
|
it { is_expected.to_not contain_keystone_user('nova') }
|
|
it { is_expected.to_not contain_keystone_user_role('nova@services') }
|
|
it { is_expected.to contain_keystone_service('nova::compute').with(
|
|
:ensure => 'present',
|
|
:description => 'Openstack Compute Service'
|
|
)}
|
|
end
|
|
|
|
describe 'when configuring nova-api and the keystone endpoint' do
|
|
let :pre_condition do
|
|
"class { 'nova::api': admin_password => 'test' }
|
|
include nova"
|
|
end
|
|
|
|
let :facts do
|
|
@default_facts.merge({ :osfamily => "Debian"})
|
|
end
|
|
|
|
let :params do
|
|
{
|
|
:password => 'test'
|
|
}
|
|
end
|
|
|
|
it { is_expected.to contain_keystone_endpoint('RegionOne/nova::compute').with_notify(['Service[nova-api]']) }
|
|
end
|
|
|
|
describe 'when overriding service names' do
|
|
|
|
let :params do
|
|
{
|
|
:service_name => 'nova_service',
|
|
:password => 'nova_password'
|
|
}
|
|
end
|
|
|
|
it { is_expected.to contain_keystone_user('nova') }
|
|
it { is_expected.to contain_keystone_user_role('nova@services') }
|
|
it { is_expected.to contain_keystone_service('nova_service::compute') }
|
|
it { is_expected.to contain_keystone_endpoint('RegionOne/nova_service::compute') }
|
|
|
|
end
|
|
|
|
end
|
|
|