Skip to content

Commit

Permalink
switch Jenkins to use Java 17
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Jan 6, 2025
1 parent e34a3df commit 0c7333e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
13 changes: 10 additions & 3 deletions puppet/modules/jenkins_node/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@
include fastly_purge

if $facts['os']['family'] == 'RedHat' {
$java_package = 'java-11-openjdk-headless'
$java_package = 'java-17-openjdk-headless'

package { ['java-1.8.0-openjdk', 'java-1.8.0-openjdk-headless', 'java-1.8.0-openjdk-devel']:
package { ['java-11-openjdk', 'java-11-openjdk-headless', 'java-11-openjdk-devel']:
ensure => absent,
}
Package['java-1.8.0-openjdk-devel'] -> Package['java-1.8.0-openjdk'] -> Package['java-1.8.0-openjdk-headless']
Package['java-11-openjdk-devel'] -> Package['java-11-openjdk'] -> Package['java-11-openjdk-headless']
} elsif $facts['os']['family'] == 'Debian' {
$java_package = 'openjdk-17-jdk'

package { ['openjdk-11-jdk', 'openjdk-11-jdk-headless', 'openjdk-11-jre', 'openjdk-11-jre-headless']:
ensure => absent,
}
Package['openjdk-11-jdk'] -> Package['openjdk-11-jre'] -> Package['openjdk-11-jdk-headless'] -> Package['openjdk-11-jre-headless']
} else {
$java_package = undef
}
Expand Down
7 changes: 6 additions & 1 deletion puppet/modules/profiles/manifests/jenkins/controller.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@
Boolean $jenkins_job_builder = true,
Optional[String] $jenkins_job_builder_username = undef,
Optional[String] $jenkins_job_builder_password = undef,
Array[String[1]] $packages = ['java-11-openjdk-headless', 'java-11-openjdk-devel', 'fontconfig'],
Array[String[1]] $packages = ['java-17-openjdk-headless', 'java-17-openjdk-devel', 'fontconfig'],
Array[String[1]] $plugins = [],
) {
stdlib::ensure_packages($packages)

package { ['java-11-openjdk', 'java-11-openjdk-headless', 'java-11-openjdk-devel']:
ensure => absent,
}
Package['java-11-openjdk-devel'] -> Package['java-11-openjdk'] -> Package['java-11-openjdk-headless']

class { 'jenkins':
install_java => false,
lts => true,
Expand Down
12 changes: 4 additions & 8 deletions puppet/modules/unattended/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
auto => { 'reboot' => false },
blacklist => [
'docker-ce',
'openjdk-8-jdk',
'openjdk-8-jdk-headless',
'openjdk-8-jre',
'openjdk-8-jre-headless',
'openjdk-11-jdk',
'openjdk-11-jdk-headless',
'openjdk-11-jre',
'openjdk-11-jre-headless',
'openjdk-17-jdk',
'openjdk-17-jdk-headless',
'openjdk-17-jre',
'openjdk-17-jre-headless',
],
mail => { 'to' => 'sysadmins', },
}
Expand Down

0 comments on commit 0c7333e

Please sign in to comment.