diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index c673f9e5f..492a1499a 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -68,6 +68,14 @@ # apache::vhost ssl parameters. # Optional. Default to apache::vhost 'ssl_*' defaults. # +# [*custom_wsgi_process_options*] +# (optional) gives you the oportunity to add custom process options or to +# overwrite the default options for the WSGI main process. +# eg. to use a virtual python environment for the WSGI process +# you could set it to: +# { python-path => '/my/python/virtualenv' } +# Defaults to {} +# # == Dependencies # # requires Class['apache'] & Class['neutron'] @@ -79,22 +87,23 @@ # class { 'neutron::wsgi::apache': } # class neutron::wsgi::apache ( - $servername = $::fqdn, - $port = 9696, - $bind_host = undef, - $path = '/', - $ssl = true, - $workers = $::os_workers, - $ssl_cert = undef, - $ssl_key = undef, - $ssl_chain = undef, - $ssl_ca = undef, - $ssl_crl_path = undef, - $ssl_crl = undef, - $ssl_certs_dir = undef, - $wsgi_process_display_name = undef, - $threads = 1, - $priority = '10', + $servername = $::fqdn, + $port = 9696, + $bind_host = undef, + $path = '/', + $ssl = true, + $workers = $::os_workers, + $ssl_cert = undef, + $ssl_key = undef, + $ssl_chain = undef, + $ssl_ca = undef, + $ssl_crl_path = undef, + $ssl_crl = undef, + $ssl_certs_dir = undef, + $wsgi_process_display_name = undef, + $threads = 1, + $priority = '10', + $custom_wsgi_process_options = {}, ) { include ::neutron::deps @@ -126,28 +135,29 @@ class neutron::wsgi::apache ( ~> Service['httpd'] ::openstacklib::wsgi::apache { 'neutron_wsgi': - bind_host => $bind_host, - bind_port => $port, - group => 'neutron', - path => $path, - priority => $priority, - servername => $servername, - ssl => $ssl, - ssl_ca => $ssl_ca, - ssl_cert => $ssl_cert, - ssl_certs_dir => $ssl_certs_dir, - ssl_chain => $ssl_chain, - ssl_crl => $ssl_crl, - ssl_crl_path => $ssl_crl_path, - ssl_key => $ssl_key, - threads => $threads, - user => 'neutron', - workers => $workers, - wsgi_daemon_process => 'neutron', - wsgi_process_display_name => $wsgi_process_display_name, - wsgi_process_group => 'neutron', - wsgi_script_dir => $::neutron::params::neutron_wsgi_script_path, - wsgi_script_file => 'app', - wsgi_script_source => $::neutron::params::neutron_wsgi_script_source, + bind_host => $bind_host, + bind_port => $port, + group => 'neutron', + path => $path, + priority => $priority, + servername => $servername, + ssl => $ssl, + ssl_ca => $ssl_ca, + ssl_cert => $ssl_cert, + ssl_certs_dir => $ssl_certs_dir, + ssl_chain => $ssl_chain, + ssl_crl => $ssl_crl, + ssl_crl_path => $ssl_crl_path, + ssl_key => $ssl_key, + threads => $threads, + user => 'neutron', + workers => $workers, + wsgi_daemon_process => 'neutron', + wsgi_process_display_name => $wsgi_process_display_name, + wsgi_process_group => 'neutron', + wsgi_script_dir => $::neutron::params::neutron_wsgi_script_path, + wsgi_script_file => 'app', + wsgi_script_source => $::neutron::params::neutron_wsgi_script_source, + custom_wsgi_process_options => $custom_wsgi_process_options, } } diff --git a/releasenotes/notes/wsgi_process_options-b1861c6dbc1d9d23.yaml b/releasenotes/notes/wsgi_process_options-b1861c6dbc1d9d23.yaml new file mode 100644 index 000000000..2ad68c680 --- /dev/null +++ b/releasenotes/notes/wsgi_process_options-b1861c6dbc1d9d23.yaml @@ -0,0 +1,4 @@ +--- +features: + - Add parameter to apacher_wsgi to allow overwrite + and/or add additional wsgi process options. diff --git a/spec/classes/neutron_wsgi_apache_spec.rb b/spec/classes/neutron_wsgi_apache_spec.rb index faadf075e..1edc4c376 100644 --- a/spec/classes/neutron_wsgi_apache_spec.rb +++ b/spec/classes/neutron_wsgi_apache_spec.rb @@ -9,19 +9,20 @@ describe 'neutron::wsgi::apache' do it { is_expected.to contain_class('apache::mod::wsgi') } it { is_expected.to contain_class('apache::mod::ssl') } it { is_expected.to contain_openstacklib__wsgi__apache('neutron_wsgi').with( - :bind_port => 9696, - :group => 'neutron', - :path => '/', - :servername => facts[:fqdn], - :ssl => true, - :threads => 1, - :user => 'neutron', - :workers => facts[:os_workers], - :wsgi_daemon_process => 'neutron', - :wsgi_process_group => 'neutron', - :wsgi_script_dir => platform_params[:wsgi_script_path], - :wsgi_script_file => 'app', - :wsgi_script_source => platform_params[:wsgi_script_source], + :bind_port => 9696, + :group => 'neutron', + :path => '/', + :servername => facts[:fqdn], + :ssl => true, + :threads => 1, + :user => 'neutron', + :workers => facts[:os_workers], + :wsgi_daemon_process => 'neutron', + :wsgi_process_group => 'neutron', + :wsgi_script_dir => platform_params[:wsgi_script_path], + :wsgi_script_file => 'app', + :wsgi_script_source => platform_params[:wsgi_script_source], + :custom_wsgi_process_options => {}, )} end @@ -34,6 +35,9 @@ describe 'neutron::wsgi::apache' do :ssl => false, :wsgi_process_display_name => 'neutron', :workers => 37, + :custom_wsgi_process_options => { + 'python_path' => '/my/python/path', + }, } end it { is_expected.to contain_class('neutron::params') } @@ -41,21 +45,24 @@ describe 'neutron::wsgi::apache' do it { is_expected.to contain_class('apache::mod::wsgi') } it { is_expected.to_not contain_class('apache::mod::ssl') } it { is_expected.to contain_openstacklib__wsgi__apache('neutron_wsgi').with( - :bind_host => '10.42.51.1', - :bind_port => 12345, - :group => 'neutron', - :path => '/', - :servername => 'dummy.host', - :ssl => false, - :threads => 1, - :user => 'neutron', - :workers => 37, - :wsgi_daemon_process => 'neutron', - :wsgi_process_display_name => 'neutron', - :wsgi_process_group => 'neutron', - :wsgi_script_dir => platform_params[:wsgi_script_path], - :wsgi_script_file => 'app', - :wsgi_script_source => platform_params[:wsgi_script_source], + :bind_host => '10.42.51.1', + :bind_port => 12345, + :group => 'neutron', + :path => '/', + :servername => 'dummy.host', + :ssl => false, + :threads => 1, + :user => 'neutron', + :workers => 37, + :wsgi_daemon_process => 'neutron', + :wsgi_process_display_name => 'neutron', + :wsgi_process_group => 'neutron', + :wsgi_script_dir => platform_params[:wsgi_script_path], + :wsgi_script_file => 'app', + :wsgi_script_source => platform_params[:wsgi_script_source], + :custom_wsgi_process_options => { + 'python_path' => '/my/python/path', + }, )} end end