Merge "Migrate instance_name_template to the base class"
This commit is contained in:
@@ -48,10 +48,6 @@
|
|||||||
# (optional) Number of workers for metadata service
|
# (optional) Number of workers for metadata service
|
||||||
# Defaults to $::os_workers
|
# Defaults to $::os_workers
|
||||||
#
|
#
|
||||||
# [*instance_name_template*]
|
|
||||||
# (optional) Template string to be used to generate instance names
|
|
||||||
# Defaults to $::os_service_default
|
|
||||||
#
|
|
||||||
# [*sync_db*]
|
# [*sync_db*]
|
||||||
# (optional) Run nova-manage db sync on api nodes after installing the package.
|
# (optional) Run nova-manage db sync on api nodes after installing the package.
|
||||||
# Defaults to true
|
# Defaults to true
|
||||||
@@ -176,6 +172,10 @@
|
|||||||
# enable this if you have a sanitizing proxy.
|
# enable this if you have a sanitizing proxy.
|
||||||
# Defaults to undef
|
# Defaults to undef
|
||||||
#
|
#
|
||||||
|
# [*instance_name_template*]
|
||||||
|
# (optional) Template string to be used to generate instance names
|
||||||
|
# Defaults to undef
|
||||||
|
#
|
||||||
class nova::api(
|
class nova::api(
|
||||||
$enabled = true,
|
$enabled = true,
|
||||||
$manage_service = true,
|
$manage_service = true,
|
||||||
@@ -191,7 +191,6 @@ class nova::api(
|
|||||||
$sync_db = true,
|
$sync_db = true,
|
||||||
$sync_db_api = true,
|
$sync_db_api = true,
|
||||||
$db_online_data_migrations = false,
|
$db_online_data_migrations = false,
|
||||||
$instance_name_template = $::os_service_default,
|
|
||||||
$service_name = $::nova::params::api_service_name,
|
$service_name = $::nova::params::api_service_name,
|
||||||
$metadata_service_name = $::nova::params::api_metadata_service_name,
|
$metadata_service_name = $::nova::params::api_metadata_service_name,
|
||||||
$enable_proxy_headers_parsing = $::os_service_default,
|
$enable_proxy_headers_parsing = $::os_service_default,
|
||||||
@@ -214,6 +213,7 @@ class nova::api(
|
|||||||
$validate = undef,
|
$validate = undef,
|
||||||
$validation_options = undef,
|
$validation_options = undef,
|
||||||
$use_forwarded_for = undef,
|
$use_forwarded_for = undef,
|
||||||
|
$instance_name_template = undef,
|
||||||
) inherits nova::params {
|
) inherits nova::params {
|
||||||
|
|
||||||
include nova::deps
|
include nova::deps
|
||||||
@@ -238,8 +238,19 @@ class nova::api(
|
|||||||
warning('The use_forwarded_for parameter has been deprecated.')
|
warning('The use_forwarded_for parameter has been deprecated.')
|
||||||
}
|
}
|
||||||
|
|
||||||
nova_config {
|
if $instance_name_template != undef {
|
||||||
'DEFAULT/instance_name_template': value => $instance_name_template;
|
warning("The nova::api::instance_name_template parameter is deprecated. \
|
||||||
|
Use the nova::instance_name_template parameter instead.")
|
||||||
|
nova_config {
|
||||||
|
'DEFAULT/instance_name_template': value => $instance_name_template;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# Try best to clean up the parameter
|
||||||
|
if defined(Class['nova']) and $::nova::instance_name_template == undef {
|
||||||
|
nova_config {
|
||||||
|
'DEFAULT/instance_name_template': value => $::os_service_default;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# enable metadata in eventlet if we do not run metadata via wsgi (nova::metadata)
|
# enable metadata in eventlet if we do not run metadata via wsgi (nova::metadata)
|
||||||
|
@@ -352,6 +352,10 @@
|
|||||||
# (optional) domain to use for building the hostnames
|
# (optional) domain to use for building the hostnames
|
||||||
# Defaults to $::os_service_default
|
# Defaults to $::os_service_default
|
||||||
#
|
#
|
||||||
|
# [*instance_name_template*]
|
||||||
|
# (optional) Template string to be used to generate instance names
|
||||||
|
# Defaults to undef
|
||||||
|
#
|
||||||
# DEPRECATED PARAMETERS
|
# DEPRECATED PARAMETERS
|
||||||
#
|
#
|
||||||
# [*auth_strategy*]
|
# [*auth_strategy*]
|
||||||
@@ -440,6 +444,7 @@ class nova(
|
|||||||
$purge_config = false,
|
$purge_config = false,
|
||||||
$my_ip = $::os_service_default,
|
$my_ip = $::os_service_default,
|
||||||
$dhcp_domain = $::os_service_default,
|
$dhcp_domain = $::os_service_default,
|
||||||
|
$instance_name_template = undef,
|
||||||
# DEPRECATED PARAMETERS
|
# DEPRECATED PARAMETERS
|
||||||
$auth_strategy = undef,
|
$auth_strategy = undef,
|
||||||
$upgrade_level_cert = undef,
|
$upgrade_level_cert = undef,
|
||||||
@@ -572,6 +577,14 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
|
|||||||
'DEFAULT/dhcp_domain': value => $dhcp_domain;
|
'DEFAULT/dhcp_domain': value => $dhcp_domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# TODO(tkajinam): Change the default value to $::os_service_default when we
|
||||||
|
# remove nova::api::instance_name_template after Antelope.
|
||||||
|
if $instance_name_template != undef {
|
||||||
|
nova_config {
|
||||||
|
'DEFAULT/instance_name_template': value => $instance_name_template;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
oslo::messaging::rabbit {'nova_config':
|
oslo::messaging::rabbit {'nova_config':
|
||||||
rabbit_use_ssl => $rabbit_use_ssl,
|
rabbit_use_ssl => $rabbit_use_ssl,
|
||||||
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
|
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
|
||||||
|
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- |
|
||||||
|
The ``nova::api::instance_name_template`` parameter has been deprecated.
|
||||||
|
Use the ``nova::instance_name_template`` parameter instead so that
|
||||||
|
the option is configured for all nova services.
|
@@ -101,6 +101,9 @@ describe 'nova' do
|
|||||||
is_expected.to contain_nova_config('console/ssl_ciphers').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_nova_config('console/ssl_ciphers').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_nova_config('console/ssl_minimum_version').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_nova_config('console/ssl_minimum_version').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value('<SERVICE DEFAULT>')
|
||||||
|
# TODO(tkajinam): Uncomment this when we change default value of
|
||||||
|
# nova::instance_name_template
|
||||||
|
# is_expected.to contain_nova_config('DEFAULT/instance_name_template').with_value('<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -160,7 +163,7 @@ describe 'nova' do
|
|||||||
:console_ssl_ciphers => 'kEECDH+aECDSA+AES:kEECDH+AES+aRSA:kEDH+aRSA+AES',
|
:console_ssl_ciphers => 'kEECDH+aECDSA+AES:kEECDH+AES+aRSA:kEDH+aRSA+AES',
|
||||||
:console_ssl_minimum_version => 'tlsv1_2',
|
:console_ssl_minimum_version => 'tlsv1_2',
|
||||||
:dhcp_domain => 'foo',
|
:dhcp_domain => 'foo',
|
||||||
|
:instance_name_template => 'instance-%08x',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -253,6 +256,7 @@ describe 'nova' do
|
|||||||
is_expected.to contain_nova_config('console/ssl_ciphers').with_value('kEECDH+aECDSA+AES:kEECDH+AES+aRSA:kEDH+aRSA+AES')
|
is_expected.to contain_nova_config('console/ssl_ciphers').with_value('kEECDH+aECDSA+AES:kEECDH+AES+aRSA:kEDH+aRSA+AES')
|
||||||
is_expected.to contain_nova_config('console/ssl_minimum_version').with_value('tlsv1_2')
|
is_expected.to contain_nova_config('console/ssl_minimum_version').with_value('tlsv1_2')
|
||||||
is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value('foo')
|
is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value('foo')
|
||||||
|
is_expected.to contain_nova_config('DEFAULT/instance_name_template').with_value('instance-%08x');
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with multiple notification_driver' do
|
context 'with multiple notification_driver' do
|
||||||
|
Reference in New Issue
Block a user