Skip to content

Commit 716ae77

Browse files
committed
Install venv packages in python::install::venv
1 parent 103bcc2 commit 716ae77

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

REFERENCE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
* [`python`](#python): Installs and manages python, python-dev and gunicorn.
1212
* [`python::install::dev`](#python--install--dev): Installs python development packages
13+
* [`python::install::venv`](#python--install--venv): Installs python virtualenv packages
1314
* [`python::pip::bootstrap`](#python--pip--bootstrap): allow to bootstrap pip when python is managed from other module
1415

1516
#### Private Classes
@@ -294,6 +295,10 @@ Default value: `'/opt/python'`
294295

295296
Installs python development packages
296297

298+
### <a name="python--install--venv"></a>`python::install::venv`
299+
300+
Installs python virtualenv packages
301+
297302
### <a name="python--pip--bootstrap"></a>`python::pip::bootstrap`
298303

299304
allow to bootstrap pip when python is managed from other module

manifests/install.pp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,7 @@
3232
}
3333

3434
if $python::manage_venv_package {
35-
##
36-
## CentOS has no extra package for venv
37-
##
38-
unless $facts['os']['name'] == 'CentOS' {
39-
package { 'python-venv':
40-
ensure => $python::venv,
41-
name => "${python}-venv",
42-
require => Package['python'],
43-
}
44-
}
35+
include python::install::venv
4536
}
4637

4738
case $python::provider {

manifests/install/venv.pp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# @summary Installs python virtualenv packages
2+
class python::install::venv {
3+
include python
4+
5+
##
6+
## CentOS has no extra package for venv
7+
##
8+
unless $facts['os']['name'] == 'CentOS' {
9+
package { 'python-venv':
10+
ensure => $python::venv,
11+
name => "${python::install::python}-venv",
12+
require => Package['python'],
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)