Skip to content

Commit 3c606c9

Browse files
committed
Added owner, group to the pip class which ensures that packages will be installed with the correct permissions.
1 parent 64de5ab commit 3c606c9

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

manifests/pip.pp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@
2929
#
3030
define python::pip (
3131
$virtualenv,
32-
$ensure = present,
33-
$url = false,
34-
$proxy = false
32+
$ensure = present,
33+
$url = false,
34+
$owner = 'root',
35+
$group = 'root',
36+
$proxy = false
3537
) {
3638

3739
# Parameter validation
@@ -57,15 +59,17 @@
5759
case $ensure {
5860
present: {
5961
exec { "pip_install_${name}":
60-
command => "${virtualenv}/bin/pip install ${proxy_flag} ${source}",
61-
unless => "${virtualenv}/bin/pip freeze | grep -i -e ${grep_regex}",
62+
command => "${virtualenv}/bin/pip install ${proxy_flag} ${source}",
63+
unless => "${virtualenv}/bin/pip freeze | grep -i -e ${grep_regex}",
64+
user => $owner,
6265
}
6366
}
6467

6568
default: {
6669
exec { "pip_uninstall_${name}":
67-
command => "echo y | ${virtualenv}/bin/pip uninstall ${proxy_flag} ${name}",
68-
onlyif => "${virtualenv}/bin/pip freeze | grep -i -e ${grep_regex}",
70+
command => "echo y | ${virtualenv}/bin/pip uninstall ${proxy_flag} ${name}",
71+
onlyif => "${virtualenv}/bin/pip freeze | grep -i -e ${grep_regex}",
72+
user => $owner,
6973
}
7074
}
7175
}

0 commit comments

Comments
 (0)