From e34a4377ed83ed53bfd87e23e3d5477e08622083 Mon Sep 17 00:00:00 2001 From: Oliver Walsh Date: Fri, 14 Feb 2020 15:42:28 +0000 Subject: [PATCH] Deprecate nova::glance_api_servers, add glance_endpoint_override The [glance]api_servers config option is deprecated in nova since I8e3fbc6f8b052ead6e80d4243f76581960210277. The glance_endpoint_override option can be used to override the default glance endpoint. Support for round-robin over a list of glance servers is now deprecated in nova. Change-Id: Ib7fac4f37ef02d8f577abc98e4cc78b750caba54 --- README.md | 7 +++---- manifests/init.pp | 19 +++++++++++++------ ...e_glance_api_servers-ae08e65b7ebac688.yaml | 13 +++++++++++++ spec/classes/nova_init_spec.rb | 13 +++++++++---- 4 files changed, 38 insertions(+), 14 deletions(-) create mode 100644 releasenotes/notes/deprecate_glance_api_servers-ae08e65b7ebac688.yaml diff --git a/README.md b/README.md index cf79ba61d..f05809765 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/manifests/init.pp b/manifests/init.pp index d1ebb347d..90c1f12a6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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; } } diff --git a/releasenotes/notes/deprecate_glance_api_servers-ae08e65b7ebac688.yaml b/releasenotes/notes/deprecate_glance_api_servers-ae08e65b7ebac688.yaml new file mode 100644 index 000000000..833a4e8a1 --- /dev/null +++ b/releasenotes/notes/deprecate_glance_api_servers-ae08e65b7ebac688.yaml @@ -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. diff --git a/spec/classes/nova_init_spec.rb b/spec/classes/nova_init_spec.rb index cc59ec4a3..ead7620c2 100644 --- a/spec/classes/nova_init_spec.rb +++ b/spec/classes/nova_init_spec.rb @@ -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