Skip to content

Commit 75488be

Browse files
committed
Merge pull request #4 from kimor79/multi_env
Support multiple env options
2 parents 805775d + 281beba commit 75488be

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ key. See the hiera section below for examples.
168168
* `application_options`
169169
Extra options to set in the application config file
170170

171+
* `environment_variables`
172+
Extra environment variabls to set in the application config file
173+
171174
#### Using Hiera
172175

173176
Configure a django application:

manifests/app.pp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@
2323
# [*application_options*]
2424
# Extra options to set in the application config file
2525
#
26+
# [*environment_variables*]
27+
# Extra environment variables to set in the application config file
28+
#
2629
# === Authors
2730
# - Josh Smeaton <josh.smeaton@gmail.com>
2831
#
2932
define uwsgi::app (
30-
$ensure = 'present',
31-
$template = 'uwsgi/uwsgi_app.ini.erb',
32-
$application_options = undef,
33+
$ensure = 'present',
34+
$template = 'uwsgi/uwsgi_app.ini.erb',
35+
$application_options = undef,
36+
$environment_variables = undef,
3337
$uid,
3438
$gid
3539
) {

templates/uwsgi_app.ini.erb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,12 @@ if @application_options
1414
<%
1515
end
1616
end
17-
-%>
1817

18+
if @environment_variables
19+
@environment_variables.sort.each do |key, value|
20+
-%>
21+
env = <%= key %>=<%= value %>
22+
<%
23+
end
24+
end
25+
-%>

0 commit comments

Comments
 (0)