diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 3 | ||||
-rw-r--r-- | manifests/install.pp | 17 |
2 files changed, 18 insertions, 2 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 2a9a44c..cc9336f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,7 +14,8 @@ # Install python-dev. Default: false # # [*virtualenv*] -# Install python-virtualenv. Default: false +# Install python-virtualenv. Default: false, also accepts 'pip' which will +# install latest virtualenv from pip rather than package manager # # [*gunicorn*] # Install Gunicorn. Default: false diff --git a/manifests/install.pp b/manifests/install.pp index 9306e3a..10331ff 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -28,9 +28,24 @@ class python::install { $venv_ensure = $python::virtualenv ? { true => present, default => absent, + pip => absent, } - package { 'python-virtualenv': ensure => $venv_ensure } + case $venv_ensure { + 'pip': { + exec { "pip-virtualenv": + command => "pip install --upgrade virtualenv", + cwd => $cwd, + user => $run_as_user, + timeout => 0, + path => ["/usr/local/bin","/usr/bin","/bin", "/usr/sbin"], + require => Package['python-pip'] + } + } + default: { + package { 'python-virtualenv': ensure => $venv_ensure } + } + } $gunicorn_ensure = $python::gunicorn ? { true => present, |