Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ Manages Gunicorn virtual hosts.

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

**timeout** - Allows setting the gunicorn idle worker process time before being killed. The unit of time is seconds. Default: 30

**template** - Which ERB template to use. Default: python/gunicorn.erb

```puppet
Expand All @@ -188,6 +190,7 @@ Manages Gunicorn virtual hosts.
environment => 'prod',
appmodule => 'app:app',
osenv => { 'DBHOST' => 'dbserver.example.com' },
timeout => 30,
template => 'python/gunicorn.erb',
}
```
Expand Down
7 changes: 7 additions & 0 deletions manifests/gunicorn.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
# hash of 'key': 'value' pairs.
# Default: false
#
# [*timeout*]
# Allows setting the gunicorn idle worker process time before being killed.
# The unit of time is seconds.
# Default: 30
#
# [*template*]
# Which ERB template to use. Default: python/gunicorn.erb
#
Expand All @@ -50,6 +55,7 @@
# group => 'www-data',
# appmodule => 'app:app',
# osenv => { 'DBHOST' => 'dbserver.example.com' },
# timeout => 30,
# template => 'python/gunicorn.erb',
# }
#
Expand All @@ -70,6 +76,7 @@
$group = 'www-data',
$appmodule = 'app:app',
$osenv = false,
$timeout = 30,
$template = 'python/gunicorn.erb',
) {

Expand Down
2 changes: 1 addition & 1 deletion templates/gunicorn.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CONFIG = {
'--bind=<%= @bind %>',
<% end -%>
'--workers=<%= @processorcount.to_i*2 %>',
'--timeout=30',
'--timeout=<%= @timeout %>',
<% if @mode != 'django' -%>
'<%= @appmodule %>',
<% end -%>
Expand Down
1 change: 1 addition & 0 deletions tests/gunicorn.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
environment => 'prod',
appmodule => 'app:app',
osenv => { 'DBHOST' => 'dbserver.example.com' },
timeout => 30,
template => 'python/gunicorn.erb',
}