File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -64,11 +64,14 @@ Creates Python virtualenv.
64
64
65
65
** proxy** — Proxy server to use for outbound connections. Default: none
66
66
67
+ ** systempkgs** — Copy system site-packages into virtualenv. Default: don't
68
+
67
69
python::virtualenv { '/var/www/project1':
68
70
ensure => present,
69
71
version => 'system',
70
72
requirements => '/var/www/project1/requirements.txt',
71
73
proxy => 'http://proxy.domain.com:3128',
74
+ systempkgs => true,
72
75
}
73
76
74
77
### python::gunicorn
Original file line number Diff line number Diff line change 16
16
# [*proxy*]
17
17
# Proxy server to use for outbound connections. Default: none
18
18
#
19
+ # [*systempkgs*]
20
+ # Copy system site-packages into virtualenv. Default: don't
21
+ #
19
22
# === Examples
20
23
#
21
24
# python::virtualenv { '/var/www/project1':
22
25
# ensure => present,
23
26
# version => 'system',
24
27
# requirements => '/var/www/project1/requirements.txt',
25
28
# proxy => 'http://proxy.domain.com:3128',
29
+ # systempkgs => true,
26
30
# }
27
31
#
28
32
# === Authors
33
37
$ensure = present ,
34
38
$version = ' system' ,
35
39
$requirements = false ,
36
- $proxy = false
40
+ $proxy = false ,
41
+ $systempkgs = false ,
37
42
) {
38
43
39
44
$venv_dir = $name
55
60
default => " && export http_proxy=${proxy} " ,
56
61
}
57
62
63
+ $system_pkgs_flag = $systempkgs ? {
64
+ false => ' ' ,
65
+ default => ' --system-site-packages' ,
66
+ }
67
+
58
68
exec { "python_virtualenv_${venv_dir}" :
59
69
command => " mkdir -p ${venv_dir} \
60
70
${proxy_command} \
61
- && virtualenv -p `which ${python} ` ${venv_dir} \
71
+ && virtualenv -p `which ${python} ` ${system_pkgs_flag} ${ venv_dir} \
62
72
&& ${venv_dir} /bin/pip install ${proxy_flag} --upgrade distribute pip" ,
63
73
creates => $venv_dir ,
64
74
}
Original file line number Diff line number Diff line change 9
9
version => ' system' ,
10
10
requirements => ' /var/www/project1/requirements.txt' ,
11
11
proxy => ' http://proxy.domain.com:3128' ,
12
+ systempkgs => true ,
12
13
}
You can’t perform that action at this time.
0 commit comments