forked from gene1wood/puppet-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgunicorn.erb
More file actions
49 lines (49 loc) · 1.19 KB
/
gunicorn.erb
File metadata and controls
49 lines (49 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
CONFIG = {
<% if @mode == 'django' -%>
'mode': 'django',
<% else -%>
'mode': 'wsgi',
<% end -%>
<% if @virtualenv -%>
'environment': {
<% if @osenv -%><% @osenv.sort.each do |key, value| -%>
'<%= key %>': '<%= value %>',
<% end -%><% end -%>
<% if @environment -%>
'ENVIRONMENT': '<%= @environment %>',
<% end -%>
'PYTHONPATH': '<%= @virtualenv %>'
},
<% end -%>
'working_dir': '<%= @dir %>',
'user': '<%= @owner %>',
'group': '<%= @group %>',
<% if @virtualenv -%>
'python': '<%= @virtualenv %>/bin/python',
<% else -%>
'python': '/usr/bin/python',
<% end -%>
'args': (
<% if !@virtualenv and !@bind -%>
'--bind=unix:/tmp/gunicorn-<%= @name %>.socket',
<% elsif @virtualenv and !@bind -%>
'--bind=unix:<%= @virtualenv %>/<%= @name %>.socket',
<% else -%>
'--bind=<%= @bind %>',
<% end -%>
'--workers=<%= @processorcount.to_i*2 %>',
'--timeout=<%= @timeout %>',
<% if @access_log_format -%>
'--access-logformat=<%= @access_log_format %>',
<% end -%>
<% if @accesslog -%>
'--access-logfile=<%= @accesslog %>',
<% end -%>
<% if @errorlog -%>
'--error-logfile=<%= @errorlog %>',
<% end -%>
<% if @mode != 'django' -%>
'<%= @appmodule %>',
<% end -%>
),
}