summaryrefslogtreecommitdiff
path: root/manifests/pip.pp
diff options
context:
space:
mode:
authorSergey Stankevich <sergey.stankevich@gmail.com>2013-03-31 19:36:18 -0400
committerSergey Stankevich <sergey.stankevich@gmail.com>2013-03-31 19:36:18 -0400
commitb1aa3198c8d950b0e0f1254ffc28438a49540297 (patch)
tree5a7974effa2949741128d02e5f77c273fa371d05 /manifests/pip.pp
parent7abfab94312888cdbafd67a955677048e081a2c3 (diff)
URL support for pip
Diffstat (limited to 'manifests/pip.pp')
-rw-r--r--manifests/pip.pp11
1 files changed, 10 insertions, 1 deletions
diff --git a/manifests/pip.pp b/manifests/pip.pp
index 9762c10..3a8ec1b 100644
--- a/manifests/pip.pp
+++ b/manifests/pip.pp
@@ -10,6 +10,9 @@
# [*virtualenv*]
# virtualenv to run pip in.
#
+# [*url*]
+# URL to install from. Default: none
+#
# [*proxy*]
# Proxy server to use for outbound connections. Default: none
#
@@ -27,6 +30,7 @@
define python::pip (
$virtualenv,
$ensure = present,
+ $url = false,
$proxy = false
) {
@@ -45,10 +49,15 @@ define python::pip (
default => "^${name}==",
}
+ $source = $url ? {
+ false => $name,
+ default => "${url}#egg=${name}",
+ }
+
case $ensure {
present: {
exec { "pip_install_${name}":
- command => "${virtualenv}/bin/pip install ${proxy_flag} ${name}",
+ command => "${virtualenv}/bin/pip install ${proxy_flag} ${source}",
unless => "${virtualenv}/bin/pip freeze | grep -i -e ${grep_regex}",
}
}