summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Modulefile2
-rw-r--r--manifests/requirements.pp15
-rw-r--r--manifests/virtualenv.pp20
3 files changed, 24 insertions, 13 deletions
diff --git a/Modulefile b/Modulefile
index dfd366b..1fb0c2d 100644
--- a/Modulefile
+++ b/Modulefile
@@ -1,5 +1,5 @@
name 'puppet-python'
-version '1.1.2'
+version '1.1.3'
author 'Sergey Stankevich'
license 'Apache License, Version 2.0'
diff --git a/manifests/requirements.pp b/manifests/requirements.pp
index ba16d1e..67906fc 100644
--- a/manifests/requirements.pp
+++ b/manifests/requirements.pp
@@ -10,15 +10,18 @@
# [*virtualenv*]
# virtualenv to run pip in. Default: system-wide
#
-# [*proxy*]
-# Proxy server to use for outbound connections. Default: none
-#
# [*owner*]
# The owner of the virtualenv being manipulated. Default: root
#
# [*group*]
# The group relating to the virtualenv being manipulated. Default: root
#
+# [*proxy*]
+# Proxy server to use for outbound connections. Default: none
+#
+# [*environment*]
+# Additional environment variables required to install the packages. Default: none
+#
# === Examples
#
# python::requirements { '/var/www/project1/requirements.txt':
@@ -35,9 +38,10 @@
define python::requirements (
$requirements = $name,
$virtualenv = 'system',
- $proxy = false,
$owner = 'root',
- $group = 'root'
+ $group = 'root',
+ $proxy = false,
+ $environment = []
) {
if $virtualenv == 'system' and ($owner != 'root' or $group != 'root') {
@@ -80,6 +84,7 @@ define python::requirements (
timeout => 1800,
user => $owner,
subscribe => File[$requirements],
+ environment => $environment,
}
}
diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp
index 07007fb..354e4d8 100644
--- a/manifests/virtualenv.pp
+++ b/manifests/virtualenv.pp
@@ -13,23 +13,26 @@
# [*requirements*]
# Path to pip requirements.txt file. Default: none
#
-# [*proxy*]
-# Proxy server to use for outbound connections. Default: none
-#
# [*systempkgs*]
# Copy system site-packages into virtualenv. Default: don't
#
# [*distribute*]
# Include distribute in the virtualenv. Default: true
#
+# [*index*]
+# Base URL of Python package index. Default: none (http://pypi.python.org/simple/)
+#
# [*owner*]
# The owner of the virtualenv being manipulated. Default: root
#
# [*group*]
# The group relating to the virtualenv being manipulated. Default: root
#
-# [*index*]
-# Base URL of Python package index. Default: none (http://pypi.python.org/simple/)
+# [*proxy*]
+# Proxy server to use for outbound connections. Default: none
+#
+# [*environment*]
+# Additional environment variables required to install the packages. Default: none
#
# === Examples
#
@@ -53,12 +56,13 @@ define python::virtualenv (
$ensure = present,
$version = 'system',
$requirements = false,
- $proxy = false,
$systempkgs = false,
$distribute = true,
+ $index = false,
$owner = 'root',
$group = 'root',
- $index = false,
+ $proxy = false,
+ $environment = []
) {
$venv_dir = $name
@@ -100,6 +104,7 @@ define python::virtualenv (
creates => "${venv_dir}/bin/activate",
path => [ '/bin', '/usr/bin', '/usr/sbin' ],
cwd => "/tmp",
+ environment => $environment,
}
if $requirements {
@@ -109,6 +114,7 @@ define python::virtualenv (
timeout => 1800,
user => $owner,
subscribe => Exec["python_virtualenv_${venv_dir}"],
+ environment => $environment,
}
python::requirements { "${requirements}_${venv_dir}":