Merge "Fix update java alternatives on redhat systems"
This commit is contained in:
commit
532299672c
@ -7,7 +7,7 @@ class jenkins::params {
|
||||
'RedHat': {
|
||||
#yum groupinstall "Development Tools"
|
||||
# common packages
|
||||
$jdk_package = 'java-1.7.0-openjdk'
|
||||
$jdk_package = 'java-1.7.0-openjdk-devel'
|
||||
$ccache_package = 'ccache'
|
||||
$python_netaddr_package = 'python-netaddr'
|
||||
# packages needed by slaves
|
||||
|
@ -21,6 +21,8 @@ class jenkins::slave(
|
||||
}
|
||||
}
|
||||
|
||||
anchor { 'jenkins::slave::update-java-alternatives': }
|
||||
|
||||
# Packages that all jenkins slaves need
|
||||
$common_packages = [
|
||||
$::jenkins::params::jdk_package, # jdk for building java jobs
|
||||
@ -82,7 +84,7 @@ class jenkins::slave(
|
||||
|
||||
package { $packages:
|
||||
ensure => present,
|
||||
before => Exec['update-java-alternatives']
|
||||
before => Anchor['jenkins::slave::update-java-alternatives']
|
||||
}
|
||||
|
||||
case $::osfamily {
|
||||
@ -103,6 +105,12 @@ class jenkins::slave(
|
||||
package { $::jenkins::params::mysql_package:
|
||||
ensure => present,
|
||||
}
|
||||
} else {
|
||||
exec { 'update-java-alternatives':
|
||||
unless => '/bin/ls -l /etc/alternatives/java | /bin/grep 1.7.0-openjdk',
|
||||
command => '/usr/sbin/alternatives --set java /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java && /usr/sbin/alternatives --set javac /usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin/javac',
|
||||
require => Anchor['jenkins::slave::update-java-alternatives']
|
||||
}
|
||||
}
|
||||
}
|
||||
'Debian': {
|
||||
@ -147,6 +155,7 @@ class jenkins::slave(
|
||||
exec { 'update-java-alternatives':
|
||||
unless => '/bin/ls -l /etc/alternatives/java | /bin/grep java-7-openjdk-amd64',
|
||||
command => '/usr/sbin/update-java-alternatives --set java-1.7.0-openjdk-amd64',
|
||||
require => Anchor['jenkins::slave::update-java-alternatives']
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user