Skip to content

Commit 01bf279

Browse files
committed
Amended all documentation and updated version to 1.1.0
1 parent 5132cf1 commit 01bf279

5 files changed

Lines changed: 84 additions & 29 deletions

File tree

Modulefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name 'puppet-python'
2-
version '1.0.0'
2+
version '1.1.0'
33

44
author 'Sergey Stankevich'
55
license 'Apache License, Version 2.0'

README.md

Lines changed: 59 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,36 @@
33

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

6+
**Version 1.1.0 Notes**
7+
8+
Version 1.1.0 makes several fundamental changes to the core of this module, adding some additional features, improving performance and making operations more robust in general.
9+
10+
Please note that everal changes have been made in v1.1.0 which make manifests incompatible with the previous version. However, modifying your manifests to suit is trivial. Please see the notes below.
11+
12+
Currently, the changes you need to make are as follows:
13+
14+
* All pip definitions MUST include the owner field which specifies which user owns the virtualenv that packages will be installed in. Adding this greatly improves performance and efficiency of this module.
15+
16+
## Installation
17+
18+
``` bash
19+
cd /etc/puppet/modules
20+
git clone git://github.com/stankevich/puppet-python.git
21+
```
22+
623
## Usage
724

825
### python
926

1027
Installs and manages python, python-dev, python-virtualenv and Gunicorn.
1128

12-
**version** Python version to install. Default: system default
29+
**version** - Python version to install. Default: system default
1330

14-
**dev** Install python-dev. Default: false
31+
**dev** - Install python-dev. Default: false
1532

16-
**virtualenv** Install python-virtualenv. Default: false
33+
**virtualenv** - Install python-virtualenv. Default: false
1734

18-
**gunicorn** Install Gunicorn. Default: false
35+
**gunicorn** - Install Gunicorn. Default: false
1936

2037
class { 'python':
2138
version => 'system',
@@ -28,52 +45,65 @@ Installs and manages python, python-dev, python-virtualenv and Gunicorn.
2845

2946
Installs and manages packages from pip.
3047

31-
**ensure** present/absent. Default: present
48+
**ensure** - present/absent. Default: present
3249

33-
**virtualenv** virtualenv to run pip in.
50+
**virtualenv** - virtualenv to run pip in. Default: system (no virtualenv)
3451

35-
**url** URL to install from. Default: none
52+
**url** - URL to install from. Default: none
3653

37-
**proxy** — Proxy server to use for outbound connections. Default: none
54+
**owner** - The owner of the virtualenv to ensure that packages are installed with the correct permissions (must be specified). Default: root
3855

39-
python::pip { 'flask':
40-
virtualenv => '/var/www/project1',
41-
proxy => 'http://proxy.domain.com:3128',
56+
**proxy** - Proxy server to use for outbound connections. Default: none
57+
58+
**environment** - Additional environment variables required to install the packages. Default: none
59+
60+
python::pip { 'cx_Oracle':
61+
virtualenv => '/var/www/project1',
62+
owner => 'appuser',
63+
proxy => 'http://proxy.domain.com:3128',
64+
environment => 'ORACLE_HOME=/usr/lib/oracle/11.2/client64',
4265
}
4366

4467
### python::requirements
4568

4669
Installs and manages Python packages from requirements file.
4770

48-
**virtualenv** — virtualenv to run pip in. Default: system-wide
71+
**virtualenv** - virtualenv to run pip in. Default: system-wide
72+
73+
**proxy** - Proxy server to use for outbound connections. Default: none
74+
75+
**owner** - The owner of the virtualenv to ensure that packages are installed with the correct permissions (must be specified). Default: root
4976

50-
**proxy** — Proxy server to use for outbound connections. Default: none
77+
**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.
5178

5279
python::requirements { '/var/www/project1/requirements.txt':
5380
virtualenv => '/var/www/project1',
5481
proxy => 'http://proxy.domain.com:3128',
82+
owner => 'appuser',
83+
group => 'apps',
5584
}
5685

5786
### python::virtualenv
5887

5988
Creates Python virtualenv.
6089

61-
**ensure** present/absent. Default: present
90+
**ensure** - present/absent. Default: present
6291

63-
**version** Python version to use. Default: system default
92+
**version** - Python version to use. Default: system default
6493

65-
**requirements** Path to pip requirements.txt file. Default: none
94+
**requirements** - Path to pip requirements.txt file. Default: none
6695

67-
**proxy** Proxy server to use for outbound connections. Default: none
96+
**proxy** - Proxy server to use for outbound connections. Default: none
6897

69-
**systempkgs** Copy system site-packages into virtualenv. Default: don't
98+
**systempkgs** - Copy system site-packages into virtualenv. Default: don't
7099

71-
**distribute** Include distribute in the virtualenv. Default: true
100+
**distribute** - Include distribute in the virtualenv. Default: true
72101

73-
** owner ** - specify the owner of this virtualenv
102+
**owner** - Specify the owner of this virtualenv
74103

75-
** group ** - specify the group for this virtualenv
104+
**group** - Specify the group for this virtualenv
76105

106+
**index** - Base URL of Python package index. Default: none
77107

78108
python::virtualenv { '/var/www/project1':
79109
ensure => present,
@@ -90,19 +120,19 @@ Creates Python virtualenv.
90120

91121
Manages Gunicorn virtual hosts.
92122

93-
**ensure** present/absent. Default: present
123+
**ensure** - present/absent. Default: present
94124

95-
**virtualenv** Run in virtualenv, specify directory. Default: disabled
125+
**virtualenv** - Run in virtualenv, specify directory. Default: disabled
96126

97-
**mode** Gunicorn mode. wsgi/django. Default: wsgi
127+
**mode** - Gunicorn mode. wsgi/django. Default: wsgi
98128

99-
**dir** Application directory.
129+
**dir** - Application directory.
100130

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

103-
**environment** Set ENVIRONMENT variable. Default: none
133+
**environment** - Set ENVIRONMENT variable. Default: none
104134

105-
**template** Which ERB template to use. Default: python/gunicorn.erb
135+
**template** - Which ERB template to use. Default: python/gunicorn.erb
106136

107137
python::gunicorn { 'vhost':
108138
ensure => present,
@@ -119,3 +149,4 @@ Manages Gunicorn virtual hosts.
119149
[Sergey Stankevich](https://github.com/stankevich)
120150
[Ashley Penney](https://github.com/apenney)
121151
[Marc Fournier](https://github.com/mfournier)
152+
[Fotis Gimian](https://github.com/fgimian)

manifests/pip.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@
1313
# [*url*]
1414
# URL to install from. Default: none
1515
#
16+
# [*owner*]
17+
# The owner of the virtualenv being manipulated. Default: root
18+
#
1619
# [*proxy*]
1720
# Proxy server to use for outbound connections. Default: none
1821
#
22+
# [*environment*]
23+
# Additional environment variables required to install the packages. Default: none
24+
#
1925
# === Examples
2026
#
2127
# python::pip { 'flask':
@@ -26,6 +32,7 @@
2632
# === Authors
2733
#
2834
# Sergey Stankevich
35+
# Fotis Gimian
2936
#
3037
define python::pip (
3138
$ensure = present,

manifests/requirements.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
# [*proxy*]
1414
# Proxy server to use for outbound connections. Default: none
1515
#
16+
# [*owner*]
17+
# The owner of the virtualenv being manipulated. Default: root
18+
#
19+
# [*group*]
20+
# The group relating to the virtualenv being manipulated. Default: root
21+
#
1622
# === Examples
1723
#
1824
# python::requirements { '/var/www/project1/requirements.txt':
@@ -24,6 +30,7 @@
2430
#
2531
# Sergey Stankevich
2632
# Ashley Penney
33+
# Fotis Gimian
2734
#
2835
define python::requirements (
2936
$requirements = $name,

manifests/virtualenv.pp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222
# [*distribute*]
2323
# Include distribute in the virtualenv. Default: true
2424
#
25+
# [*owner*]
26+
# The owner of the virtualenv being manipulated. Default: root
27+
#
28+
# [*group*]
29+
# The group relating to the virtualenv being manipulated. Default: root
30+
#
31+
# [*index*]
32+
# Base URL of Python package index. Default: none (http://pypi.python.org/simple/)
33+
#
2534
# === Examples
2635
#
2736
# python::virtualenv { '/var/www/project1':
@@ -38,6 +47,7 @@
3847
# Sergey Stankevich
3948
# Ashley Penney
4049
# Marc Fournier
50+
# Fotis Gimian
4151
#
4252
define python::virtualenv (
4353
$ensure = present,

0 commit comments

Comments
 (0)