diff --git a/manifests/init.pp b/manifests/init.pp index 368591e9..c0aa6f23 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -82,6 +82,7 @@ $python_pyvenvs = { }, $python_requirements = { }, $use_epel = $python::params::use_epel, + $rhscl_use_public_repository = $python::params::rhscl_use_public_repository, ) inherits python::params{ if $provider != undef and $provider != '' { @@ -90,8 +91,8 @@ } $exec_prefix = $provider ? { - 'scl' => "scl enable ${version} -- ", - 'rhscl' => "scl enable ${version} -- ", + 'scl' => "/usr/bin/scl enable ${version} -- ", + 'rhscl' => "/usr/bin/scl enable ${version} -- ", default => '', } diff --git a/manifests/install.pp b/manifests/install.pp index 1c70640e..57d50735 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -133,35 +133,41 @@ } rhscl: { # rhscl is RedHat SCLs from softwarecollections.org - $scl_package = "rhscl-${::python::version}-epel-${::operatingsystemmajrelease}-${::architecture}" - package { $scl_package: - source => "https://www.softwarecollections.org/en/scls/rhscl/${::python::version}/epel-${::operatingsystemmajrelease}-${::architecture}/download/${scl_package}.noarch.rpm", - provider => 'rpm', - tag => 'python-scl-repo', + if $::python::rhscl_use_public_repository { + $scl_package = "rhscl-${::python::version}-epel-${::operatingsystemmajrelease}-${::architecture}" + package { $scl_package: + source => "https://www.softwarecollections.org/en/scls/rhscl/${::python::version}/epel-${::operatingsystemmajrelease}-${::architecture}/download/${scl_package}.noarch.rpm", + provider => 'rpm', + tag => 'python-scl-repo', + } } Package <| title == 'python' |> { tag => 'python-scl-package', } + Package <| title == 'virtualenv' |> { + name => "${python}-python-virtualenv", + } + package { "${python}-scldevel": ensure => $dev_ensure, tag => 'python-scl-package', } - if $pip_ensure != 'absent' { - exec { 'python-scl-pip-install': - command => "${python::exec_prefix}easy_install pip", - path => ['/usr/bin', '/bin'], - creates => "/opt/rh/${python::version}/root/usr/bin/pip", - } + package { "${python}-python-pip": + ensure => $pip_ensure, + tag => 'python-pip-package', + } + + if $::python::rhscl_use_public_repository { + Package <| tag == 'python-scl-repo' |> -> + Package <| tag == 'python-scl-package' |> } - Package <| tag == 'python-scl-repo' |> -> Package <| tag == 'python-scl-package' |> -> - Exec['python-scl-pip-install'] + Package <| tag == 'python-pip-package' |> } - default: { package { 'pip': diff --git a/manifests/params.pp b/manifests/params.pp index 7937a9d4..ee0a7b97 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -23,4 +23,6 @@ default => 'gunicorn', } + $rhscl_use_public_repository = true + }