Merge "Deprecate nova::glance_api_servers, add glance_endpoint_override"

This commit is contained in:
Zuul 2020-02-19 05:38:21 +00:00 committed by Gerrit Code Review
commit 2fe829925c
4 changed files with 38 additions and 14 deletions

View File

@ -53,7 +53,6 @@ class { 'nova':
database_connection => 'mysql://nova:a_big_secret@127.0.0.1/nova?charset=utf8',
api_database_connection => 'mysql://nova:a_big_secret@127.0.0.1/nova_api?charset=utf8',
default_transport_url => 'rabbit://nova:an_even_bigger_secret@127.0.0.1:5672/nova',
glance_api_servers => 'localhost:9292',
}
class { 'nova::compute':
@ -80,12 +79,12 @@ nova is a combination of Puppet manifest and ruby code to delivery configuration
The `nova_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/nova/nova.conf` file.
```puppet
nova_config { 'DEFAULT/glance_api_servers' :
value => 'http://localhost:9292',
nova_config { 'DEFAULT/my_ip' :
value => '192.0.2.1',
}
```
This will write 'http://localhost:9292' in the `[DEFAULT]` section.
This will write 'my_ip=192.0.2.1' in the `[DEFAULT]` section.
##### name

View File

@ -65,9 +65,9 @@
# option.
# Defaults to $::os_service_default
#
# [*glance_api_servers*]
# (optional) List of addresses for api servers.
# Defaults to 'http://localhost:9292'
# [*glance_endpoint_override*]
# (optional) Override the endpoint to use to talk to Glance.
# Defaults to $::os_service_default
#
# [*rabbit_use_ssl*]
# (optional) Boolean. Connect over SSL for RabbitMQ. (boolean value)
@ -419,6 +419,10 @@
# (optional) The strategy to use for auth: noauth or keystone.
# Defaults to undef
#
# [*glance_api_servers*]
# (optional) List of addresses for api servers.
# Defaults to undef
#
class nova(
$ensure_package = 'present',
$database_connection = undef,
@ -436,9 +440,7 @@ class nova(
$default_transport_url = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
$control_exchange = $::os_service_default,
# these glance params should be optional
# this should probably just be configured as a glance client
$glance_api_servers = 'http://localhost:9292',
$glance_endpoint_override = $::os_service_default,
$rabbit_use_ssl = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = $::os_service_default,
$rabbit_heartbeat_rate = $::os_service_default,
@ -512,6 +514,7 @@ class nova(
$image_service = undef,
$notify_on_api_faults = undef,
$auth_strategy = undef,
$glance_api_servers = undef,
) inherits nova::params {
include nova::deps
@ -622,6 +625,9 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
}
if $glance_api_servers {
warning(
'The glance_api_servers parameter is deprecated, and will be removed in a future release.'
)
nova_config { 'glance/api_servers': value => $glance_api_servers }
}
@ -752,6 +758,7 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
'upgrade_levels/intercell': value => $upgrade_level_intercell;
'upgrade_levels/network': value => $upgrade_level_network;
'upgrade_levels/scheduler': value => $upgrade_level_scheduler;
'glance/endpoint_override': value => $glance_endpoint_override;
}
}

View File

@ -0,0 +1,13 @@
---
deprecations:
- |
nova::glance_api_servers has been deprecated. The config option and
behavior of distributing requests round-robin over a list have been
deprecated for removal from nova.
nova::glance_api_endpoint can be used as an alternative in the case
of a single glance endpoint.
features:
- |
nova::glance_api_endpoint has been added. This provides similar
functionality to nova::glance_api_servers for a single glance endpoint
versus a list of glance servers.

View File

@ -27,8 +27,8 @@ describe 'nova' do
:refreshonly => true
)}
it 'configures glance api servers' do
is_expected.to contain_nova_config('glance/api_servers').with_value('http://localhost:9292')
it 'does not configure glance api servers' do
is_expected.to_not contain_nova_config('glance/api_servers')
end
it 'does not configure auth_strategy' do
@ -73,7 +73,8 @@ describe 'nova' do
let :params do
{
:glance_api_servers => 'http://localhost:9292',
:glance_endpoint_override => 'http://localhost:9292',
:glance_api_servers => ['http://localhost:9292', 'http://localhost:9293'],
:default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:rpc_response_timeout => '30',
:control_exchange => 'nova',
@ -123,8 +124,12 @@ describe 'nova' do
})
end
it 'configures glance endpoint_override' do
is_expected.to contain_nova_config('glance/endpoint_override').with_value('http://localhost:9292')
end
it 'configures glance api servers' do
is_expected.to contain_nova_config('glance/api_servers')
is_expected.to contain_nova_config('glance/api_servers').with_value(['http://localhost:9292', 'http://localhost:9293'])
end
it 'configures auth_strategy' do