Skip to content

Commit

Permalink
Fix Ubuntu bionic package installation
Browse files Browse the repository at this point in the history
This rewrites the OS-specific installation to a more generic case
statement. It now only lists the trusty exception for the old naming
which makes it future proof.
  • Loading branch information
ekohl committed Nov 16, 2018
1 parent f274e51 commit b0111c2
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -204,31 +204,34 @@
}
}

if $::osfamily == 'RedHat' {
if $pip_ensure != 'absent' {
if $python::use_epel == true {
include 'epel'
Class['epel'] -> Package['pip']
case $facts['os']['family'] {
'RedHat': {
if $pip_ensure != 'absent' {
if $python::use_epel == true {
include 'epel'
Class['epel'] -> Package['pip']
}
}
if ($venv_ensure != 'absent') and ($::operatingsystemrelease =~ /^6/) {
if $python::use_epel == true {
include 'epel'
Class['epel'] -> Package['virtualenv']
}
}

$virtualenv_package = "${python}-virtualenv"
}
if ($venv_ensure != 'absent') and ($::operatingsystemrelease =~ /^6/) {
if $python::use_epel == true {
include 'epel'
Class['epel'] -> Package['virtualenv']
'Debian': {
if fact('lsbdistcodename') == 'trusty' {
$virtualenv_package = 'python-virtualenv'
} else {
$virtualenv_package = 'virtualenv'
}
}

$virtualenv_package = "${python}-virtualenv"
} else {
if fact('lsbdistcodename') == 'jessie' {
'Gentoo': {
$virtualenv_package = 'virtualenv'
} elsif fact('lsbdistcodename') == 'stretch' {
$virtualenv_package = 'virtualenv'
} elsif fact('lsbdistcodename') == 'xenial' {
$virtualenv_package = 'virtualenv'
} elsif $facts['os']['family'] == 'Gentoo' {
$virtualenv_package = 'virtualenv'
} else {
}
default: {
$virtualenv_package = 'python-virtualenv'
}
}
Expand Down

0 comments on commit b0111c2

Please sign in to comment.