diff options
author | Marc Fournier <marc.fournier@camptocamp.com> | 2012-11-06 21:34:03 +0100 |
---|---|---|
committer | Marc Fournier <marc.fournier@camptocamp.com> | 2012-11-06 21:34:03 +0100 |
commit | e63664bc1ccc540a45a1c4eea90a0f7ea482e406 (patch) | |
tree | 5d840a525154a666d66581d952f9331baf461ccb | |
parent | 5477c34707d6d59b4e7fd0a77c87183b59c37e52 (diff) |
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.
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | manifests/gunicorn.pp | 7 | ||||
-rw-r--r-- | tests/gunicorn.pp | 1 |
3 files changed, 10 insertions, 1 deletions
@@ -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', } |