MODULES-5058 Allow a complete URL to be passed to the java::oracle class
This provides a workaround to the issue of Oracle changing it's URL structure which breaks the dynamic URL building in the module. It allows a complete URL to be passed as an alternative to one built by the logic in the module, and allows the rest of the module to function as expected when this situation is encountered. Changes made to manifests/oracle.pp to pass URL in `url` parameter (if defined) to the `source` directive of the archive resource which fetches the installer package. README.markdown has been updated to document the additional parameter, as well as a note added to known issues describing it's operation. A test has been added to spec/defines/oracle_spec.rb to verify the correct package is present in the tmp archive location. The spec tests have passed and the revised workflow has been tested in a lab environment and found to be working.
This commit is contained in:
@@ -80,7 +80,8 @@
|
||||
#
|
||||
# [*url*]
|
||||
# Full URL, including oracle_url, release_major, release_minor and package_name, to
|
||||
# download the Oracle java_se installer.
|
||||
# download the Oracle java_se installer. Originally present but not used, activated
|
||||
# to workaround MODULES-5058
|
||||
#
|
||||
# ### Author
|
||||
# mike@marseglia.org
|
||||
@@ -94,6 +95,7 @@ define java::oracle (
|
||||
$oracle_url = 'http://download.oracle.com/otn-pub/java/jdk/',
|
||||
$proxy_server = undef,
|
||||
$proxy_type = undef,
|
||||
$url = undef,
|
||||
) {
|
||||
|
||||
# archive module is used to download the java package
|
||||
@@ -196,6 +198,13 @@ define java::oracle (
|
||||
}
|
||||
}
|
||||
|
||||
# if complete URL is provided, use this value for source in archive resource
|
||||
if $url {
|
||||
$source = $url
|
||||
} else {
|
||||
$source = "${oracle_url}${release_major}-${release_minor}/${package_name}"
|
||||
}
|
||||
|
||||
# full path to the installer
|
||||
$destination = "${destination_dir}${package_name}"
|
||||
notice ("Destination is ${destination}")
|
||||
@@ -219,7 +228,7 @@ define java::oracle (
|
||||
'present' : {
|
||||
archive { $destination :
|
||||
ensure => present,
|
||||
source => "${oracle_url}${release_major}-${release_minor}/${package_name}",
|
||||
source => $source,
|
||||
cookie => 'gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie',
|
||||
extract_path => '/tmp',
|
||||
cleanup => false,
|
||||
|
||||
Reference in New Issue
Block a user