Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
-%>