File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 42
42
# [*template*]
43
43
# Which ERB template to use. Default: python/gunicorn.erb
44
44
#
45
+ # [*args*]
46
+ # Custom arguments to add in gunicorn config file. Default: []
47
+ #
45
48
# === Examples
46
49
#
47
50
# python::gunicorn { 'vhost':
83
86
$errorlog = false ,
84
87
$log_level = ' error' ,
85
88
$template = ' python/gunicorn.erb' ,
89
+ $args = [],
86
90
) {
87
91
88
92
# Parameter validation
Original file line number Diff line number Diff line change 26
26
let ( :params ) { { :dir => '/srv/testapp' , :log_level => 'info' } }
27
27
it { is_expected . to contain_file ( '/etc/gunicorn.d/test-app' ) . with_mode ( '0644' ) . with_content ( /--log-level=info/ ) }
28
28
end
29
+
30
+ context 'test-app with custom gunicorn preload arguments' do
31
+ let ( :params ) { { :dir => '/srv/testapp' , :args => [ '--preload' ] } }
32
+ it { is_expected . to contain_file ( '/etc/gunicorn.d/test-app' ) . with_mode ( '0644' ) . with_content ( /--preload/ ) }
33
+ end
29
34
end
30
35
end
31
36
end
Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ CONFIG = {
24
24
'python': '/usr/bin/python',
25
25
<% end -%>
26
26
'args': (
27
+ <% if @args.any? -%>
28
+ <% for arg in @args do -%>
29
+ '<%= arg %> ',
30
+ <% end -%>
31
+ <% end -%>
27
32
<% if !@virtualenv and !@bind -%>
28
33
'--bind=unix:/tmp/gunicorn-<%= @name %> .socket',
29
34
<% elsif @virtualenv and !@bind -%>
You can’t perform that action at this time.
0 commit comments