summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Stankevich <sergey.stankevich@gmail.com>2014-03-06 09:39:28 -0500
committerSergey Stankevich <sergey.stankevich@gmail.com>2014-03-06 09:39:28 -0500
commit154c0702ed50ada49e6b0f08826a59af968678d3 (patch)
tree44703671afaa778fdca9da73271c4edf182e064b
parent86c142afac34dde4a6d738fd27f94ffbd4ad762b (diff)
parent5434eb78a45372fdfe07cb8d84ddd739bea825ce (diff)
Merge branch 'master' of github.com:stankevich/puppet-python
* 'master' of github.com:stankevich/puppet-python: adds external pkgname variable
-rw-r--r--manifests/pip.pp19
1 files changed, 13 insertions, 6 deletions
diff --git a/manifests/pip.pp b/manifests/pip.pp
index 4f91e59..7e332fe 100644
--- a/manifests/pip.pp
+++ b/manifests/pip.pp
@@ -4,6 +4,12 @@
#
# === Parameters
#
+# [*name]
+# must be unique
+#
+# [*pkgname]
+# name of the package.
+#
# [*ensure*]
# present|absent. Default: present
#
@@ -35,6 +41,7 @@
# Fotis Gimian
#
define python::pip (
+ $pkgname = undef,
$ensure = present,
$virtualenv = 'system',
$url = false,
@@ -70,18 +77,18 @@ define python::pip (
default => "--proxy=${proxy}",
}
- $grep_regex = $name ? {
- /==/ => "^${name}\$",
- default => "^${name}==",
+ $grep_regex = $pkgname ? {
+ /==/ => "^${pkgname}\$",
+ default => "^${pkgname}==",
}
$egg_name = $egg ? {
- false => $name,
+ false => $pkgname,
default => $egg
}
$source = $url ? {
- false => $name,
+ false => $pkgname,
default => "${url}#egg=${egg_name}",
}
@@ -122,7 +129,7 @@ define python::pip (
default: {
exec { "pip_uninstall_${name}":
- command => "echo y | ${pip_env} uninstall ${uninstall_args} ${proxy_flag} ${name}",
+ command => "echo y | ${pip_env} uninstall ${uninstall_args} ${proxy_flag} ${pkgname}",
onlyif => "${pip_env} freeze | grep -i -e ${grep_regex}",
user => $owner,
environment => $environment,