From 53a62cf30903463cd3303dcb0b9ec0da572ceedc Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 14 Jul 2025 23:49:05 +0900 Subject: [PATCH] Deprecate support for bind_host and bind_port These two options were removed from heat, due to removal of standalone api services. Depends-on: https://review.opendev.org/954687 Change-Id: Idec68c0126720bff464a63bec593a162a96667fa Signed-off-by: Takashi Kajinami --- manifests/api.pp | 34 +++++++++---------- manifests/api_cfn.pp | 34 +++++++++---------- ...-standalone-api-opts-251e3b03b7c24c7a.yaml | 2 ++ spec/classes/heat_api_cfn_spec.rb | 7 ++-- spec/classes/heat_api_spec.rb | 7 ++-- 5 files changed, 40 insertions(+), 44 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index 69df0f35..2dcb3a83 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -15,15 +15,6 @@ # (optional) Whether the service should be managed by Puppet. # Defaults to 'true'. # -# [*bind_host*] -# (Optional) Address to bind the server. Useful when -# selecting a particular network interface. -# Defaults to $facts['os_service_default']. -# -# [*bind_port*] -# (Optional) The port on which the server will listen. -# Defaults to $facts['os_service_default']. -# # [*service_name*] # (optional) Name of the service that will be providing the # server functionality of heat-api. @@ -35,6 +26,15 @@ # # == Deprecated Parameters # +# [*bind_host*] +# (Optional) Address to bind the server. Useful when +# selecting a particular network interface. +# Defaults to undef. +# +# [*bind_port*] +# (Optional) The port on which the server will listen. +# Defaults to undef. +# # [*workers*] # (Optional) The number of workers to spawn. # Defaults to undef. @@ -55,10 +55,10 @@ class heat::api ( $package_ensure = 'present', Boolean $manage_service = true, Boolean $enabled = true, - $bind_host = $facts['os_service_default'], - $bind_port = $facts['os_service_default'], $service_name = $::heat::params::api_service_name, # DEPRECATED PARAMETERS + $bind_host = undef, + $bind_port = undef, $workers = undef, $use_ssl = undef, $cert_file = undef, @@ -70,7 +70,10 @@ class heat::api ( include heat::params include heat::policy - ['workers', 'use_ssl', 'cert_file', 'key_file'].each |String $opt| { + [ + 'bind_host', 'bind_port', 'workers', + 'use_ssl', 'cert_file', 'key_file' + ].each |String $opt| { if getvar($opt) != undef { warning("The ${opt} parameter is deprecated and has no effect.") } @@ -126,11 +129,8 @@ running as a standalone service, or httpd for being run by a httpd server") } heat_config { - 'heat_api/bind_host': value => $bind_host; - 'heat_api/bind_port': value => $bind_port; - } - - heat_config { + 'heat_api/bind_host': ensure => absent; + 'heat_api/bind_port': ensure => absent; 'heat_api/workers': ensure => absent; 'heat_api/cert_file': ensure => absent; 'heat_api/key_file': ensure => absent; diff --git a/manifests/api_cfn.pp b/manifests/api_cfn.pp index db9a3664..564480f8 100644 --- a/manifests/api_cfn.pp +++ b/manifests/api_cfn.pp @@ -18,15 +18,6 @@ # (optional) Whether the service should be managed by Puppet. # Defaults to 'true'. # -# [*bind_host*] -# (Optional) Address to bind the server. Useful when -# selecting a particular network interface. -# Defaults to $facts['os_service_default']. -# -# [*bind_port*] -# (Optional) The port on which the server will listen. -# Defaults to $facts['os_service_default']. -# # [*service_name*] # (optional) Name of the service that will be providing the # server functionality of heat-api-cfn. @@ -38,6 +29,15 @@ # # == Deprecated Parameters # +# [*bind_host*] +# (Optional) Address to bind the server. Useful when +# selecting a particular network interface. +# Defaults to undef. +# +# [*bind_port*] +# (Optional) The port on which the server will listen. +# Defaults to undef. +# # [*workers*] # (Optional) The number of workers to spawn. # Defaults to undef. @@ -58,10 +58,10 @@ class heat::api_cfn ( $package_ensure = 'present', Boolean $manage_service = true, Boolean $enabled = true, - $bind_host = $facts['os_service_default'], - $bind_port = $facts['os_service_default'], $service_name = $::heat::params::api_cfn_service_name, # DEPRECATED PARAMETERS + $bind_host = undef, + $bind_port = undef, $workers = undef, $use_ssl = undef, $cert_file = undef, @@ -73,7 +73,10 @@ class heat::api_cfn ( include heat::params include heat::policy - ['workers', 'use_ssl', 'cert_file', 'key_file'].each |String $opt| { + [ + 'bind_host', 'bind_port', 'workers', + 'use_ssl', 'cert_file', 'key_file' + ].each |String $opt| { if getvar($opt) != undef { warning("The ${opt} parameter is deprecated and has no effect.") } @@ -129,11 +132,8 @@ running as a standalone service, or httpd for being run by a httpd server") } heat_config { - 'heat_api_cfn/bind_host': value => $bind_host; - 'heat_api_cfn/bind_port': value => $bind_port; - } - - heat_config { + 'heat_api_cfn/bind_host': ensure => absent; + 'heat_api_cfn/bind_port': ensure => absent; 'heat_api_cfn/workers': ensure => absent; 'heat_api_cfn/cert_file': ensure => absent; 'heat_api_cfn/key_file': ensure => absent; diff --git a/releasenotes/notes/deprecate-standalone-api-opts-251e3b03b7c24c7a.yaml b/releasenotes/notes/deprecate-standalone-api-opts-251e3b03b7c24c7a.yaml index 2f763b04..4073745c 100644 --- a/releasenotes/notes/deprecate-standalone-api-opts-251e3b03b7c24c7a.yaml +++ b/releasenotes/notes/deprecate-standalone-api-opts-251e3b03b7c24c7a.yaml @@ -4,6 +4,8 @@ deprecations: The following parameters of the ``heat::api`` class and the ``heat::api_cfg`` class have been deprecated and has no effect now. + - ``bind_host`` + - ``bind_port`` - ``workers`` - ``use_ssl`` - ``cert_file`` diff --git a/spec/classes/heat_api_cfn_spec.rb b/spec/classes/heat_api_cfn_spec.rb index aa343227..36fd6f87 100644 --- a/spec/classes/heat_api_cfn_spec.rb +++ b/spec/classes/heat_api_cfn_spec.rb @@ -6,8 +6,6 @@ describe 'heat::api_cfn' do { :enabled => true, :manage_service => true, - :bind_host => '127.0.0.1', - :bind_port => '1234', } end @@ -24,9 +22,8 @@ describe 'heat::api_cfn' do it { is_expected.to contain_class('heat::params') } it { is_expected.to contain_class('heat::policy') } - it { is_expected.to contain_heat_config('heat_api_cfn/bind_host').with_value( params[:bind_host] ) } - it { is_expected.to contain_heat_config('heat_api_cfn/bind_port').with_value( params[:bind_port] ) } - + it { is_expected.to contain_heat_config('heat_api_cfn/bind_host').with_ensure('absent') } + it { is_expected.to contain_heat_config('heat_api_cfn/bind_port').with_ensure('absent') } it { is_expected.to contain_heat_config('heat_api_cfn/workers').with_ensure('absent') } it { is_expected.to contain_heat_config('heat_api_cfn/cert_file').with_ensure('absent') } it { is_expected.to contain_heat_config('heat_api_cfn/key_file').with_ensure('absent') } diff --git a/spec/classes/heat_api_spec.rb b/spec/classes/heat_api_spec.rb index 84e3042b..66d41881 100644 --- a/spec/classes/heat_api_spec.rb +++ b/spec/classes/heat_api_spec.rb @@ -6,8 +6,6 @@ describe 'heat::api' do { :enabled => true, :manage_service => true, - :bind_host => '127.0.0.1', - :bind_port => '1234', } end @@ -24,9 +22,8 @@ describe 'heat::api' do it { is_expected.to contain_class('heat::params') } it { is_expected.to contain_class('heat::policy') } - it { is_expected.to contain_heat_config('heat_api/bind_host').with_value( params[:bind_host] ) } - it { is_expected.to contain_heat_config('heat_api/bind_port').with_value( params[:bind_port] ) } - + it { is_expected.to contain_heat_config('heat_api/bind_host').with_ensure('absent') } + it { is_expected.to contain_heat_config('heat_api/bind_port').with_ensure('absent') } it { is_expected.to contain_heat_config('heat_api/workers').with_ensure('absent') } it { is_expected.to contain_heat_config('heat_api/cert_file').with_ensure('absent') } it { is_expected.to contain_heat_config('heat_api/key_file').with_ensure('absent') }