Skip to content

Commit

Permalink
Merge pull request #4 from kimor79/multi_env
Browse files Browse the repository at this point in the history
Support multiple env options
  • Loading branch information
jarshwah committed Jun 24, 2014
2 parents 805775d + 281beba commit 75488be
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ key. See the hiera section below for examples.
* `application_options`
Extra options to set in the application config file

* `environment_variables`
Extra environment variabls to set in the application config file

#### Using Hiera

Configure a django application:
Expand Down
10 changes: 7 additions & 3 deletions manifests/app.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@
# [*application_options*]
# Extra options to set in the application config file
#
# [*environment_variables*]
# Extra environment variables to set in the application config file
#
# === Authors
# - Josh Smeaton <josh.smeaton@gmail.com>
#
define uwsgi::app (
$ensure = 'present',
$template = 'uwsgi/uwsgi_app.ini.erb',
$application_options = undef,
$ensure = 'present',
$template = 'uwsgi/uwsgi_app.ini.erb',
$application_options = undef,
$environment_variables = undef,
$uid,
$gid
) {
Expand Down
9 changes: 8 additions & 1 deletion templates/uwsgi_app.ini.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,12 @@ if @application_options
<%
end
end
-%>

if @environment_variables
@environment_variables.sort.each do |key, value|
-%>
env = <%= key %>=<%= value %>
<%
end
end
-%>

0 comments on commit 75488be

Please sign in to comment.