diff --git a/manifests/install.pp b/manifests/install.pp index b0b63d21..3e66c90a 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -18,7 +18,7 @@ $python = $::python::version ? { 'system' => 'python', 'pypy' => 'pypy', - default => $python::version, + default => "${python::version}", } $pythondev = $::osfamily ? { @@ -50,11 +50,6 @@ name => $python, } - package { 'virtualenv': - ensure => $venv_ensure, - require => Package['python'], - } - case $python::provider { pip: { @@ -68,6 +63,9 @@ name => $pythondev, } + $gunicorn_package = 'gunicorn' + $virtualenv_package = 'virtualenv' + # Install pip without pip, see https://pip.pypa.io/en/stable/installing/. exec { 'bootstrap pip': command => '/usr/bin/curl https://bootstrap.pypa.io/get-pip.py | python', @@ -103,6 +101,9 @@ default => 'absent', } + $gunicorn_package = 'python-gunicorn' + $virtualenv_package = 'python-virtualenv' + package { 'centos-release-SCL': ensure => $install_scl_repo_package, before => Package['scl-utils'], @@ -139,6 +140,9 @@ tag => 'python-scl-repo', } + $gunicorn_package = 'python-gunicorn' + $virtualenv_package = 'python-virtualenv' + Package <| title == 'python' |> { tag => 'python-scl-package', } @@ -173,6 +177,9 @@ name => $pythondev, } + $gunicorn_package = 'gunicorn' + $virtualenv_package = 'virtualenv' + if $::osfamily == 'RedHat' { if $pip_ensure != 'absent' { if $python::use_epel == true { @@ -208,18 +215,25 @@ Package <| title == 'virtualenv' |> { name => $virtualenv_package, } + } } + package { $virtualenv_package: + ensure => $venv_ensure, + require => Package['python'], + } + if $python::manage_gunicorn { $gunicorn_ensure = $python::gunicorn ? { true => 'present', false => 'absent', default => $python::gunicorn, } + } - package { 'gunicorn': - ensure => $gunicorn_ensure, - } + package { $gunicorn_package: + ensure => $gunicorn_ensure, } + }