From bb6972e28ab8dd84f06e802776d62112ce1822a2 Mon Sep 17 00:00:00 2001 From: Ernesto Ruy Sanchez Date: Tue, 15 Dec 2015 12:13:54 -0800 Subject: [PATCH 1/2] fixed virtalenv and gunicorn package name for centos scl --- manifests/install.pp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index b0b63d21..513048a2 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,9 +215,15 @@ 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', @@ -218,7 +231,7 @@ default => $python::gunicorn, } - package { 'gunicorn': + package { $gunicorn_package: ensure => $gunicorn_ensure, } } From bcf8a9bfe0a15baeee254b4bcb3971ef6a4e73e3 Mon Sep 17 00:00:00 2001 From: Ernesto Ruy Sanchez Date: Wed, 16 Dec 2015 10:45:04 -0800 Subject: [PATCH 2/2] install gunicorn even if not managing service --- manifests/install.pp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index 513048a2..3e66c90a 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -230,9 +230,10 @@ false => 'absent', default => $python::gunicorn, } + } - package { $gunicorn_package: - ensure => $gunicorn_ensure, - } + package { $gunicorn_package: + ensure => $gunicorn_ensure, } + }