From 3c606c95e12be941529fdf86c14f3f35bcddbf69 Mon Sep 17 00:00:00 2001 From: Fotis Gimian Date: Mon, 3 Jun 2013 19:41:24 +1000 Subject: Added owner, group to the pip class which ensures that packages will be installed with the correct permissions. --- manifests/pip.pp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'manifests') diff --git a/manifests/pip.pp b/manifests/pip.pp index 3a8ec1b..b40b916 100644 --- a/manifests/pip.pp +++ b/manifests/pip.pp @@ -29,9 +29,11 @@ # define python::pip ( $virtualenv, - $ensure = present, - $url = false, - $proxy = false + $ensure = present, + $url = false, + $owner = 'root', + $group = 'root', + $proxy = false ) { # Parameter validation @@ -57,15 +59,17 @@ define python::pip ( case $ensure { present: { exec { "pip_install_${name}": - command => "${virtualenv}/bin/pip install ${proxy_flag} ${source}", - unless => "${virtualenv}/bin/pip freeze | grep -i -e ${grep_regex}", + command => "${virtualenv}/bin/pip install ${proxy_flag} ${source}", + unless => "${virtualenv}/bin/pip freeze | grep -i -e ${grep_regex}", + user => $owner, } } default: { exec { "pip_uninstall_${name}": - command => "echo y | ${virtualenv}/bin/pip uninstall ${proxy_flag} ${name}", - onlyif => "${virtualenv}/bin/pip freeze | grep -i -e ${grep_regex}", + command => "echo y | ${virtualenv}/bin/pip uninstall ${proxy_flag} ${name}", + onlyif => "${virtualenv}/bin/pip freeze | grep -i -e ${grep_regex}", + user => $owner, } } } -- cgit v1.2.3