Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHSCL Repository installation made optional #328

Merged
merged 3 commits into from
Sep 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 != '' {
Expand All @@ -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 => '',
}

Expand Down
34 changes: 20 additions & 14 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
default => 'gunicorn',
}

$rhscl_use_public_repository = true

}