tylerwalts / puppet-jdk_oracle Goto Github PK
View Code? Open in Web Editor NEWPuppet module to install JDK from oracle using wget
License: Other
Puppet module to install JDK from oracle using wget
License: Other
wget unzip wget could be declare outside of this module causing duplicate declaration errors.
This was solved on 1.5 by using "if ! defined".. I will provide a PR soon with this change if this works for you.
I have problems with time limit on the wget command.
Debug: Executing 'wget -c --no-cookies --no-check-certificate --header "Cookie:
gpw_e24=http%3A%2F%2Fwww.oracle.com" --header "Cookie: oraclelicense=accept-secu
rebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-
linux-x64.tar.gz" -O jdk-8u11-linux-x64.tar.gz'
Error: Command exceeded timeout
Error: /Stage[main]/Jdk_oracle/Exec[get_jdk_installer]/returns: change from notr
un to 0 failed: Command exceeded timeout
How do I avoid the error?
The notify makes nodes show up with changed in the console, when there are no changes.
https://github.com/tylerwalts/puppet-jdk_oracle/blob/master/manifests/init.pp#L127
Nothing has changed here, but the tests are failing. Found some search results of others having similar issue. It seems to be resolved here:
I tried without success to update the test to work with the latest rspec.
Resolution: It should be fairly obvious when the puppet run fails for unsupported OS versions, so I'm just going to remove the test for failure.
Hi,
I've forked the module in order to bake in support for the RPM bundles which Oracle is shipping and seem to be more up-to-date than the current tgz bundle. As a side effect I've removed compatibility support for non-rpm OS'es and JDK6 as its not in my requirement scope and I was not quite sure how can I make both tgz and rpm work together without a more extensive puppet refactoring. Use code from here if interested
https://github.com/schrepfler/puppet-jdk_oracle
I have JDK 1.8 update 111 installed already on the server and this module will not upgrade Java to update 131? How can I make it always install the default Java 8 version?
At least Debian/Ubuntu
Ubuntu 14.04 LTS comes with update-alternatives installed in /usr/bin/ instead of /usr/sbin/ (which is where is it was in 12.04!), causing your module to fail because of the hard-coded path. Please fix this so your module works with the current version of Ubuntu Server.
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Unsupported platform: hiera("jdk_oracle::platform", "x64"). Implement me? at /etc/puppet/modules/jdk_oracle/manifests/install.pp:29
Currently the minor versions are hard-coded. Need to refactor to make this automatically pick the latest stable release, or at least make this a parameter that the user can specify.
Hello,
Please tell me if I do smth wrong I tried to define versions/build/package. Generated url is not valid one.
Most simple use -> class { 'jdk_oracle': }
output: (puppet)
Error: Execution of '/usr/bin/curl http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz -o /tmp/jdk-8u121-linux-x64.tar.gz_20171024-2558-1wu6zvy -fsSL --max-redirs 5 --cookie oraclelicense=accept-securebackup-cookie' returned 22: curl: (22) The requested URL returned error: 404 Not Found
Error: /Stage[main]/Jdk_oracle/Jdk_oracle::Install[jdk_oracle]/Archive[/opt/jdk-8u121-linux-x64.tar.gz]/ensure: change from absent to present failed: Execution of '/usr/bin/curl http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz -o /tmp/jdk-8u121-linux-x64.tar.gz_20171024-2558-1wu6zvy -fsSL --max-redirs 5 --cookie oraclelicense=accept-securebackup-cookie' returned 22: curl: (22) The requested URL returned error: 404 Not Found
manually the same -> $ /usr/bin/curl http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz -o /tmp/jdk-8u121-linux-x64.tar.gz_20171024-2558-1wu6zvy -fsSL --max-redirs 5 --cookie oraclelicense=accept-securebackup-cookie
curl: (22) The requested URL returned error: 404 Not Found
Thank you in advance
Best Regards
Atanas
The commit 8d1cfae broke the use of $use_cache since the current code don't try to unarchive the cached version of the package.
With PR #79 responding to Oracle's change to the download site to add hashes to the URL, we now all have to be aware of the Oracle hash string (in addition to the build numbers).
This task is to:
Notes:
I forked to add JCE support for java 6, java 7. Was it left out intentionally?
looks like there are many changes needed if I want to install at a custom location with non-root user owning the files. This is not really an issue but would like to have a feature request.
ty
For encryption support
Hi Tyler,
Thanks for the great module , i believe this is an issue correct me if i am wrong . I am using tylerwalts-jdk_oracle (v1.2.1) and once i execute this class in my agent, it throws the below error and i had to comment out the "require => Package['wget']," in line no 85, to successfully execute the module. I did this as i know wget was already there in my agent. I don't find any Package["wget"] resource in the manifests, so either it needs to be added or removed from the require .
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: Exec[get_jdk_installer] { require => Package[wget] }, because Package[wget] doesn't seem to be in the catalog
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
As of yesterday there is a new dependency: puppet-archive
The problem with puppet-archive is that it dropped support for ruby 1.8 in version 1.0.0
Which is the version in CentOS 6.
That means that this module effectively dropped support of CentOS 6 as well.
Which is fine, as long as it is documented.
P.S. We have pinned version to 1.5.0 to get around it
See this stackoverflow post:
http://stackoverflow.com/questions/10268583/downloading-java-jdk-on-linux-via-wget-is-shown-license-page-instead
The wget command to download jdk-8u121 has this new random string in the URL: e9e7ea248e2c4826b92b3f075a80e441
wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz
Manifest:
class { 'jdk_oracle':
package => 'jre',
default_java => true,
version_build => '13',
version_update => '121',
}
Breaks because of:
Error: Execution of '/usr/bin/curl http://download.oracle.com/otn-pub/java/jdk/8u121-b13/jre-8u121-linux-x64.tar.gz -o /tmp/jre-8u121-linux-x64.tar.gz_20170405-21633-50990y -fsSL --max-redirs 5 --cookie oraclelicense=accept-securebackup-cookie' returned 22: curl: (22) The requested URL returned error: 404 Not Found
Error: /Stage[main]/Jdk_oracle/Jdk_oracle::Install[jdk_oracle]/Archive[/opt/jre-8u121-linux-x64.tar.gz]/ensure: change from absent to present failed: Execution of '/usr/bin/curl http://download.oracle.com/otn-pub/java/jdk/8u121-b13/jre-8u121-linux-x64.tar.gz -o /tmp/jre-8u121-linux-x64.tar.gz_20170405-21633-50990y -fsSL --max-redirs 5 --cookie oraclelicense=accept-securebackup-cookie' returned 22: curl: (22) The requested URL returned error: 404 Not Found
Suggested Fix:
Add the path where it's located
diff --git a/manifests/install.pp b/manifests/install.pp
index 7377d7c..bfc239b 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -53,9 +53,15 @@ define jdk_oracle::install(
$pkg_name = "${package}-${version}u${version_u}-linux-${plat_filename}.tar.gz"
# useful to set alternatives priority
$int_version = "1${version}0${version_u}"
- $java_download_uri = "${jdk_oracle::download_url}/jdk/${version}u${version_u}-b${version_b}/${pkg_name}"
- $java_home = "${install_dir}/${package_home}1.${version}.0_${version_u}"
- $jdc_download_uri = "${jdk_oracle::download_url}/jce/8/jce_policy-8.zip"
+ if ($version_u == '121'){
+ $java_download_uri = "${jdk_oracle::download_url}/jdk/${version}u${version_u}-b${version_b}/e9e7ea248e2c4826b92b3f075a80e441/${pkg_name}"
+ $java_home = "${install_dir}/${package_home}1.${version}.0_${version_u}"
+ $jdc_download_uri = "${jdk_oracle::download_url}/jce/8/jce_policy-8.zip"
+ } else {
+ $java_download_uri = "${jdk_oracle::download_url}/jdk/${version}u${version_u}-b${version_b}/${pkg_name}"
+ $java_home = "${install_dir}/${package_home}1.${version}.0_${version_u}"
+ $jdc_download_uri = "${jdk_oracle::download_url}/jce/8/jce_policy-8.zip"
+ }
}
Probably worth investigating other repos for the other permutations of build > path.
For acceptance testing, and to support more platforms.
While Java is available etc when installed through, some packages (specifically installed through dpkg, and likely rpm too) may require have their dependency populated with default-jre, default-jre-headless
amongst other java packages. This means that when installed, dpkg will resolve this as OpenJDK and therefore can result in both OpenJDK and Oracle JDK.
To solve this (at least for dpkg, I'm not sure about other package managers), we can add a new option (potentially set the default to true) which would do the following:
equivs
packages (and any dependencies it requires, shouldn't many if there are)dpkg -i {file.deb}
to install$::jdk_oracle::java_home
$::jdk_oracle::install::java_home
None provide the value of $java_home, as seen in the install.pp file.
Example:
# a Jaspersoft module which relies on tomcat, which relies on java
tomcat::setenv::entry { 'JAVA_HOME':
value => $java_home,
}
At this time, rspec-hiera-puppet is not supported any more and so has not been updated for puppet 4. This issue is logged to remind to come back to this.
This was caught by running lint tests:
manifests/suse.pp - WARNING: top-scope variable being used without an explicit namespace on line 154
manifests/suse.pp - WARNING: top-scope variable being used without an explicit namespace on line 180
There is a variable declared near the top for "java_home_basename" but references are trying to use "java_home_loc_basename", not finding it and trying to look at top scope.
Need to update reference name.
update-alternatives in /usr/bin in Ubuntu 14.10.
It is true for both 14 releases.
Why even deal with explicit location instead of setting up PATH?
It looks like the cleanup in 7ac8c41 got rid of the parameter declaration, which breaks jdk_oracle::suse, resulting in:
Invalid parameter version on Class[Jdk_oracle::Suse] at /etc/puppet/environments/production/modules/jdk_oracle/manifests/init.pp:251
I started using this module to install Oracle Java 8 instead of 7 and the first pass was fine. Today, I tried updating to version 66 from 62 and it looks like puppet is installing the newer version but not setting the new version to the system default (it remains 62). It correctly installs version 66 on new nodes that did not have the previous version. Any ideas? Any help would be appreciated.
Here is what I'm using:
class { 'jdk_oracle':
version => '8',
default_java => true,
install_dir => '/usr/lib/jvm',
version_update => '66',
version_build => '17',
platform => 'x64',
}
I'd add a branch and just submit our changes but that doesn't seem to be allowed, so I'll just file this as a defect report. At FICO, we're using a modified version of your project that correctly handles RHEL and CentOS alternatives
and profile.d
management.
ISSUE: Symbolic links are being used on RHEL and CentOS hosts by the jdk_oracle module to manage what the native alternatives
solution is already responsible for, leaving alternatives
in an inconsistent state. In addition, JAVA_HOME
is not being properly set by this module, leaving Java application developers to find their own way to set this important environment variable.
PROPOSED SOLUTION: We've modified the init.pp
file thusly:
# Set links depending on osfamily or operating system fact
case $::osfamily {
RedHat, Linux: {
# Modified by William W. Kimball, Jr. MBA MSIS of Fair Isaac Corporation
# on 14 AUG 2014 to properly utilize the RedHat alternatives and profile
# systems.
$javaBinDir = "${java_home}/bin"
exec { 'install-java-alternative':
unless => "alternatives --display java | grep link | grep -o '${javaBinDir}/java'",
command => "alternatives --install /usr/bin/java java ${javaBinDir}/java ${version}${version_u}${version_b} --slave /usr/bin/javac javac ${javaBinDir}/javac --slave /usr/bin/jar jar ${javaBinDir}/jar --slave /usr/bin/javadoc javadoc ${javaBinDir}/javadoc --slave /usr/bin/keytool keytool ${javaBinDir}/keytool --slave /usr/bin/orbd orbd ${javaBinDir}/orbd --slave /usr/bin/pack200 pack200 ${javaBinDir}/pack200 --slave /usr/bin/rmid rmid ${javaBinDir}/rmid --slave /usr/bin/rmiregistry rmiregistry ${javaBinDir}/rmiregistry --slave /usr/bin/servertool servertool ${javaBinDir}/servertool --slave /usr/bin/tnameserv tnameserv ${javaBinDir}/tnameserv --slave /usr/bin/unpack200 unpack200 ${javaBinDir}/unpack200 --slave /usr/bin/rmiregistry rmiregistry ${javaBinDir}/rmiregistry",
require => Exec['extract_jdk'],
} -> exec { 'set-java-alternative':
unless => "alternatives --display java | grep link | grep -o '${javaBinDir}/java'",
command => "alternatives --set java ${javaBinDir}/java",
}
file { '/etc/profile.d/java.sh':
ensure => present,
content => "export JAVA_HOME=${java_home}",
require => Exec['extract_jdk'],
}
file { "${install_dir}/java_home":
ensure => link,
target => $java_home,
require => Exec['extract_jdk'],
}
file { "${install_dir}/jdk-${version}":
ensure => link,
target => $java_home,
require => Exec['extract_jdk'],
}
}
... etc ...
Please consider adopting our proposed solution or allowing me to branch/commit the changes to your repository. Thank you very much for providing this module; it has proven to be very useful for our environments!
Since the master branch is 19 commits behind (and some of those include important bug fixes), and there is no response to #36, I'm contemplating forking and releasing this on my own in order to let people access those bug fixes.
Let me know if this is a problem and I'll hold off.
It would be nice to have the option to create a symlink to the specific version of java installed
ie. /opt/jdk-6 -> /opt/jdk1.6.0_45
Running your module from the forge site results in a lot of errors that aren't in the master, as there have been a lot of bugfixes, particularly in relation to Ubuntu.
Please tag a new release when you get a chance.
I get the following exception. As I am new to Puppet I am not exactly sure what is going on. Its happening when I add include jdk_oracle
to my puppet script so it must be something with puppet-jdk_oracle...
==> default: debug: importing '/tmp/vagrant-puppet/modules-d209e7929ea56e9154d59552ff29e2a2/jdk_oracle/manifests/init.pp' in environment production
==> default: debug: Automatically imported jdk_oracle from jdk_oracle into production
==> default: Unknown function hiera at /tmp/vagrant-puppet/modules-d209e7929ea56e9154d59552ff29e2a2/jdk_oracle/manifests/init.pp:53 on node
Could you publish a new release?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.