diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 3b497ff7..441d7bb8 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -115,30 +115,36 @@ # (optional) The source of the WSGI script. # Defaults to undef # +# [*vhost_custom_fragment*] +# (optional) Passes a string of custom configuration +# directives to be placed at the end of the vhost configuration. +# Defaults to undef. +# define openstacklib::wsgi::apache ( - $service_name = $name, - $bind_host = undef, - $bind_port = undef, - $group = undef, - $path = '/', - $priority = '10', - $servername = $::fqdn, - $ssl = false, - $ssl_ca = undef, - $ssl_cert = undef, - $ssl_certs_dir = undef, - $ssl_chain = undef, - $ssl_crl = undef, - $ssl_crl_path = undef, - $ssl_key = undef, - $threads = $::processorcount, - $user = undef, - $workers = 1, - $wsgi_daemon_process = $name, - $wsgi_process_group = $name, - $wsgi_script_dir = undef, - $wsgi_script_file = undef, - $wsgi_script_source = undef, + $service_name = $name, + $bind_host = undef, + $bind_port = undef, + $group = undef, + $path = '/', + $priority = '10', + $servername = $::fqdn, + $ssl = false, + $ssl_ca = undef, + $ssl_cert = undef, + $ssl_certs_dir = undef, + $ssl_chain = undef, + $ssl_crl = undef, + $ssl_crl_path = undef, + $ssl_key = undef, + $threads = $::processorcount, + $user = undef, + $workers = 1, + $wsgi_daemon_process = $name, + $wsgi_process_group = $name, + $wsgi_script_dir = undef, + $wsgi_script_file = undef, + $wsgi_script_source = undef, + $vhost_custom_fragment = undef, ) { include ::apache @@ -198,6 +204,7 @@ define openstacklib::wsgi::apache ( wsgi_daemon_process_options => $wsgi_daemon_process_options, wsgi_process_group => $wsgi_process_group, wsgi_script_aliases => $wsgi_script_aliases, + custom_fragment => $vhost_custom_fragment, require => File[$service_name], } diff --git a/spec/defines/openstacklib_wsgi_apache_spec.rb b/spec/defines/openstacklib_wsgi_apache_spec.rb index 15bd3f0b..9863b01b 100644 --- a/spec/defines/openstacklib_wsgi_apache_spec.rb +++ b/spec/defines/openstacklib_wsgi_apache_spec.rb @@ -86,6 +86,43 @@ describe 'openstacklib::wsgi::apache' do it { is_expected.to contain_file("#{platform_parameters[:httpd_ports_file]}") } end + describe 'when overriding parameters' do + let :params do + { + :wsgi_script_dir => '/var/www/cgi-bin/keystone', + :wsgi_script_file => 'main', + :wsgi_script_source => '/usr/share/keystone/keystone.wsgi', + :servername => 'dummy.host', + :bind_host => '10.42.51.1', + :bind_port => 4142, + :user => 'keystone', + :group => 'keystone', + :ssl => false, + :workers => 37, + :vhost_custom_fragment => 'LimitRequestFieldSize 81900' + } + end + it { is_expected.to contain_apache__vhost('keystone_wsgi').with( + 'servername' => 'dummy.host', + 'ip' => '10.42.51.1', + 'port' => '4142', + 'docroot' => "/var/www/cgi-bin/keystone", + 'ssl' => 'false', + 'wsgi_daemon_process' => 'keystone_wsgi', + 'wsgi_daemon_process_options' => { + 'user' => 'keystone', + 'group' => 'keystone', + 'processes' => '37', + 'threads' => '42', + }, + 'wsgi_process_group' => 'keystone_wsgi', + 'wsgi_script_aliases' => { '/' => "/var/www/cgi-bin/keystone/main" }, + 'require' => 'File[keystone_wsgi]', + 'custom_fragment' => 'LimitRequestFieldSize 81900', + )} + + end + end context 'on RedHat platforms' do