From 281bebad52411cd729684ba9862bc49e1f6fdbf6 Mon Sep 17 00:00:00 2001 From: Kimo Rosenbaum Date: Tue, 24 Jun 2014 09:37:24 -0700 Subject: [PATCH] Support a new variable 'environment_variables' for adding multiple env to the app config --- README.md | 3 +++ manifests/app.pp | 10 +++++++--- templates/uwsgi_app.ini.erb | 9 ++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d415b33..fc1ffb7 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/manifests/app.pp b/manifests/app.pp index 9031036..4c5e133 100644 --- a/manifests/app.pp +++ b/manifests/app.pp @@ -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 # 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 ) { diff --git a/templates/uwsgi_app.ini.erb b/templates/uwsgi_app.ini.erb index 6d91c96..0b0551a 100644 --- a/templates/uwsgi_app.ini.erb +++ b/templates/uwsgi_app.ini.erb @@ -14,5 +14,12 @@ if @application_options <% end end --%> +if @environment_variables + @environment_variables.sort.each do |key, value| +-%> +env = <%= key %>=<%= value %> +<% + end +end +-%>