Skip to content

Commit 9e990b6

Browse files
committed
Added rhscl provider from softwarecollections.org
1 parent 55b942d commit 9e990b6

4 files changed

Lines changed: 35 additions & 5 deletions

File tree

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,9 @@ python::python_pips:
280280
281281
### Using SCL packages from RedHat or CentOS
282282
283-
To use this module with the Red Hat Software Collections (SCL) or the CentOS
284-
equivalents, set python::provider to 'scl' and python::version to the name of
285-
the collection you want to use (e.g., 'python27', 'python33', or
286-
'rh-python34').
283+
To use this module with Linux distributions in the Red Hat family and python distributions
284+
from softwarecollections.org, set python::provider to 'rhscl' and python::version to the name
285+
of the collection you want to use (e.g., 'python27', 'python33', or 'rh-python34').
287286
288287
289288
## Authors

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272

7373
# validate inputs
7474
if $provider != undef {
75-
validate_re($provider, ['^(pip|scl)$'], 'Only "pip" or "scl" are valid providers besides the system default.')
75+
validate_re($provider, ['^(pip|scl|rhscl)$'], 'Only "pip", "rhscl", and "scl" are valid providers besides the system default.')
7676
}
7777

7878
if $provider == 'pip' {

manifests/install.pp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,36 @@
101101
creates => "/opt/rh/${python::version}/root/usr/bin/pip",
102102
}
103103
}
104+
rhscl: {
105+
# rhscl is RedHat SCLs from softwarecollections.org
106+
$scl_package = "rhscl-${::python::version}-epel-${::operatingsystemmajrelease}-${::architecture}"
107+
package { $scl_package:
108+
source => "https://www.softwarecollections.org/en/scls/rhscl/${::python::version}/epel-${::operatingsystemmajrelease}-${::architecture}/download/${scl_package}.noarch.rpm",
109+
provider => 'rpm',
110+
tag => 'python-scl-repo',
111+
}
112+
113+
package { $::python::version:
114+
ensure => present,
115+
tag => 'python-scl-package',
116+
}
117+
118+
package { "${python::version}-scldev":
119+
ensure => $dev_ensure,
120+
tag => 'python-scl-package',
121+
}
122+
123+
if $pip_ensure {
124+
exec { 'python-scl-pip-install':
125+
command => "${python::params::exec_prefix}easy_install pip",
126+
path => ['/usr/bin', '/bin'],
127+
creates => "/opt/rh/${python::version}/root/usr/bin/pip",
128+
}
129+
}
130+
Package <| tag == 'python-scl-repo' |> ->
131+
Package <| tag == 'python-scl-package' |> ->
132+
Exec['python-scl-pip-install']
133+
}
104134
default: {
105135
if $::osfamily == 'RedHat' {
106136
if $pip_ensure == present {

manifests/pyvenv.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363

6464
$virtualenv_cmd = $python::provider ? {
6565
'scl' => "scl enable ${python::version} -- pyvenv --clear",
66+
'rhscl' => "scl enable ${python::version} -- pyvenv --clear",
6667
default => $version ? {
6768
'system' => 'pyvenv',
6869
default => "pyvenv-${version}",

0 commit comments

Comments
 (0)