Debian: use the new nova-api-metadata service

In Debian, starting with Stein (and in fact, the latest version of
the Nova package for Stein), both nova-api and nova-api-metadata are
now running under UWSGI. This patch makes it possible to use that by
default, instead of Apache, which is a way more convenient than
running over Apache.

Change-Id: Iad05e5dcdd095993c36b1ae8797cc2b9b7c5318b
This commit is contained in:
Thomas Goirand 2019-09-09 12:19:12 +02:00
parent 94dc32066f
commit 2801673c70
3 changed files with 37 additions and 0 deletions

View File

@ -118,6 +118,14 @@
# to make nova be a web app using apache mod_wsgi.
# Defaults to '$::nova::params::api_service_name'
#
# [*metadata_service_name*]
# (optional) Name of the service that will be providing the
# server functionality of nova-api-meatadata.
# If the value is undef, no management of the service will be
# done by puppet. If the value is defined, and manage_service
# is set to true, the service will be managed by Puppet.
# Default to $::nova::params::api_metadata_service_name
#
# [*max_limit*]
# (optional) This option is limit the maximum number of items in a single response.
# Defaults to $::os_service_default
@ -199,6 +207,7 @@ class nova::api(
$validation_options = {},
$instance_name_template = undef,
$service_name = $::nova::params::api_service_name,
$metadata_service_name = $::nova::params::api_metadata_service_name,
$enable_proxy_headers_parsing = $::os_service_default,
$max_request_body_size = $::os_service_default,
$max_limit = $::os_service_default,
@ -291,6 +300,16 @@ as a standalone service, or httpd for being run by a httpd server")
service_name => $::nova::params::api_service_name,
}
if $::nova::params::api_metadata_service_name {
nova::generic_service { 'api-metadata':
enabled => $service_enabled,
manage_service => $manage_service,
ensure_package => $ensure_package,
package_name => $::nova::params::api_package_name,
service_name => $::nova::params::api_metadata_service_name,
}
}
if !$nova_metadata_wsgi_enabled {
nova_config {
'DEFAULT/metadata_workers': value => $metadata_workers;

View File

@ -31,6 +31,7 @@ class nova::params {
$genisoimage_package_name = 'genisoimage'
# service names
$api_service_name = 'openstack-nova-api'
$api_metadata_service_name = undef
$compute_service_name = 'openstack-nova-compute'
$conductor_service_name = 'openstack-nova-conductor'
$libvirt_service_name = 'libvirtd'
@ -107,6 +108,7 @@ class nova::params {
$lock_path = '/var/lock/nova'
case $::os_package_type {
'debian': {
$api_metadata_service_name = 'nova-api-metadata'
$spicehtml5proxy_package_name = 'nova-consoleproxy'
$spicehtml5proxy_service_name = 'nova-spicehtml5proxy'
$vncproxy_package_name = 'nova-consoleproxy'
@ -117,6 +119,7 @@ class nova::params {
$virtlog_service_name = 'virtlogd'
}
default: {
$api_metadata_service_name = undef
$spicehtml5proxy_package_name = 'nova-spiceproxy'
$spicehtml5proxy_service_name = 'nova-spiceproxy'
$vncproxy_package_name = 'nova-novncproxy'

View File

@ -325,6 +325,18 @@ describe 'nova::api' do
end
shared_examples 'nova-api on Debian' do
context 'with default parameters' do
it { is_expected.to contain_service('nova-api- metadata').with(
:name => 'nova-api-metadata',
:ensure => 'running',
:hasstatus => true,
:enable => true,
:tag => 'nova-service',
)}
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
@ -344,6 +356,9 @@ describe 'nova::api' do
end
end
it_behaves_like 'nova-api'
if facts[:os_package_type] == 'debian'
it_behaves_like 'nova-api on Debian'
end
end
end
end