From e63664bc1ccc540a45a1c4eea90a0f7ea482e406 Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Tue, 6 Nov 2012 21:34:03 +0100 Subject: python::gunicorn - added template parameter The idea is to be able to use a different template, in case the one provided with the module doesn't fit the user's need. --- README.md | 3 +++ manifests/gunicorn.pp | 7 ++++++- tests/gunicorn.pp | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ba4b766..65cd391 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,8 @@ Manages Gunicorn virtual hosts. **environment** — Set ENVIRONMENT variable. Default: none +**template** — Which ERB template to use. Default: python/gunicorn.erb + python::gunicorn { 'vhost': ensure => present, virtualenv => '/var/www/project1', @@ -97,6 +99,7 @@ Manages Gunicorn virtual hosts. dir => '/var/www/project1/current', bind => 'unix:/tmp/gunicorn.socket', environment => 'prod', + template => 'python/gunicorn.erb', } ## Authors diff --git a/manifests/gunicorn.pp b/manifests/gunicorn.pp index 659555f..1b53fc8 100644 --- a/manifests/gunicorn.pp +++ b/manifests/gunicorn.pp @@ -25,6 +25,9 @@ # [*environment*] # Set ENVIRONMENT variable. Default: none # +# [*template*] +# Which ERB template to use. Default: python/gunicorn.erb +# # === Examples # # python::gunicorn { 'vhost': @@ -34,6 +37,7 @@ # dir => '/var/www/project1/current', # bind => 'unix:/tmp/gunicorn.socket', # environment => 'prod', +# template => 'python/gunicorn.erb', # } # # === Authors @@ -47,6 +51,7 @@ define python::gunicorn ( $dir = false, $bind = false, $environment = false, + $template = 'python/gunicorn.erb', ) { # Parameter validation @@ -59,7 +64,7 @@ define python::gunicorn ( mode => '0644', owner => 'root', group => 'root', - content => template('python/gunicorn.erb'), + content => template($template), } } diff --git a/tests/gunicorn.pp b/tests/gunicorn.pp index c081fd6..c32ea1a 100644 --- a/tests/gunicorn.pp +++ b/tests/gunicorn.pp @@ -11,4 +11,5 @@ python::gunicorn { 'vhost': dir => '/var/www/project1/current', bind => 'unix:/tmp/gunicorn.socket', environment => 'prod', + template => 'python/gunicorn.erb', } -- cgit v1.2.3