summaryrefslogtreecommitdiff
path: root/manifests/virtualenv.pp
diff options
context:
space:
mode:
authorJarl Stefansson <jarl@sdelements.com>2013-12-13 15:51:45 -0500
committerJarl Stefansson <jarl@sdelements.com>2013-12-13 15:51:45 -0500
commit6c6d58a0f3f286ae7994cc54c05416c7efd6b87a (patch)
tree195a672b6a550b7735c81db9b1db5d72c88c1f1d /manifests/virtualenv.pp
parentf7801a4b0d9ae58187891d124c21d269eae19ba5 (diff)
parent44ea60543b37ce5ddb9ff9b7411dbf7a0330f0e6 (diff)
Merge branch 'master' of github.com:jalli/puppet-python
Conflicts: manifests/pip.pp manifests/requirements.pp manifests/virtualenv.pp
Diffstat (limited to 'manifests/virtualenv.pp')
-rw-r--r--manifests/virtualenv.pp14
1 files changed, 10 insertions, 4 deletions
diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp
index 1a2b093..1fb55d6 100644
--- a/manifests/virtualenv.pp
+++ b/manifests/virtualenv.pp
@@ -39,6 +39,12 @@
# [*path*]
# Specifies the PATH variable. Default: [ '/bin', '/usr/bin', '/usr/sbin' ]
#
+# [*cwd*]
+# The directory from which to run the "pip install" command. Default: undef
+#
+# [*timeout*]
+# The maximum time in seconds the "pip install" command should take. Default: 1800
+#
# === Examples
#
# python::virtualenv { '/var/www/project1':
@@ -69,6 +75,8 @@ define python::virtualenv (
$proxy = false,
$environment = [],
$path = [ '/bin', '/usr/bin', '/usr/sbin','/usr/local/bin' ]
+ $cwd = undef,
+ $timeout = 1800
) {
$venv_dir = $name
@@ -124,10 +132,11 @@ define python::virtualenv (
exec { "python_requirements_initial_install_${requirements}_${venv_dir}":
command => "${venv_dir}/bin/pip --log-file ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} -r ${requirements}",
refreshonly => true,
- timeout => 1800,
+ timeout => $timeout,
user => $owner,
subscribe => Exec["python_virtualenv_${venv_dir}"],
environment => $environment,
+ cwd => $cwd
}
python::requirements { "${requirements}_${venv_dir}":
@@ -139,7 +148,6 @@ define python::virtualenv (
require => Exec["python_virtualenv_${venv_dir}"],
}
}
-
} elsif $ensure == 'absent' {
file { $venv_dir:
@@ -148,7 +156,5 @@ define python::virtualenv (
recurse => true,
purge => true,
}
-
}
-
}