Skip to content

Commit 01fba18

Browse files
Merge pull request #473 from cbobinec/add-url-parameter
Add url parameter for adoptopenjdk
2 parents bdf8c34 + 4e22179 commit 01fba18

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

REFERENCE.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ The following parameters are available in the `java::adopt` defined type:
127127
* [`java`](#java)
128128
* [`proxy_server`](#proxy_server)
129129
* [`proxy_type`](#proxy_type)
130+
* [`url`](#url)
130131
* [`basedir`](#basedir)
131132
* [`manage_basedir`](#manage_basedir)
132133
* [`package_type`](#package_type)
@@ -189,6 +190,14 @@ Proxy server type (none|http|https|ftp). (passed to archive)
189190

190191
Default value: ``undef``
191192

193+
##### <a name="url"></a>`url`
194+
195+
Data type: `Any`
196+
197+
Full URL
198+
199+
Default value: ``undef``
200+
192201
##### <a name="basedir"></a>`basedir`
193202

194203
Data type: `Any`
@@ -481,4 +490,3 @@ Data type: `Any`
481490
The name for the optional symlink in the installation directory.
482491

483492
Default value: ``undef``
484-

manifests/adopt.pp

+13-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
# @param proxy_type
2525
# Proxy server type (none|http|https|ftp). (passed to archive)
2626
#
27+
# @param url
28+
# Full URL
29+
#
2730
# @param basedir
2831
# Directory under which the installation will occur. If not set, defaults to
2932
# /usr/lib/jvm for Debian and /usr/java for RedHat.
@@ -51,6 +54,7 @@
5154
$java = 'jdk',
5255
$proxy_server = undef,
5356
$proxy_type = undef,
57+
$url = undef,
5458
$basedir = undef,
5559
$manage_basedir = true,
5660
$package_type = undef,
@@ -234,7 +238,15 @@
234238
$spacer = '%2B'
235239
$download_folder_prefix = 'jdk-'
236240
}
237-
$source = "https://github.com/AdoptOpenJDK/openjdk${_version}-binaries/releases/download/${download_folder_prefix}${release_major}${spacer}${release_minor}/${package_name}"
241+
242+
# if complete URL is provided, use this value for source in archive resource
243+
if $url {
244+
$source = $url
245+
}
246+
else {
247+
$source = "https://github.com/AdoptOpenJDK/openjdk${_version}-binaries/releases/download/${download_folder_prefix}${release_major}${spacer}${release_minor}/${package_name}"
248+
notice ("Default source url : ${source}")
249+
}
238250

239251
# full path to the installer
240252
$destination = "${destination_dir}${package_name}"

0 commit comments

Comments
 (0)