Skip to content

Commit 252020b

Browse files
committed
Merge pull request voxpupuli#138 from derektamsen/20141030-add_gunicorn_timout_var
adding python::gunicorn template timeout var with default of 30 sec
2 parents 13531dc + 9a02099 commit 252020b

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ Manages Gunicorn virtual hosts.
176176

177177
**osenv** - Allows setting environment variables for the gunicorn service. Accepts a hash of 'key': 'value' pairs. Default: false
178178

179+
**timeout** - Allows setting the gunicorn idle worker process time before being killed. The unit of time is seconds. Default: 30
180+
179181
**template** - Which ERB template to use. Default: python/gunicorn.erb
180182

181183
```puppet
@@ -188,6 +190,7 @@ Manages Gunicorn virtual hosts.
188190
environment => 'prod',
189191
appmodule => 'app:app',
190192
osenv => { 'DBHOST' => 'dbserver.example.com' },
193+
timeout => 30,
191194
template => 'python/gunicorn.erb',
192195
}
193196
```

manifests/gunicorn.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
# hash of 'key': 'value' pairs.
3535
# Default: false
3636
#
37+
# [*timeout*]
38+
# Allows setting the gunicorn idle worker process time before being killed.
39+
# The unit of time is seconds.
40+
# Default: 30
41+
#
3742
# [*template*]
3843
# Which ERB template to use. Default: python/gunicorn.erb
3944
#
@@ -50,6 +55,7 @@
5055
# group => 'www-data',
5156
# appmodule => 'app:app',
5257
# osenv => { 'DBHOST' => 'dbserver.example.com' },
58+
# timeout => 30,
5359
# template => 'python/gunicorn.erb',
5460
# }
5561
#
@@ -70,6 +76,7 @@
7076
$group = 'www-data',
7177
$appmodule = 'app:app',
7278
$osenv = false,
79+
$timeout = 30,
7380
$template = 'python/gunicorn.erb',
7481
) {
7582

templates/gunicorn.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ CONFIG = {
3232
'--bind=<%= @bind %>',
3333
<% end -%>
3434
'--workers=<%= @processorcount.to_i*2 %>',
35-
'--timeout=30',
35+
'--timeout=<%= @timeout %>',
3636
<% if @mode != 'django' -%>
3737
'<%= @appmodule %>',
3838
<% end -%>

tests/gunicorn.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
environment => 'prod',
1414
appmodule => 'app:app',
1515
osenv => { 'DBHOST' => 'dbserver.example.com' },
16+
timeout => 30,
1617
template => 'python/gunicorn.erb',
1718
}

0 commit comments

Comments
 (0)