Skip to content

Commit c3d71b4

Browse files
committed
Use virtual Java packages on Red Hat and set java_bin
This uses the virtual packages jre-VERSION-headless instead of explicitly openjdk. This allows other JREs to provide the same. It also uses an explicit path to the JRE specific java bin. At least on EL9 this allows the following upgrade path to work: dnf install https://yum.puppet.com/puppet7-release-el-9.noarch.rpm dnf install puppetserver dnf install https://yum.puppet.com/puppet8-release-el-9.noarch.rpm dnf upgrade puppetserver Prior to this patch it would break, because it used /usr/bin/java which will point to Java 8. By using /usr/lib/jvm/jre-17/bin/java we know for sure it is Java 17.
1 parent 2162aa3 commit c3d71b4

File tree

1 file changed

+7
-3
lines changed
  • resources/puppetlabs/lein-ezbake/template/global/ext

1 file changed

+7
-3
lines changed

resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,20 @@
190190
options.systemd_el = 1
191191
elsif options.operating_system == :el && options.os_version >= 7 # systemd el
192192
if ! options.is_pe
193+
# https://bugzilla.redhat.com/show_bug.cgi?id=2224427
193194
fpm_opts << "--depends tzdata-java"
194195
case options.platform_version
195196
when 8
196197
# rpm on Redhat 7 may not support OR dependencies
197198
if options.os_version == 7
198-
options.java = 'java-11-openjdk-headless'
199+
options.java = 'jre-11-headless'
200+
options.java_bin = '/usr/lib/jvm/jre-11/bin/java'
199201
elsif options.os_version == 8
200-
options.java = '(java-17-openjdk-headless or java-11-openjdk-headless)'
202+
options.java = '(jre-17-headless or jre-11-headless)'
203+
# TODO: which bin to use? /usr/bin/java may be anything
201204
elsif options.os_version >= 9
202-
'options.java = java-17-openjdk-headless'
205+
options.java = 'jre-17-headless'
206+
options.java_bin = '/usr/lib/jvm/jre-17/bin/java'
203207
else
204208
fail "Unrecognized el os version #{options.os_version}"
205209
end

0 commit comments

Comments
 (0)