Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ The following parameters are available in the `java::adopt` defined type:
* [`java`](#java)
* [`proxy_server`](#proxy_server)
* [`proxy_type`](#proxy_type)
* [`url`](#url)
* [`basedir`](#basedir)
* [`manage_basedir`](#manage_basedir)
* [`package_type`](#package_type)
Expand Down Expand Up @@ -189,6 +190,14 @@ Proxy server type (none|http|https|ftp). (passed to archive)

Default value: ``undef``

##### <a name="url"></a>`url`

Data type: `Any`

Full URL

Default value: ``undef``

##### <a name="basedir"></a>`basedir`

Data type: `Any`
Expand Down Expand Up @@ -481,4 +490,3 @@ Data type: `Any`
The name for the optional symlink in the installation directory.

Default value: ``undef``

14 changes: 13 additions & 1 deletion manifests/adopt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
# @param proxy_type
# Proxy server type (none|http|https|ftp). (passed to archive)
#
# @param url
# Full URL
#
# @param basedir
# Directory under which the installation will occur. If not set, defaults to
# /usr/lib/jvm for Debian and /usr/java for RedHat.
Expand Down Expand Up @@ -51,6 +54,7 @@
$java = 'jdk',
$proxy_server = undef,
$proxy_type = undef,
$url = undef,
$basedir = undef,
$manage_basedir = true,
$package_type = undef,
Expand Down Expand Up @@ -234,7 +238,15 @@
$spacer = '%2B'
$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
$destination = "${destination_dir}${package_name}"
Expand Down