Skip to content

Commit 795143b

Browse files
authored
Merge pull request voxpupuli#328 from diLLec/master
RHSCL Repository installation made optional
2 parents 7237071 + 18bef76 commit 795143b

3 files changed

Lines changed: 25 additions & 16 deletions

File tree

manifests/init.pp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
$python_pyvenvs = { },
8383
$python_requirements = { },
8484
$use_epel = $python::params::use_epel,
85+
$rhscl_use_public_repository = $python::params::rhscl_use_public_repository,
8586
) inherits python::params{
8687

8788
if $provider != undef and $provider != '' {
@@ -90,8 +91,8 @@
9091
}
9192

9293
$exec_prefix = $provider ? {
93-
'scl' => "scl enable ${version} -- ",
94-
'rhscl' => "scl enable ${version} -- ",
94+
'scl' => "/usr/bin/scl enable ${version} -- ",
95+
'rhscl' => "/usr/bin/scl enable ${version} -- ",
9596
default => '',
9697
}
9798

manifests/install.pp

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,35 +133,41 @@
133133
}
134134
rhscl: {
135135
# rhscl is RedHat SCLs from softwarecollections.org
136-
$scl_package = "rhscl-${::python::version}-epel-${::operatingsystemmajrelease}-${::architecture}"
137-
package { $scl_package:
138-
source => "https://www.softwarecollections.org/en/scls/rhscl/${::python::version}/epel-${::operatingsystemmajrelease}-${::architecture}/download/${scl_package}.noarch.rpm",
139-
provider => 'rpm',
140-
tag => 'python-scl-repo',
136+
if $::python::rhscl_use_public_repository {
137+
$scl_package = "rhscl-${::python::version}-epel-${::operatingsystemmajrelease}-${::architecture}"
138+
package { $scl_package:
139+
source => "https://www.softwarecollections.org/en/scls/rhscl/${::python::version}/epel-${::operatingsystemmajrelease}-${::architecture}/download/${scl_package}.noarch.rpm",
140+
provider => 'rpm',
141+
tag => 'python-scl-repo',
142+
}
141143
}
142144

143145
Package <| title == 'python' |> {
144146
tag => 'python-scl-package',
145147
}
146148

149+
Package <| title == 'virtualenv' |> {
150+
name => "${python}-python-virtualenv",
151+
}
152+
147153
package { "${python}-scldevel":
148154
ensure => $dev_ensure,
149155
tag => 'python-scl-package',
150156
}
151157

152-
if $pip_ensure != 'absent' {
153-
exec { 'python-scl-pip-install':
154-
command => "${python::exec_prefix}easy_install pip",
155-
path => ['/usr/bin', '/bin'],
156-
creates => "/opt/rh/${python::version}/root/usr/bin/pip",
157-
}
158+
package { "${python}-python-pip":
159+
ensure => $pip_ensure,
160+
tag => 'python-pip-package',
161+
}
162+
163+
if $::python::rhscl_use_public_repository {
164+
Package <| tag == 'python-scl-repo' |> ->
165+
Package <| tag == 'python-scl-package' |>
158166
}
159167

160-
Package <| tag == 'python-scl-repo' |> ->
161168
Package <| tag == 'python-scl-package' |> ->
162-
Exec['python-scl-pip-install']
169+
Package <| tag == 'python-pip-package' |>
163170
}
164-
165171
default: {
166172

167173
package { 'pip':

manifests/params.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@
2323
default => 'gunicorn',
2424
}
2525

26+
$rhscl_use_public_repository = true
27+
2628
}

0 commit comments

Comments
 (0)