From 8d16ff86e05415a7adc5932375c8d68d9db73249 Mon Sep 17 00:00:00 2001 From: Derek Tamsen Date: Fri, 10 Oct 2014 14:07:38 -0700 Subject: [PATCH 1/2] adding ability to set custom app module load path for gunicorn --- manifests/gunicorn.pp | 6 ++++++ templates/gunicorn.erb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/manifests/gunicorn.pp b/manifests/gunicorn.pp index 159afa39..3c0a8bbd 100644 --- a/manifests/gunicorn.pp +++ b/manifests/gunicorn.pp @@ -25,6 +25,10 @@ # [*environment*] # Set ENVIRONMENT variable. Default: none # +# [*appmodule*] +# Set the application module name for gunicorn to load when not using Django. +# Default: app:app +# # [*template*] # Which ERB template to use. Default: python/gunicorn.erb # @@ -39,6 +43,7 @@ # environment => 'prod', # owner => 'www-data', # group => 'www-data', +# appmodule => 'app:app', # template => 'python/gunicorn.erb', # } # @@ -57,6 +62,7 @@ $environment = false, $owner = 'www-data', $group = 'www-data', + $appmodule = 'app:app', $template = 'python/gunicorn.erb', ) { diff --git a/templates/gunicorn.erb b/templates/gunicorn.erb index 10f81faa..e1bb58b8 100644 --- a/templates/gunicorn.erb +++ b/templates/gunicorn.erb @@ -31,7 +31,7 @@ CONFIG = { '--workers=<%= @processorcount.to_i*2 %>', '--timeout=30', <% if @mode != 'django' -%> - 'app:app', + '<%= @appmodule %>', <% end -%> ), } From 81894f716799a9842daa9b896ad48e90efc4458d Mon Sep 17 00:00:00 2001 From: Derek Tamsen Date: Fri, 10 Oct 2014 14:12:38 -0700 Subject: [PATCH 2/2] add appmodule to README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a5f89ad8..9e474cda 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,8 @@ Manages Gunicorn virtual hosts. **environment** - Set ENVIRONMENT variable. Default: none +**appmodule** - Set the application module name for gunicorn to load when not using Django. Default: app:app + **template** - Which ERB template to use. Default: python/gunicorn.erb ```puppet @@ -182,6 +184,7 @@ Manages Gunicorn virtual hosts. dir => '/var/www/project1/current', bind => 'unix:/tmp/gunicorn.socket', environment => 'prod', + appmodule => 'app:app', template => 'python/gunicorn.erb', } ```