
Use versioncmp, otherwise with puppet 4 (as on Fedora 22) you get "A String is not comparable to a non String". We also inverted the versioncmp check for the version variable, the main reason for this was to reduce complexity of the versioncmp code. Additionally, defining 0 to be the latest version didn't really make sense. So, changing it to use 'latest' means better code readability. Change-Id: Ic8b0fd2a19cbb90e1d57e3025a3d2513ebada2e2 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
60 lines
1.8 KiB
Puppet
60 lines
1.8 KiB
Puppet
# Class: jenkins::params
|
|
#
|
|
# This class holds parameters that need to be
|
|
# accessed by other classes.
|
|
class jenkins::params {
|
|
case $::osfamily {
|
|
'RedHat': {
|
|
#yum groupinstall "Development Tools"
|
|
# common packages
|
|
if ($::operatingsystem == 'Fedora') and (versioncmp($::operatingsystemrelease, '21') >= 0) {
|
|
$jdk_package = 'java-1.8.0-openjdk-devel'
|
|
} else {
|
|
$jdk_package = 'java-1.7.0-openjdk-devel'
|
|
}
|
|
$ccache_package = 'ccache'
|
|
$python_netaddr_package = 'python-netaddr'
|
|
# FIXME: No Maven packages on RHEL
|
|
#$maven_package = 'maven'
|
|
$cgroups_package = 'libcgroup'
|
|
if ($::operatingsystem == 'Fedora') and (versioncmp($::operatingsystemrelease, '19') >= 0) {
|
|
$cgroups_tools_package = 'libcgroup-tools'
|
|
$cgconfig_require = [
|
|
Package['cgroups'],
|
|
Package['cgroups-tools'],
|
|
]
|
|
$cgred_require = [
|
|
Package['cgroups'],
|
|
Package['cgroups-tools'],
|
|
]
|
|
} else {
|
|
$cgroups_tools_package = ''
|
|
$cgconfig_require = Package['cgroups']
|
|
$cgred_require = Package['cgroups']
|
|
}
|
|
}
|
|
'Debian': {
|
|
# common packages
|
|
$jdk_package = 'openjdk-7-jdk'
|
|
$ccache_package = 'ccache'
|
|
$python_netaddr_package = 'python-netaddr'
|
|
$maven_package = 'maven2'
|
|
$ruby1_9_1_package = 'ruby1.9.1'
|
|
$ruby1_9_1_dev_package = 'ruby1.9.1-dev'
|
|
$cgroups_package = 'cgroup-bin'
|
|
$cgroups_tools_package = ''
|
|
$cgconfig_require = [
|
|
Package['cgroups'],
|
|
File['/etc/init/cgconfig.conf'],
|
|
]
|
|
$cgred_require = [
|
|
Package['cgroups'],
|
|
File['/etc/init/cgred.conf'],
|
|
]
|
|
}
|
|
default: {
|
|
fail("Unsupported osfamily: ${::osfamily} The 'jenkins' module only supports osfamily Debian or RedHat (slaves only).")
|
|
}
|
|
}
|
|
}
|