diff --git a/manifests/init.pp b/manifests/init.pp index 9db6f00c..a4d1f757 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -207,8 +207,16 @@ # [*horizon_ca*] # (required with listen_ssl) CA certificate to use for SSL support. # +# [*wsgi_processes*] +# (optional) Number of Horizon processes to spawn +# Defaults to $::os_workers +# +# [*wsgi_threads*] +# (optional) Number of thread to run in a Horizon process +# Defaults to '1' +# # [*vhost_extra_params*] -# (optionnal) extra parameter to pass to the apache::vhost class +# (optional) extra parameter to pass to the apache::vhost class # Defaults to undef # # [*file_upload_temp_dir*] @@ -477,6 +485,8 @@ class horizon( $horizon_cert = undef, $horizon_key = undef, $horizon_ca = undef, + $wsgi_processes = $::os_workers, + $wsgi_threads = '1', $compress_offline = true, $hypervisor_options = {}, $cinder_options = {}, @@ -647,6 +657,8 @@ class horizon( horizon_cert => $horizon_cert, horizon_key => $horizon_key, horizon_ca => $horizon_ca, + wsgi_processes => $wsgi_processes, + wsgi_threads => $wsgi_threads, extra_params => $vhost_extra_params, redirect_type => $redirect_type, root_url => $root_url, diff --git a/releasenotes/notes/apache-wsgi-custom-init-d1064242a6c0f8e8.yaml b/releasenotes/notes/apache-wsgi-custom-init-d1064242a6c0f8e8.yaml new file mode 100644 index 00000000..80db3283 --- /dev/null +++ b/releasenotes/notes/apache-wsgi-custom-init-d1064242a6c0f8e8.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The wsgi_processes and wsgi_threads options that is passed to horizon::wsgi::apache + can now be set in ::horizon class. diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index ee3be3be..34b9cfa2 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -43,10 +43,12 @@ describe 'horizon' do it 'configures apache' do is_expected.to contain_class('horizon::wsgi::apache').with({ - :servername => 'some.host.tld', - :listen_ssl => false, - :extra_params => {}, - :redirect_type => 'permanent', + :servername => 'some.host.tld', + :listen_ssl => false, + :wsgi_processes => facts[:os_workers], + :wsgi_threads => '1', + :extra_params => {}, + :redirect_type => 'permanent', }) end @@ -116,6 +118,8 @@ describe 'horizon' do 'supported_provider_types' => ['flat', 'vxlan'], 'supported_vnic_types' => ['*'], 'default_ipv4_subnet_pool_label' => 'None', }, :instance_options => {'disable_image' => true, 'disable_instance_snapshot' => true, 'disable_volume' => true, 'disable_volume_snapshot' => true, 'create_volume' => false }, :file_upload_temp_dir => '/var/spool/horizon', + :wsgi_processes => '30', + :wsgi_threads => '5', :secure_cookies => true, :api_versions => {'identity' => 2.0}, :keystone_multidomain_support => true, @@ -276,6 +280,18 @@ describe 'horizon' do } end + context 'with custom wsgi options' do + before do + params.merge!( :wsgi_processes => '30', + :wsgi_threads => '5' ) + end + + it { should contain_class('horizon::wsgi::apache').with( + :wsgi_processes => '30', + :wsgi_threads => '5', + )} + end + context 'with vhost_extra_params' do before do params.merge!({ @@ -692,7 +708,8 @@ describe 'horizon' do let (:facts) do facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld', - :concat_basedir => '/var/lib/puppet/concat' + :concat_basedir => '/var/lib/puppet/concat', + :os_workers => '6' })) end