diff --git a/manifests/init.pp b/manifests/init.pp index 4c5707d38..440593c4c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -355,6 +355,10 @@ # (optional) Allow attach between instance and volume in different availability zones. # Defaults to $::os_service_default # +# [*dhcp_domain*] +# (optional) domain to use for building the hostnames +# Defaults to $::os_service_default +# # DEPRECATED PARAMETERS # # [*auth_strategy*] @@ -502,6 +506,7 @@ class nova( $purge_config = false, $my_ip = $::os_service_default, $cross_az_attach = $::os_service_default, + $dhcp_domain = $::os_service_default, # DEPRECATED PARAMETERS $auth_strategy = undef, $glance_api_servers = undef, @@ -691,6 +696,8 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.") nova_config { 'api/auth_strategy': value => $auth_strategy } } + $dhcp_domain_real = pick($::nova::metadata::dhcp_domain, $dhcp_domain) + nova_config { 'DEFAULT/ssl_only': value => $ssl_only; 'DEFAULT/cert': value => $cert; @@ -702,6 +709,7 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.") 'DEFAULT/cpu_allocation_ratio': value => $cpu_allocation_ratio; 'DEFAULT/ram_allocation_ratio': value => $ram_allocation_ratio; 'DEFAULT/disk_allocation_ratio': value => $disk_allocation_ratio; + 'DEFAULT/dhcp_domain': value => $dhcp_domain_real; } oslo::messaging::rabbit {'nova_config': diff --git a/manifests/metadata.pp b/manifests/metadata.pp index 8e5362f27..f2341ae2e 100644 --- a/manifests/metadata.pp +++ b/manifests/metadata.pp @@ -24,11 +24,11 @@ # service. # Defaults to $::os_service_default # +# DEPRECATED +# # [*dhcp_domain*] # (optional) domain to use for building the hostnames -# Defaults to $::os_service_default -# -# DEPRECATED +# Defaults to undef. # # [*enabled_apis*] # (optional) A list of apis to enable @@ -47,8 +47,8 @@ class nova::metadata( $neutron_metadata_proxy_shared_secret = undef, $metadata_cache_expiration = $::os_service_default, $local_metadata_per_cell = $::os_service_default, - $dhcp_domain = $::os_service_default, # DEPRECATED PARAMETERS + $dhcp_domain = undef, $enabled_apis = undef, $enable_proxy_headers_parsing = undef, $max_request_body_size = undef, @@ -70,9 +70,11 @@ and will be removed in the future. Please use the one ::nova::api.') warning('max_request_body_size in ::nova::metadata is deprecated, has no effect \ and will be removed in the future. Please use the one ::nova::api.') } + if $dhcp_domain { + warning('dhcp_domain in nova::metadata is deprecated, use nova::dhcp_domain instead.') + } nova_config { - 'api/dhcp_domain': value => $dhcp_domain; 'api/metadata_cache_expiration': value => $metadata_cache_expiration; 'api/local_metadata_per_cell': value => $local_metadata_per_cell; } diff --git a/releasenotes/notes/deprecate-metadata-dhcp_domain-963c644692f72ede.yaml b/releasenotes/notes/deprecate-metadata-dhcp_domain-963c644692f72ede.yaml new file mode 100644 index 000000000..760472f4f --- /dev/null +++ b/releasenotes/notes/deprecate-metadata-dhcp_domain-963c644692f72ede.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + The nova::metadata::dhcp_domain paramater has been deprecated by + nova::dhcp_domain as the nova config option is also required for + nova-compute. + [Bug `1903908 `_] + diff --git a/spec/classes/nova_init_spec.rb b/spec/classes/nova_init_spec.rb index fdde4a3fb..d02c28b58 100644 --- a/spec/classes/nova_init_spec.rb +++ b/spec/classes/nova_init_spec.rb @@ -66,6 +66,7 @@ describe 'nova' do is_expected.to contain_nova_config('DEFAULT/key').with_value('') is_expected.to contain_nova_config('console/ssl_ciphers').with_value('') is_expected.to contain_nova_config('console/ssl_minimum_version').with_value('') + is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value('') end it 'configures block_device_allocate params' do @@ -116,6 +117,8 @@ describe 'nova' do :key => '/etc/ssl/certs/snakeoil.pem', :console_ssl_ciphers => 'kEECDH+aECDSA+AES:kEECDH+AES+aRSA:kEDH+aRSA+AES', :console_ssl_minimum_version => 'tlsv1_2', + :dhcp_domain => 'foo', + } end @@ -187,6 +190,7 @@ describe 'nova' do is_expected.to contain_nova_config('DEFAULT/key').with_value('/etc/ssl/certs/snakeoil.pem') 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('DEFAULT/dhcp_domain').with_value('foo') end context 'with multiple notification_driver' do diff --git a/spec/classes/nova_metadata_spec.rb b/spec/classes/nova_metadata_spec.rb index cf129952f..443bd392a 100644 --- a/spec/classes/nova_metadata_spec.rb +++ b/spec/classes/nova_metadata_spec.rb @@ -22,7 +22,7 @@ describe 'nova::metadata' do it 'configures various stuff' do is_expected.to contain_nova_config('api/metadata_cache_expiration').with('value' => '') is_expected.to contain_nova_config('api/local_metadata_per_cell').with('value' => '') - is_expected.to contain_nova_config('api/dhcp_domain').with('value' => '') + is_expected.to_not contain_nova_config('api/dhcp_domain') end it 'unconfigures neutron_metadata proxy' do @@ -44,7 +44,7 @@ describe 'nova::metadata' do it 'configures various stuff' do is_expected.to contain_nova_config('api/local_metadata_per_cell').with('value' => true) is_expected.to contain_nova_config('api/metadata_cache_expiration').with('value' => '15') - is_expected.to contain_nova_config('api/dhcp_domain').with('value' => 'foo') + is_expected.to_not contain_nova_config('api/dhcp_domain') 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) end