Showing with 18 additions and 42 deletions.
  1. +0 −31 .editorconfig
  2. +1 −1 Modulefile
  3. +10 −9 README.md
  4. +6 −0 manifests/gunicorn.pp
  5. +1 −1 templates/gunicorn.erb
31 changes: 0 additions & 31 deletions .editorconfig

This file was deleted.

2 changes: 1 addition & 1 deletion Modulefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name 'stankevich-python'
version '1.7.10'
version '1.7.11'
source 'git://github.com/stankevich/puppet-python.git'
author 'stankevich'
license 'Apache License, Version 2.0'
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# puppet-python #

[![Build Status](https://travis-ci.org/stankevich/puppet-python.svg?branch=master)](https://travis-ci.org/stankevich/puppet-python)
# puppet-python [![Build Status](https://travis-ci.org/stankevich/puppet-python.svg?branch=master)](https://travis-ci.org/stankevich/puppet-python)

Puppet module for installing and managing python, pip, virtualenvs and Gunicorn virtual hosts.

Expand Down Expand Up @@ -45,7 +43,7 @@ Installs and manages python, python-pip, python-dev, python-virtualenv and Gunic
**manage_gunicorn** - Allow Installation / Removal of Gunicorn. Default: true

```puppet
class { 'python':
class { 'python' :
version => 'system',
pip => true,
dev => true,
Expand Down Expand Up @@ -80,7 +78,7 @@ Installs and manages packages from pip.

**timeout** - Timeout for the pip install command. Defaults to 1800.
```puppet
python::pip { 'cx_Oracle':
python::pip { 'cx_Oracle' :
pkgname => 'cx_Oracle',
virtualenv => '/var/www/project1',
owner => 'appuser',
Expand All @@ -106,7 +104,7 @@ Installs and manages Python packages from requirements file.
**group** - The group that was used to create the virtualenv. This is used to create the requirements file with correct permissions if it's not present already.

```puppet
python::requirements { '/var/www/project1/requirements.txt':
python::requirements { '/var/www/project1/requirements.txt' :
virtualenv => '/var/www/project1',
proxy => 'http://proxy.domain.com:3128',
owner => 'appuser',
Expand Down Expand Up @@ -143,7 +141,7 @@ Creates Python virtualenv.
**timeout** - The maximum time in seconds the "pip install" command should take. Default: 1800

```puppet
python::virtualenv { '/var/www/project1':
python::virtualenv { '/var/www/project1' :
ensure => present,
version => 'system',
requirements => '/var/www/project1/requirements.txt',
Expand All @@ -170,20 +168,23 @@ Manages Gunicorn virtual hosts.

**dir** - Application directory.

**bind** - Bind on: 'HOST', 'HOST:PORT', 'unix:PATH'. Default: unix:/tmp/gunicorn-$name.socket or unix:${virtualenv}/${name}.socket
**bind** - Bind on: 'HOST', 'HOST:PORT', 'unix:PATH'. Default: `unix:/tmp/gunicorn-$name.socket` or `unix:${virtualenv}/${name}.socket`

**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
python::gunicorn { 'vhost':
python::gunicorn { 'vhost' :
ensure => present,
virtualenv => '/var/www/project1',
mode => 'wsgi',
dir => '/var/www/project1/current',
bind => 'unix:/tmp/gunicorn.socket',
environment => 'prod',
appmodule => 'app:app',
template => 'python/gunicorn.erb',
}
```
Expand Down
6 changes: 6 additions & 0 deletions manifests/gunicorn.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand All @@ -39,6 +43,7 @@
# environment => 'prod',
# owner => 'www-data',
# group => 'www-data',
# appmodule => 'app:app',
# template => 'python/gunicorn.erb',
# }
#
Expand All @@ -57,6 +62,7 @@
$environment = false,
$owner = 'www-data',
$group = 'www-data',
$appmodule = 'app:app',
$template = 'python/gunicorn.erb',
) {

Expand Down
2 changes: 1 addition & 1 deletion templates/gunicorn.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CONFIG = {
'--workers=<%= @processorcount.to_i*2 %>',
'--timeout=30',
<% if @mode != 'django' -%>
'app:app',
'<%= @appmodule %>',
<% end -%>
),
}