Merge pull request #344 from HielkeJ/jce_link

MODULES-8613: Add option to set a custom JCE download URL
This commit is contained in:
lionce
2019-04-23 13:16:18 +03:00
committed by GitHub

View File

@@ -50,6 +50,9 @@
# @param jce # @param jce
# Install Oracles Java Cryptographic Extensions into the JRE or JDK # Install Oracles Java Cryptographic Extensions into the JRE or JDK
# #
# @param jce_url
# Full URL to the jce zip file
#
# @param basedir # @param basedir
# Directory under which the installation will occur. If not set, defaults to # Directory under which the installation will occur. If not set, defaults to
# /usr/lib/jvm for Debian and /usr/java for RedHat. # /usr/lib/jvm for Debian and /usr/java for RedHat.
@@ -81,6 +84,7 @@ define java::oracle (
$url = undef, $url = undef,
$url_hash = undef, $url_hash = undef,
$jce = false, $jce = false,
$jce_url = undef,
$basedir = undef, $basedir = undef,
$manage_basedir = false, $manage_basedir = false,
$package_type = undef, $package_type = undef,
@@ -97,11 +101,17 @@ define java::oracle (
} }
if $jce { if $jce {
$jce_download = $version ? { if $jce_url {
'8' => 'http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip', $jce_download = $jce_url
'7' => 'http://download.oracle.com/otn-pub/java/jce/7/UnlimitedJCEPolicyJDK7.zip', $cookie = undef
'6' => 'http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip', } else {
default => undef $jce_download = $version ? {
'8' => 'http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip',
'7' => 'http://download.oracle.com/otn-pub/java/jce/7/UnlimitedJCEPolicyJDK7.zip',
'6' => 'http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip',
default => undef
}
$cookie = 'gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie'
} }
} }
@@ -329,7 +339,7 @@ define java::oracle (
} }
archive { "/tmp/jce-${version}.zip": archive { "/tmp/jce-${version}.zip":
source => $jce_download, source => $jce_download,
cookie => 'gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie', cookie => $cookie,
extract => true, extract => true,
extract_path => $jce_path, extract_path => $jce_path,
extract_flags => '-oj', extract_flags => '-oj',
@@ -353,5 +363,4 @@ define java::oracle (
notice ("Action ${ensure} not supported.") notice ("Action ${ensure} not supported.")
} }
} }
} }