Add nova::metadata::dhcp_domain

The dhcp_domain setting is not deprecated, however the old
DEFAULT/dhcp_domain setting was because it was moved to api/dhcp_domain.
nova::network::neutron::dhcp_domain will be removed later in the cycle.

Change-Id: I4ce56dc7ee66fc40e5a9a53692c01a5e0f13d633
This commit is contained in:
Alex Schultz 2019-05-22 08:33:47 -06:00
parent a738129d22
commit de78491ebd
6 changed files with 36 additions and 7 deletions

View File

@ -33,6 +33,10 @@
# service.
# Defaults to $::os_service_default
#
# [*dhcp_domain*]
# (optional) domain to use for building the hostnames
# Defaults to $::os_service_default
#
# DEPRECATED
#
# [*vendordata_jsonfile_path*]
@ -107,6 +111,7 @@ class nova::metadata(
$enable_proxy_headers_parsing = $::os_service_default,
$metadata_cache_expiration = $::os_service_default,
$local_metadata_per_cell = $::os_service_default,
$dhcp_domain = $::os_service_default,
# DEPRECATED PARAMETERS
$vendordata_jsonfile_path = undef,
$vendordata_providers = undef,
@ -148,6 +153,17 @@ class nova::metadata(
vendordata_caller => 'metadata',
}
# TODO(mwhahaha): backwards compatibility until we drop it from
# nova::network::network
if defined('$::nova::neutron::dhcp_domain') and $::nova::neutron::dhcp_domain != undef {
$dhcp_domain_real = $::nova::neutron::dhcp_domain
} else {
$dhcp_domain_real = $dhcp_domain
}
ensure_resource('nova_config', 'api/dhcp_domain', {
value => $dhcp_domain_real
})
nova_config {
'DEFAULT/enabled_apis': value => $enabled_apis;
'api/metadata_cache_expiration': value => $metadata_cache_expiration;

View File

@ -139,13 +139,17 @@ class nova::network::neutron (
warning('nova::network::neutron::firewall_driver is deprecated and will be removed in a future release')
}
if $dhcp_domain {
warning('nova::network::neutron::dhcp_domain is deprecated and will be removed in a future release')
# TODO(mwhahaha): remove me when tripleo switches to use the metadata version
# of dhcp_domain
if $dhcp_domain != undef {
ensure_resource('nova_config', 'api/dhcp_domain', {
value => $dhcp_domain
})
}
# TODO(tobias-urdin): Remove these in the T release.
nova_config {
'DEFAULT/dhcp_domain': value => $dhcp_domain;
'DEFAULT/firewall_driver': value => $firewall_driver;
}

View File

@ -0,0 +1,6 @@
---
features:
- |
`nova::metadata::dhcp_domain` has been added back to configure
api/dhcp_domain. `nova::network::neutron::dhcp_domain` has been removed
and the metadata version of the variable should be used instead.

View File

@ -101,8 +101,8 @@ describe 'nova::api' do
:vendordata_jsonfile_path => '/tmp',
:vendordata_providers => ['StaticJSON', 'DynamicJSON'],
:vendordata_dynamic_targets => ['join@http://127.0.0.1:9999/v1/'],
:vendordata_dynamic_connect_timeout => 30,
:vendordata_dynamic_read_timeout => 30,
:vendordata_dynamic_connect_timeout => 30,
:vendordata_dynamic_read_timeout => 30,
:vendordata_dynamic_failure_fatal => false,
:vendordata_dynamic_auth_auth_type => 'password',
:vendordata_dynamic_auth_auth_url => 'http://127.0.0.1:5000',
@ -111,7 +111,7 @@ describe 'nova::api' do
:vendordata_dynamic_auth_project_domain_name => 'Default',
:vendordata_dynamic_auth_project_name => 'project',
:vendordata_dynamic_auth_user_domain_name => 'Default',
:vendordata_dynamic_auth_username => 'user',
:vendordata_dynamic_auth_username => 'user',
})
end

View File

@ -27,6 +27,7 @@ describe 'nova::metadata' do
)
is_expected.to contain_nova_config('api/metadata_cache_expiration').with('value' => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('api/local_metadata_per_cell').with('value' => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('api/dhcp_domain').with('value' => '<SERVICE DEFAULT>')
end
it 'unconfigures neutron_metadata proxy' do
@ -42,6 +43,7 @@ describe 'nova::metadata' do
:enable_proxy_headers_parsing => true,
:local_metadata_per_cell => true,
:metadata_cache_expiration => 15,
:dhcp_domain => 'foo',
:vendordata_jsonfile_path => '/tmp',
:vendordata_providers => ['StaticJSON', 'DynamicJSON'],
:vendordata_dynamic_targets => ['join@http://127.0.0.1:9999/v1/'],
@ -68,6 +70,7 @@ describe 'nova::metadata' do
is_expected.to contain_nova_config('api/vendordata_dynamic_connect_timeout').with('value' => '30')
is_expected.to contain_nova_config('api/vendordata_dynamic_read_timeout').with('value' => '30')
is_expected.to contain_nova_config('api/vendordata_dynamic_failure_fatal').with('value' => false)
is_expected.to contain_nova_config('api/dhcp_domain').with('value' => 'foo')
is_expected.to contain_nova_config('neutron/service_metadata_proxy').with('value' => true)
is_expected.to contain_nova_config('neutron/metadata_proxy_shared_secret').with('value' => 'secrete').with_secret(true)
is_expected.to contain_oslo__middleware('nova_config').with(

View File

@ -105,7 +105,7 @@ describe 'nova::network::neutron' do
end
it 'configures neutron endpoint in nova.conf' do
should contain_nova_config('DEFAULT/dhcp_domain').with_value(params[:dhcp_domain])
should contain_nova_config('api/dhcp_domain').with_value(params[:dhcp_domain])
should contain_nova_config('neutron/url').with_value(params[:neutron_url])
should contain_nova_config('neutron/timeout').with_value(params[:neutron_url_timeout])
end