Fix inconsistent parameter/resource names of wsgi::apache

The barbican::wsgi::apache class names a few parameters and resources
differently from the other modules. To make its interface and
implementation consistent with the other implementations, this renames
these inconsistent names. The old parameter names are kept but will be
removed in a future release.

Change-Id: I49ca51e4ea7a2404dfdbd0c88ce39339750da4f6
This commit is contained in:
Takashi Kajinami 2022-08-26 15:10:59 +09:00
parent 5b21717a19
commit eb2b84ea8f
3 changed files with 46 additions and 17 deletions

View File

@ -13,16 +13,16 @@
# (Optional) The servername for the virtualhost.
# Defaults to $::fqdn
#
# [*public_port*]
# (Optional) The public port.
# [*port*]
# (Optional) The port.
# Defaults to 9311
#
# [*bind_host*]
# (Optional) The host/ip address Apache will listen on.
# Defaults to undef (listen on all ip addresses).
#
# [*public_path*]
# (Optional) The prefix for the public endpoint.
# [*path*]
# (Optional) The prefix for the endpoint.
# Defaults to '/'
#
# [*ssl*]
@ -106,6 +106,16 @@
# directives to be placed at the end of the vhost configuration.
# Defaults to undef.
#
# DEPRECATED PARAMETERS
#
# [*public_port*]
# (Optional) The public port.
# Defaults to undef
#
# [*public_path*]
# (Optional) The prefix for the public endpoint.
# Defaults to undef
#
# == Authors
#
# Ade Lee <alee@redhat.com>
@ -116,9 +126,9 @@
#
class barbican::wsgi::apache (
$servername = $::fqdn,
$public_port = 9311,
$port = 9311,
$bind_host = undef,
$public_path = '/',
$path = '/',
$ssl = false,
$workers = $::os_workers,
$ssl_cert = undef,
@ -142,6 +152,9 @@ class barbican::wsgi::apache (
$headers = undef,
$request_headers = undef,
$vhost_custom_fragment = undef,
# DEPRECATED PARAMETERS
$public_port = undef,
$public_path = undef
) {
include barbican::deps
@ -149,11 +162,18 @@ class barbican::wsgi::apache (
Anchor['barbican::install::end'] -> Class['apache']
openstacklib::wsgi::apache { 'barbican_wsgi_main':
if $public_port {
warning('The public_port parameter is deprecated. Use the port parameter')
}
if $public_path {
warning('The public_path parameter is deprecated. Use the path parameter')
}
openstacklib::wsgi::apache { 'barbican_wsgi':
bind_host => $bind_host,
bind_port => $public_port,
bind_port => pick($public_port, $port),
group => $::barbican::params::group,
path => $public_path,
path => pick($public_path, $path),
priority => $priority,
servername => $servername,
ssl => $ssl,

View File

@ -0,0 +1,9 @@
---
deprecations:
- |
The ``barbican::wsgi::apache::public_port`` parameter has been deprecated.
Use the ``port`` prameter instead.
- |
The ``barbican::wsgi::apache::public_path`` parameter has been deprecated.
Use the ``path`` prameter instead.

View File

@ -24,7 +24,7 @@ describe 'barbican::wsgi::apache' do
shared_examples_for 'apache serving barbican with mod_wsgi' do
context 'with default parameters' do
it { is_expected.to contain_class('barbican::params') }
it { is_expected.to contain_openstacklib__wsgi__apache('barbican_wsgi_main').with(
it { is_expected.to contain_openstacklib__wsgi__apache('barbican_wsgi').with(
:bind_port => 9311,
:group => 'barbican',
:path => '/',
@ -57,7 +57,7 @@ describe 'barbican::wsgi::apache' do
{
:servername => 'dummy.host',
:bind_host => '10.42.51.1',
:public_port => 12345,
:port => 12345,
:ssl => true,
:wsgi_process_display_name => 'barbican-api',
:workers => 37,
@ -70,7 +70,7 @@ describe 'barbican::wsgi::apache' do
}
end
it { is_expected.to contain_class('barbican::params') }
it { is_expected.to contain_openstacklib__wsgi__apache('barbican_wsgi_main').with(
it { is_expected.to contain_openstacklib__wsgi__apache('barbican_wsgi').with(
:bind_host => '10.42.51.1',
:bind_port => 12345,
:group => 'barbican',
@ -104,7 +104,7 @@ describe 'barbican::wsgi::apache' do
}
end
it { should contain_openstacklib__wsgi__apache('barbican_wsgi_main').with(
it { should contain_openstacklib__wsgi__apache('barbican_wsgi').with(
:access_log_format => params[:access_log_format],
:access_log_syslog => params[:access_log_syslog],
:error_log_syslog => params[:error_log_syslog],
@ -118,7 +118,7 @@ describe 'barbican::wsgi::apache' do
}
end
it { should contain_openstacklib__wsgi__apache('barbican_wsgi_main').with(
it { should contain_openstacklib__wsgi__apache('barbican_wsgi').with(
:access_log_file => params[:access_log_file],
)}
end
@ -130,7 +130,7 @@ describe 'barbican::wsgi::apache' do
}
end
it { should contain_openstacklib__wsgi__apache('barbican_wsgi_main').with(
it { should contain_openstacklib__wsgi__apache('barbican_wsgi').with(
:access_log_pipe => params[:access_log_pipe],
)}
end
@ -142,7 +142,7 @@ describe 'barbican::wsgi::apache' do
}
end
it { should contain_openstacklib__wsgi__apache('barbican_wsgi_main').with(
it { should contain_openstacklib__wsgi__apache('barbican_wsgi').with(
:error_log_file => params[:error_log_file],
)}
end
@ -154,7 +154,7 @@ describe 'barbican::wsgi::apache' do
}
end
it { should contain_openstacklib__wsgi__apache('barbican_wsgi_main').with(
it { should contain_openstacklib__wsgi__apache('barbican_wsgi').with(
:error_log_pipe => params[:error_log_pipe],
)}
end