summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarl Stefansson <jarl@sdelements.com>2013-11-05 17:13:40 -0500
committerJarl Stefansson <jarl@sdelements.com>2013-11-05 17:13:40 -0500
commitf6709549671caa40be8dd477ec4abb94fab7e36a (patch)
tree4189031dad7b1b35f43be8c755663308bebf8cdd
parentb4cf920545959bf6cbb5f438b59b2cba6c0ff492 (diff)
Add support to install virtualenv from pip
-rw-r--r--manifests/init.pp3
-rw-r--r--manifests/install.pp17
2 files changed, 18 insertions, 2 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 2a9a44c..cc9336f 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -14,7 +14,8 @@
# Install python-dev. Default: false
#
# [*virtualenv*]
-# Install python-virtualenv. Default: false
+# Install python-virtualenv. Default: false, also accepts 'pip' which will
+# install latest virtualenv from pip rather than package manager
#
# [*gunicorn*]
# Install Gunicorn. Default: false
diff --git a/manifests/install.pp b/manifests/install.pp
index 9306e3a..10331ff 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -28,9 +28,24 @@ class python::install {
$venv_ensure = $python::virtualenv ? {
true => present,
default => absent,
+ pip => absent,
}
- package { 'python-virtualenv': ensure => $venv_ensure }
+ case $venv_ensure {
+ 'pip': {
+ exec { "pip-virtualenv":
+ command => "pip install --upgrade virtualenv",
+ cwd => $cwd,
+ user => $run_as_user,
+ timeout => 0,
+ path => ["/usr/local/bin","/usr/bin","/bin", "/usr/sbin"],
+ require => Package['python-pip']
+ }
+ }
+ default: {
+ package { 'python-virtualenv': ensure => $venv_ensure }
+ }
+ }
$gunicorn_ensure = $python::gunicorn ? {
true => present,