From a383e17b9755ba4a539f18dc5b4686a58f905f4e Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 23 Apr 2022 00:13:52 +0900 Subject: [PATCH] Do not hard-code default of listen/port parameters The current default values are same as the service defaults, thus can be replaced by $::os_service_default. Change-Id: Iccee55261472221769b549d0617cf1c8bf274e65 --- manifests/api.pp | 16 ++++++++-------- spec/classes/nova_api_spec.rb | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index 942663af4..f31a75e9f 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -22,15 +22,15 @@ # # [*api_bind_address*] # (optional) IP address for nova-api server to listen -# Defaults to '0.0.0.0' +# Defaults to $::os_service_default # # [*metadata_listen*] # (optional) IP address for metadata server to listen -# Defaults to '0.0.0.0' +# Defaults to $::os_service_default # # [*metadata_listen_port*] # (optional) The port on which the metadata API will listen. -# Defaults to 8775 +# Defaults to $::os_service_default # # [*enabled_apis*] # (optional) A list of apis to enable @@ -47,7 +47,7 @@ # # [*osapi_compute_listen_port*] # (optional) The port on which the OpenStack API will listen. -# Defaults to port 8774 +# Defaults to $::os_service_default # # [*metadata_workers*] # (optional) Number of workers for metadata service @@ -195,10 +195,10 @@ class nova::api( $manage_service = true, $api_paste_config = 'api-paste.ini', $ensure_package = 'present', - $api_bind_address = '0.0.0.0', - $osapi_compute_listen_port = 8774, - $metadata_listen = '0.0.0.0', - $metadata_listen_port = 8775, + $api_bind_address = $::os_service_default, + $osapi_compute_listen_port = $::os_service_default, + $metadata_listen = $::os_service_default, + $metadata_listen_port = $::os_service_default, $enabled_apis = ['osapi_compute', 'metadata'], $use_forwarded_for = false, $osapi_compute_workers = $::os_workers, diff --git a/spec/classes/nova_api_spec.rb b/spec/classes/nova_api_spec.rb index dcbf46e9f..2ddbeadfe 100644 --- a/spec/classes/nova_api_spec.rb +++ b/spec/classes/nova_api_spec.rb @@ -47,10 +47,10 @@ describe 'nova::api' do it 'configures various stuff' do is_expected.to contain_nova_config('DEFAULT/instance_name_template').with_value('') is_expected.to contain_nova_config('wsgi/api_paste_config').with_value('api-paste.ini') - is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen').with_value('0.0.0.0') - is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen_port').with_value('8774') - is_expected.to contain_nova_config('DEFAULT/metadata_listen').with_value('0.0.0.0') - is_expected.to contain_nova_config('DEFAULT/metadata_listen_port').with_value('8775') + is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen').with_value('') + is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen_port').with_value('') + is_expected.to contain_nova_config('DEFAULT/metadata_listen').with_value('') + is_expected.to contain_nova_config('DEFAULT/metadata_listen_port').with_value('') is_expected.to contain_nova_config('DEFAULT/osapi_compute_workers').with_value('5') is_expected.to contain_nova_config('DEFAULT/metadata_workers').with_value('5') is_expected.to contain_oslo__middleware('nova_config').with(