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!
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
alternativesandprofile.dmanagement.ISSUE: Symbolic links are being used on RHEL and CentOS hosts by the jdk_oracle module to manage what the native
alternativessolution is already responsible for, leavingalternativesin an inconsistent state. In addition,JAVA_HOMEis 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.ppfile thusly: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!