Skip to content

Commit

Permalink
Merge pull request voxpupuli#867 from ekohl/uwsgi-read-timeout
Browse files Browse the repository at this point in the history
Expose the uwsgi_read_timeout parameter
  • Loading branch information
bastelfreak authored Sep 2, 2016
2 parents d4cbe75 + a537142 commit 0d980ad
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions manifests/resource/location.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
# that you can split the script_name and path_info via regex
# [*uwsgi*] - location of uwsgi (host:port)
# [*uwsgi_params*] - optional alternative uwsgi_params file to use
# [*uwsgi_read_timeout*] - optional value for uwsgi_read_timeout
# [*ssl*] - Indicates whether to setup SSL bindings for
# this location.
# [*ssl_only*] - Required if the SSL and normal vHost have the
Expand Down Expand Up @@ -157,6 +158,7 @@
$fastcgi_split_path = undef,
$uwsgi = undef,
$uwsgi_params = "${nginx::config::conf_dir}/uwsgi_params",
$uwsgi_read_timeout = undef,
$ssl = false,
$ssl_only = false,
$location_alias = undef,
Expand Down Expand Up @@ -238,6 +240,9 @@
validate_string($uwsgi)
}
validate_string($uwsgi_params)
if ($uwsgi_read_timeout != undef) {
validate_string($uwsgi_read_timeout)
}

validate_bool($internal)

Expand Down
6 changes: 6 additions & 0 deletions manifests/resource/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
# [*fastcgi*] - location of fastcgi (host:port)
# [*fastcgi_params*] - optional alternative fastcgi_params file to use
# [*fastcgi_script*] - optional SCRIPT_FILE parameter
# [*uwsgi_read_timeout*] - optional value for uwsgi_read_timeout
# [*ssl*] - Indicates whether to setup SSL bindings for this
# vhost.
# [*ssl_cert*] - Pre-generated SSL Certificate file to reference
Expand Down Expand Up @@ -235,6 +236,7 @@
$fastcgi_script = undef,
$uwsgi = undef,
$uwsgi_params = "${nginx::config::conf_dir}/uwsgi_params",
$uwsgi_read_timeout = undef,
$index_files = [
'index.html',
'index.htm',
Expand Down Expand Up @@ -418,6 +420,9 @@
validate_string($uwsgi)
}
validate_string($uwsgi_params)
if ($uwsgi_read_timeout != undef) {
validate_string($uwsgi_read_timeout)
}
validate_array($index_files)
if ($autoindex != undef) {
validate_string($autoindex)
Expand Down Expand Up @@ -619,6 +624,7 @@
fastcgi_script => $fastcgi_script,
uwsgi => $uwsgi,
uwsgi_params => $uwsgi_params,
uwsgi_read_timeout => $uwsgi_read_timeout,
try_files => $try_files,
www_root => $www_root,
autoindex => $autoindex,
Expand Down
6 changes: 6 additions & 0 deletions spec/defines/resource_location_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,12 @@
attr: 'uwsgi',
value: 'value',
match: %r{\s+uwsgi_pass\s+value;}
},
{
title: 'should set uwsgi_read_timeout',
attr: 'uwsgi_read_timeout',
value: '300s',
match: %r{\s+uwsgi_read_timeout\s+300s;}
}
].each do |param|
context "when #{param[:attr]} is #{param[:value]}" do
Expand Down
3 changes: 3 additions & 0 deletions templates/vhost/locations/uwsgi.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
<% end -%>
include <%= @uwsgi_params %>;
uwsgi_pass <%= @uwsgi %>;
<% if @uwsgi_read_timeout-%>
uwsgi_read_timeout <%= @uwsgi_read_timeout %>;
<% end -%>

0 comments on commit 0d980ad

Please sign in to comment.