Switch API to 2.1 and deprecate 3

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
This commit is contained in:
Emilien Macchi 2016-05-13 20:57:43 +02:00
parent bee8517bf4
commit fbd74de805
7 changed files with 106 additions and 364 deletions

View File

@ -31,11 +31,6 @@
# (optional) Complete admin Identity API endpoint.
# Defaults to: 'http://127.0.0.1:35357/'
#
# [*auth_version*]
# (optional) DEPRECATED. API version of the admin Identity API endpoint
# for example, use 'v3.0' for the keystone version 3.0 api
# Defaults to false
#
# [*admin_tenant_name*]
# (optional) The name of the tenant to create in keystone for use by the nova services
# Defaults to 'services'
@ -48,10 +43,6 @@
# (optional) IP address for nova-api server to listen
# Defaults to '0.0.0.0'
#
# [*ec2_listen_port*]
# (optional) DEPRECATED. The port on which the EC2 API will listen.
# Defaults to port undef
#
# [*metadata_listen*]
# (optional) IP address for metadata server to listen
# Defaults to '0.0.0.0'
@ -66,14 +57,6 @@
# To avoid a warning, use an array, like ['osapi_compute', metadata'] for example.
# Defaults to ['osapi_compute', 'metadata']
#
# [*keystone_ec2_url*]
# (optional) DEPRECATED. The keystone url where nova should send requests for ec2tokens
# Defaults to undef
#
# [*volume_api_class*]
# (optional) DEPRECATED. The name of the class that nova will use to access volumes. Cinder is the only option.
# Defaults to undef
#
# [*use_forwarded_for*]
# (optional) Treat X-Forwarded-For as the canonical remote address. Only
# enable this if you have a sanitizing proxy.
@ -87,19 +70,10 @@
# (optional) The port on which the OpenStack API will listen.
# Defaults to port 8774
#
# [*ec2_workers*]
# (optional) DEPRECATED. Number of workers for EC2 service
# Defaults to undef
#
# [*metadata_workers*]
# (optional) Number of workers for metadata service
# Defaults to $::processorcount
#
# [*conductor_workers*]
# (optional) DEPRECATED. Use workers parameter of nova::conductor
# Class instead.
# Defaults to undef
#
# [*instance_name_template*]
# (optional) Template string to be used to generate instance names
# Defaults to undef
@ -132,10 +106,6 @@
# (optional) The rate limiting factory to use
# Defaults to 'nova.api.openstack.compute.limits:RateLimitingMiddleware.factory'
#
# [*osapi_v3*]
# (optional) Enable or not Nova API v3
# Defaults to false
#
# [*enable_proxy_headers_parsing*]
# (optional) This determines if the HTTPProxyToWSGI
# middleware should parse the proxy headers or not.(boolean value)
@ -178,6 +148,38 @@
# to make nova be a web app using apache mod_wsgi.
# Defaults to '$::nova::params::api_service_name'
#
# DEPRECATED
#
# [*keystone_ec2_url*]
# (optional) DEPRECATED. The keystone url where nova should send requests for ec2tokens
# Defaults to undef
#
# [*volume_api_class*]
# (optional) DEPRECATED. The name of the class that nova will use to access volumes. Cinder is the only option.
# Defaults to undef
#
# [*ec2_listen_port*]
# (optional) DEPRECATED. The port on which the EC2 API will listen.
# Defaults to port undef
#
# [*auth_version*]
# (optional) DEPRECATED. API version of the admin Identity API endpoint
# for example, use 'v3.0' for the keystone version 3.0 api
# Defaults to false
#
# [*osapi_v3*]
# (optional) DEPRECATED. Enable or not Nova API v3
# Defaults to undef
#
# [*ec2_workers*]
# (optional) DEPRECATED. Number of workers for EC2 service
# Defaults to undef
#
# [*conductor_workers*]
# (optional) DEPRECATED. Use workers parameter of nova::conductor
# Class instead.
# Defaults to undef
#
class nova::api(
$admin_password,
$enabled = true,
@ -199,7 +201,6 @@ class nova::api(
$sync_db = true,
$sync_db_api = true,
$neutron_metadata_proxy_shared_secret = undef,
$osapi_v3 = false,
$default_floating_pool = 'nova',
$pci_alias = undef,
$ratelimits = undef,
@ -218,6 +219,7 @@ class nova::api(
$keystone_ec2_url = undef,
$auth_version = false,
$volume_api_class = undef,
$osapi_v3 = undef,
) inherits nova::params {
include ::nova::deps
@ -225,6 +227,10 @@ class nova::api(
include ::nova::policy
include ::cinder::client
if $osapi_v3 {
warning('osapi_v3 is deprecated, has no effect and will be removed in a future release.')
}
if $volume_api_class {
warning('volume_api_class parameter is deprecated, has no effect and will be removed in a future release.')
}
@ -314,7 +320,6 @@ class nova::api(
'DEFAULT/use_forwarded_for': value => $use_forwarded_for;
'DEFAULT/default_floating_pool': value => $default_floating_pool;
'DEFAULT/fping_path': value => $fping_path;
'osapi_v3/enabled': value => $osapi_v3;
}
oslo::middleware {'nova_config':

View File

@ -11,67 +11,25 @@
# (optional) The name of the nova service user
# Defaults to 'nova'
#
# [*auth_name_v3*]
# (optional) The name of the nova v3 service user
# Defaults to 'novav3'
#
# [*service_name*]
# (optional) Name of the service.
# Defaults to the value of auth_name, but must differ from the value
# of service_name_v3.
#
# [*service_name_v3*]
# (optional) Name of the v3 service.
# Defaults to the value of auth_name_v3, but must differ from the value
# of service_name.
# Defaults to the value of auth_name.
#
# [*service_description*]
# (optional) Description for keystone service.
# Defaults to 'Openstack Compute Service'.
#
# [*service_description_v3*]
# (optional) Description for keystone v3 service.
# Defaults to 'Openstack Compute Service v3'.
#
# [*service_description_ec2*]
# (optional) DEPRECATED. Description for keystone ec2 service.
# Defaults to undef.
#
# [*public_url*]
# (optional) The endpoint's public url. (Defaults to 'http://127.0.0.1:8774/v2/%(tenant_id)s')
# This url should *not* contain any version or trailing '/'.
# (optional) The endpoint's public url.
# Defaults to 'http://127.0.0.1:8774/v2.1'
#
# [*internal_url*]
# (optional) The endpoint's internal url. (Defaults to 'http://127.0.0.1:8774/v2/%(tenant_id)s')
# This url should *not* contain any version or trailing '/'.
# (optional) The endpoint's internal url.
# Defaults to 'http://127.0.0.1:8774/v2.1'
#
# [*admin_url*]
# (optional) The endpoint's admin url. (Defaults to 'http://127.0.0.1:8774/v2/%(tenant_id)s')
# This url should *not* contain any version or trailing '/'.
#
# [*public_url_v3*]
# (optional) The v3 endpoint's public url. (Defaults to 'http://127.0.0.1:8774/v3')
# This url should *not* contain any version or trailing '/'.
#
# [*internal_url_v3*]
# (optional) The v3 endpoint's internal url. (Defaults to 'http://127.0.0.1:8774/v3')
# This url should *not* contain any version or trailing '/'.
#
# [*admin_url_v3*]
# (optional) The v3 endpoint's admin url. (Defaults to 'http://127.0.0.1:8774/v3')
# This url should *not* contain any version or trailing '/'.
#
# [*ec2_public_url*]
# (optional) DEPRECATED. The endpoint's public url for EC2.
# Defaults to undef
#
# [*ec2_internal_url*]
# (optional) DEPRECATED. The endpoint's internal url for EC2.
# Defaults to undef
#
# [*ec2_admin_url*]
# (optional) DEPRECATED. The endpoint's admin url for EC2.
# Defaults to undef
# (optional) The endpoint's admin url.
# Defaults to 'http://127.0.0.1:8774/v2.1'
#
# [*region*]
# (optional) The region in which to place the endpoints
@ -85,18 +43,10 @@
# (optional) The email address for the nova service user
# Defaults to 'nova@localhost'
#
# [*configure_ec2_endpoint*]
# (optional) DEPRECATED. Whether to create an ec2 endpoint
# Defaults to undef
#
# [*configure_endpoint*]
# (optional) Whether to create the endpoint.
# Defaults to true
#
# [*configure_endpoint_v3*]
# (optional) Whether to create the v3 endpoint.
# Defaults to true
#
# [*configure_user*]
# (optional) Whether to create the service user.
# Defaults to true
@ -105,128 +55,66 @@
# (optional) Whether to configure the admin role for the service user.
# Defaults to true
#
# [*compute_version*]
# (optional) DEPRECATED: Use public_url, internal_url and admin_url OR
# public_url_v3, internal_url_v3 and admin_url_v3 instead.
# The version of the compute api to put in the endpoint. (Defaults to v2)
# Setting this parameter overrides public_url, internal_url and admin_url parameters.
# DEPRECATED PARAMETERS
#
# [*compute_port*]
# (optional) DEPRECATED: Use public_url, internal_url and admin_url instead.
# Port for endpoint. (Defaults to 9696)
# Setting this parameter overrides public_url, internal_url and admin_url parameters.
# [*public_url_v3*]
# (optional) Deprecated. The v3 endpoint's public url.
# Defaults to undef.
#
# [*ec2_port*]
# (optional) DEPRECATED. The port to use for the ec2 endpoint.
# Defaults to undef
# [*internal_url_v3*]
# (optional) Deprecated. The v3 endpoint's internal url.
# Defaults to undef.
#
# [*public_protocol*]
# (optional) DEPRECATED: Use public_url instead.
# Protocol for public endpoint. (Defaults to 'http')
# Setting this parameter overrides public_url parameter.
# [*admin_url_v3*]
# (optional) DEPRECATED The v3 endpoint's admin url.
# Defaults to undef.
#
# [*public_address*]
# (optional) DEPRECATED: Use public_url instead.
# Public address for endpoint. (Defaults to '127.0.0.1')
# Setting this parameter overrides public_url parameter.
# [*service_description_v3*]
# (optional) Deprecated. Description for keystone v3 service.
# Defaults to undef.
#
# [*internal_protocol*]
# (optional) DEPRECATED: Use internal_url instead.
# Protocol for internal endpoint. (Defaults to 'http')
# Setting this parameter overrides internal_url parameter.
# [*service_name_v3*]
# (optional) Deprecated. Name of the v3 service.
# Defaults to undef.
#
# [*internal_address*]
# (optional) DEPRECATED: Use internal_url instead.
# Internal address for endpoint. (Defaults to '127.0.0.1')
# Setting this parameter overrides internal_url parameter.
# [*auth_name_v3*]
# (optional) Deprecated. The name of the nova v3 service user
# Defaults to undef.
#
# [*admin_protocol*]
# (optional) DEPRECATED: Use admin_url instead.
# Protocol for admin endpoint. (Defaults to 'http')
# Setting this parameter overrides admin_url parameter.
#
# [*admin_address*]
# (optional) DEPRECATED: Use admin_url and ec2_admin_url instead.
# Admin address for endpoint. (Defaults to '127.0.0.1')
# Setting this parameter overrides admin_url parameter.
# [*configure_endpoint_v3*]
# (optional) Deprecated. Whether to create the v3 endpoint.
# Defaults to undef.
#
class nova::keystone::auth(
$password,
$auth_name = 'nova',
$auth_name_v3 = 'novav3',
$service_name = undef,
$service_name_v3 = undef,
$service_description = 'Openstack Compute Service',
$service_description_v3 = 'Openstack Compute Service v3',
$region = 'RegionOne',
$tenant = 'services',
$email = 'nova@localhost',
$public_url = 'http://127.0.0.1:8774/v2/%(tenant_id)s',
$internal_url = 'http://127.0.0.1:8774/v2/%(tenant_id)s',
$admin_url = 'http://127.0.0.1:8774/v2/%(tenant_id)s',
$public_url_v3 = 'http://127.0.0.1:8774/v3',
$internal_url_v3 = 'http://127.0.0.1:8774/v3',
$admin_url_v3 = 'http://127.0.0.1:8774/v3',
$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',
$configure_endpoint = true,
$configure_endpoint_v3 = true,
$configure_user = true,
$configure_user_role = true,
# DEPRECATED PARAMETERS
$compute_version = undef,
$compute_port = undef,
$ec2_port = undef,
$public_protocol = undef,
$public_address = undef,
$admin_protocol = undef,
$admin_address = undef,
$internal_protocol = undef,
$internal_address = undef,
$service_description_ec2 = undef,
$ec2_public_url = undef,
$ec2_internal_url = undef,
$ec2_admin_url = undef,
$configure_ec2_endpoint = undef,
$auth_name_v3 = undef,
$service_description_v3 = undef,
$service_name_v3 = undef,
$public_url_v3 = undef,
$internal_url_v3 = undef,
$admin_url_v3 = undef,
$configure_endpoint_v3 = undef,
) {
include ::nova::deps
if $compute_version {
warning('The compute_version parameter is deprecated, use public_url, internal_url and admin_url instead.')
if $auth_name_v3 or $service_description_v3 or $service_name_v3 or $public_url_v3 or $internal_url_v3 or $admin_url_v3 or $configure_endpoint_v3 {
warning('all parameters related to v3 API in nova::keystone::auth are deprecated, have no effect and will be removed after Newton release.')
}
if $compute_port {
warning('The compute_port parameter is deprecated, use public_url, internal_url and admin_url instead.')
}
if $ec2_port or $service_description_ec2 or $ec2_public_url or $ec2_internal_url or $ec2_admin_url or $configure_ec2_endpoint {
warning('ec2_port, service_description_ec2, ec2_public_url, ec2_internal_url, ec2_admin_url and configure_ec2_endpoint are deprecated and have no effect..')
}
if $public_protocol {
warning('The public_protocol parameter is deprecated, use public_url instead.')
}
if $internal_protocol {
warning('The internal_protocol parameter is deprecated, use internal_url instead.')
}
if $admin_protocol {
warning('The admin_protocol parameter is deprecated, use admin_url instead.')
}
if $public_address {
warning('The public_address parameter is deprecated, use public_url instead.')
}
if $internal_address {
warning('The internal_address parameter is deprecated, use internal_url instead.')
}
if $admin_address {
warning('The admin_address parameter is deprecated, use admin_url instead.')
}
# TODO(mmagr): change default service names according to default_catalog in next (M) cycle
if $service_name == undef {
$real_service_name = $auth_name
@ -235,47 +123,6 @@ class nova::keystone::auth(
$real_service_name = $service_name
}
if $service_name_v3 == undef {
$real_service_name_v3 = $auth_name_v3
warning('Note that service_name_v3 parameter default value will be changed to "Compute Service v3" (according to Keystone default catalog) in a future release. In case you use different value, please update your manifests accordingly.')
} else {
$real_service_name_v3 = $service_name_v3
}
if $real_service_name == $real_service_name_v3 {
fail('nova::keystone::auth parameters service_name and service_name_v3 must be different.')
}
if ($public_protocol or $public_address or $compute_port) {
$public_url_real = sprintf('%s://%s:%s/%s/%%(tenant_id)s',
pick($public_protocol, 'http'),
pick($public_address, '127.0.0.1'),
pick($compute_port, '8774'),
pick($compute_version, 'v2'))
} else {
$public_url_real = $public_url
}
if ($internal_protocol or $internal_address or $compute_port) {
$internal_url_real = sprintf('%s://%s:%s/%s/%%(tenant_id)s',
pick($internal_protocol, 'http'),
pick($internal_address, '127.0.0.1'),
pick($compute_port, '8774'),
pick($compute_version, 'v2'))
} else {
$internal_url_real = $internal_url
}
if ($admin_protocol or $admin_address or $compute_port) {
$admin_url_real = sprintf('%s://%s:%s/%s/%%(tenant_id)s',
pick($admin_protocol, 'http'),
pick($admin_address, '127.0.0.1'),
pick($compute_port, '8774'),
pick($compute_version, 'v2'))
} else {
$admin_url_real = $admin_url
}
if $configure_endpoint {
Keystone_endpoint["${region}/${real_service_name}::compute"] ~> Service <| name == 'nova-api' |>
}
@ -292,23 +139,9 @@ class nova::keystone::auth(
password => $password,
email => $email,
tenant => $tenant,
public_url => $public_url_real,
admin_url => $admin_url_real,
internal_url => $internal_url_real,
public_url => $public_url,
admin_url => $admin_url,
internal_url => $internal_url,
}
keystone::resource::service_identity { "nova v3 service, user ${auth_name_v3}":
configure_user => false,
configure_user_role => false,
configure_endpoint => $configure_endpoint_v3,
configure_service => $configure_endpoint_v3,
service_type => 'computev3',
service_description => $service_description_v3,
service_name => $real_service_name_v3,
region => $region,
auth_name => $auth_name_v3,
public_url => $public_url_v3,
admin_url => $admin_url_v3,
internal_url => $internal_url_v3,
}
}

View File

@ -0,0 +1,3 @@
---
deprecations:
- osapi_v3 parameter is deprecated, has no effect and will be removed in a future release..

View File

@ -0,0 +1,5 @@
---
deprecations:
- In nova::keystone::auth, all parameters related to v3 endpoint are deprecated and have no effect,
since we bumped the default version to v2.1 that is what v3 started out as.
They'll be dropped after Newton cycle.

View File

@ -0,0 +1,3 @@
---
upgrade:
- Change default Nova API endpoints from v2 to v2.1. v2 was deprecated in Liberty and will be removed in Newton.

View File

@ -69,10 +69,6 @@ describe 'nova::api' do
is_expected.to contain_nova_config('oslo_middleware/enable_proxy_headers_parsing').with('value' => '<SERVICE DEFAULT>')
end
it 'do not configure v3 api' do
is_expected.to contain_nova_config('osapi_v3/enabled').with('value' => false)
end
it 'unconfigures neutron_metadata proxy' do
is_expected.to contain_nova_config('neutron/service_metadata_proxy').with(:value => false)
is_expected.to contain_nova_config('neutron/metadata_proxy_shared_secret').with(:ensure => 'absent')
@ -100,9 +96,8 @@ describe 'nova::api' do
:osapi_compute_workers => 1,
:metadata_workers => 2,
:default_floating_pool => 'public',
:osapi_v3 => true,
:pci_alias => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\",\"name\":\"graphic_card\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"name\":\"network_card\"}]",
:enable_proxy_headers_parsing => true
:enable_proxy_headers_parsing => true,
:pci_alias => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\",\"name\":\"graphic_card\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"name\":\"network_card\"}]"
})
end
@ -151,10 +146,6 @@ describe 'nova::api' do
is_expected.to contain_nova_config('oslo_middleware/enable_proxy_headers_parsing').with('value' => true)
end
it 'configure nova api v3' do
is_expected.to contain_nova_config('osapi_v3/enabled').with('value' => true)
end
it 'configures nova pci_alias entries' do
is_expected.to contain_nova_config('DEFAULT/pci_alias').with(
'value' => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\",\"name\":\"graphic_card\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"name\":\"network_card\"}]"

View File

@ -11,12 +11,9 @@ describe 'nova::keystone::auth' do
:region => 'RegionOne',
:tenant => 'services',
:email => 'nova@localhost',
:public_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s',
:internal_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s',
:admin_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s',
:public_url_v3 => 'http://127.0.0.1:8774/v3',
:internal_url_v3 => 'http://127.0.0.1:8774/v3',
:admin_url_v3 => 'http://127.0.0.1:8774/v3' }
: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
@ -36,24 +33,11 @@ describe 'nova::keystone::auth' do
:description => 'Openstack Compute Service'
)}
it { is_expected.to contain_keystone_service('novav3::computev3').with(
:ensure => 'present',
:description => 'Openstack Compute Service v3'
)}
it { is_expected.to contain_keystone_endpoint('RegionOne/nova::compute').with(
:ensure => 'present',
:public_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s',
:admin_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s',
:internal_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s'
)}
it { is_expected.to contain_keystone_endpoint('RegionOne/novav3::computev3').with(
:ensure => 'present',
:public_url => 'http://127.0.0.1:8774/v3',
:admin_url => 'http://127.0.0.1:8774/v3',
:internal_url => 'http://127.0.0.1:8774/v3'
: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
@ -80,61 +64,13 @@ describe 'nova::keystone::auth' do
end
context 'when setting auth_name and auth_name_v3 the same' do
before do
params.merge!(
:auth_name => 'thesame',
:auth_name_v3 => 'thesame',
:service_name => 'nova',
:service_name_v3 => 'novav3',
)
end
it { is_expected.to contain_keystone_user('thesame').with(:ensure => 'present') }
it { is_expected.to contain_keystone_user_role('thesame@services').with(:ensure => 'present') }
it { is_expected.to contain_keystone_service('nova::compute').with(:ensure => 'present') }
it { is_expected.to contain_keystone_service('novav3::computev3').with(:ensure => 'present') }
end
context 'when service_name and service_name_3 the same (by explicitly setting them)' do
before do
params.merge!(
:service_name => 'nova',
:service_name_v3 => 'nova'
)
end
it do
expect { is_expected.to contain_keystone_service('nova') }.to raise_error(Puppet::Error, /service_name and service_name_v3 must be different/)
end
end
context 'when service_name and service_name_3 the same (by implicit declaration via auth_name and auth_name_v3)' do
before do
params.merge!(
:auth_name => 'thesame',
:auth_name_v3 => 'thesame',
)
end
it do
expect { is_expected.to contain_keystone_service('nova::compute') }.to raise_error(Puppet::Error, /service_name and service_name_v3 must be different/)
end
end
context 'when overriding endpoint parameters' do
before do
params.merge!(
:region => 'RegionTwo',
:public_url => 'https://10.0.0.1:9774/v2.2/%(tenant_id)s',
:internal_url => 'https://10.0.0.3:9774/v2.2/%(tenant_id)s',
:admin_url => 'https://10.0.0.2:9774/v2.2/%(tenant_id)s',
:public_url_v3 => 'https://10.0.3.1:9774/v3',
:internal_url_v3 => 'https://10.0.3.3:9774/v3',
:admin_url_v3 => 'https://10.0.3.2:9774/v3',
: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
@ -145,37 +81,6 @@ describe 'nova::keystone::auth' do
:admin_url => params[:admin_url]
)}
it { is_expected.to contain_keystone_endpoint('RegionTwo/novav3::computev3').with(
:ensure => 'present',
:public_url => params[:public_url_v3],
:internal_url => params[:internal_url_v3],
:admin_url => params[:admin_url_v3]
)}
end
context 'when providing deprecated endpoint parameters' do
before do
params.merge!(
:public_address => '10.0.0.1',
:admin_address => '10.0.0.2',
:internal_address => '10.0.0.3',
:compute_port => '9774',
:compute_version => 'v2.2',
:region => 'RegionTwo',
:admin_protocol => 'https',
:internal_protocol => 'https',
:public_protocol => 'https'
)
end
it { is_expected.to contain_keystone_endpoint('RegionTwo/nova::compute').with(
:ensure => 'present',
:public_url => 'https://10.0.0.1:9774/v2.2/%(tenant_id)s',
:admin_url => 'https://10.0.0.2:9774/v2.2/%(tenant_id)s',
:internal_url => 'https://10.0.0.3:9774/v2.2/%(tenant_id)s'
)}
end
describe 'when disabling endpoint configuration' do
@ -239,18 +144,15 @@ describe 'nova::keystone::auth' do
let :params do
{
:service_name => 'nova_service',
:service_name_v3 => 'nova_service_v3',
:password => 'nova_password'
: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_service('nova_service_v3::computev3') }
it { is_expected.to contain_keystone_endpoint('RegionOne/nova_service::compute') }
it { is_expected.to contain_keystone_endpoint('RegionOne/nova_service_v3::computev3') }
end