diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 403c52f7..8fd9fc56 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -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 @@ -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, diff --git a/releasenotes/notes/fix-inconsistent-wsgi-apache-params-491fbe2bccfece96.yaml b/releasenotes/notes/fix-inconsistent-wsgi-apache-params-491fbe2bccfece96.yaml new file mode 100644 index 00000000..cbafd4e1 --- /dev/null +++ b/releasenotes/notes/fix-inconsistent-wsgi-apache-params-491fbe2bccfece96.yaml @@ -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. diff --git a/spec/classes/barbican_wsgi_apache_spec.rb b/spec/classes/barbican_wsgi_apache_spec.rb index 7f3e892c..5bdedad4 100644 --- a/spec/classes/barbican_wsgi_apache_spec.rb +++ b/spec/classes/barbican_wsgi_apache_spec.rb @@ -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