Merge pull request #473 from cbobinec/add-url-parameter

Add url parameter for adoptopenjdk
This commit is contained in:
daianamezdrea
2021-04-26 11:45:58 +03:00
committed by GitHub
2 changed files with 22 additions and 2 deletions

View File

@@ -127,6 +127,7 @@ The following parameters are available in the `java::adopt` defined type:
* [`java`](#java) * [`java`](#java)
* [`proxy_server`](#proxy_server) * [`proxy_server`](#proxy_server)
* [`proxy_type`](#proxy_type) * [`proxy_type`](#proxy_type)
* [`url`](#url)
* [`basedir`](#basedir) * [`basedir`](#basedir)
* [`manage_basedir`](#manage_basedir) * [`manage_basedir`](#manage_basedir)
* [`package_type`](#package_type) * [`package_type`](#package_type)
@@ -189,6 +190,14 @@ Proxy server type (none|http|https|ftp). (passed to archive)
Default value: ``undef`` Default value: ``undef``
##### <a name="url"></a>`url`
Data type: `Any`
Full URL
Default value: ``undef``
##### <a name="basedir"></a>`basedir` ##### <a name="basedir"></a>`basedir`
Data type: `Any` Data type: `Any`
@@ -481,4 +490,3 @@ Data type: `Any`
The name for the optional symlink in the installation directory. The name for the optional symlink in the installation directory.
Default value: ``undef`` Default value: ``undef``

View File

@@ -24,6 +24,9 @@
# @param proxy_type # @param proxy_type
# Proxy server type (none|http|https|ftp). (passed to archive) # Proxy server type (none|http|https|ftp). (passed to archive)
# #
# @param url
# Full URL
#
# @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.
@@ -51,6 +54,7 @@ define java::adopt (
$java = 'jdk', $java = 'jdk',
$proxy_server = undef, $proxy_server = undef,
$proxy_type = undef, $proxy_type = undef,
$url = undef,
$basedir = undef, $basedir = undef,
$manage_basedir = true, $manage_basedir = true,
$package_type = undef, $package_type = undef,
@@ -234,7 +238,15 @@ define java::adopt (
$spacer = '%2B' $spacer = '%2B'
$download_folder_prefix = 'jdk-' $download_folder_prefix = 'jdk-'
} }
$source = "https://github.com/AdoptOpenJDK/openjdk${_version}-binaries/releases/download/${download_folder_prefix}${release_major}${spacer}${release_minor}/${package_name}"
# if complete URL is provided, use this value for source in archive resource
if $url {
$source = $url
}
else {
$source = "https://github.com/AdoptOpenJDK/openjdk${_version}-binaries/releases/download/${download_folder_prefix}${release_major}${spacer}${release_minor}/${package_name}"
notice ("Default source url : ${source}")
}
# full path to the installer # full path to the installer
$destination = "${destination_dir}${package_name}" $destination = "${destination_dir}${package_name}"