File tree Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,8 @@ Manages Gunicorn virtual hosts.
174
174
175
175
** appmodule** - Set the application module name for gunicorn to load when not using Django. Default: app: app
176
176
177
+ ** osenv** - Allows setting environment variables for the gunicorn service. Accepts a hash of 'key': 'value' pairs. Default: false
178
+
177
179
** template** - Which ERB template to use. Default: python/gunicorn.erb
178
180
179
181
``` puppet
@@ -185,6 +187,7 @@ Manages Gunicorn virtual hosts.
185
187
bind => 'unix:/tmp/gunicorn.socket',
186
188
environment => 'prod',
187
189
appmodule => 'app:app',
190
+ osenv => { 'DBHOST' => 'dbserver.example.com' },
188
191
template => 'python/gunicorn.erb',
189
192
}
190
193
```
Original file line number Diff line number Diff line change 29
29
# Set the application module name for gunicorn to load when not using Django.
30
30
# Default: app:app
31
31
#
32
+ # [*osenv*]
33
+ # Allows setting environment variables for the gunicorn service. Accepts a
34
+ # hash of 'key': 'value' pairs.
35
+ # Default: false
36
+ #
32
37
# [*template*]
33
38
# Which ERB template to use. Default: python/gunicorn.erb
34
39
#
44
49
# owner => 'www-data',
45
50
# group => 'www-data',
46
51
# appmodule => 'app:app',
52
+ # osenv => { 'DBHOST' => 'dbserver.example.com' },
47
53
# template => 'python/gunicorn.erb',
48
54
# }
49
55
#
63
69
$owner = ' www-data' ,
64
70
$group = ' www-data' ,
65
71
$appmodule = ' app:app' ,
72
+ $osenv = false ,
66
73
$template = ' python/gunicorn.erb' ,
67
74
) {
68
75
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ CONFIG = {
6
6
<% end -%>
7
7
<% if @virtualenv -%>
8
8
'environment': {
9
+ <% if @osenv -%> <% @osenv.sort.each do |key, value| -%>
10
+ '<%= key %> ': '<%= value %> ',
11
+ <% end -%> <% end -%>
9
12
<% if @environment -%>
10
13
'ENVIRONMENT': '<%= @environment %> ',
11
14
<% end -%>
Original file line number Diff line number Diff line change 11
11
dir => ' /var/www/project1/current' ,
12
12
bind => ' unix:/tmp/gunicorn.socket' ,
13
13
environment => ' prod' ,
14
+ appmodule => ' app:app' ,
15
+ osenv => { ' DBHOST' => ' dbserver.example.com' },
14
16
template => ' python/gunicorn.erb' ,
15
17
}
You can’t perform that action at this time.
0 commit comments