Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing utilization of RHEL/CentOS 'alternatives' and 'profile.d' #30

Open
fico-williamkimball opened this issue Sep 19, 2014 · 2 comments

Comments

@fico-williamkimball
Copy link

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!

@tylerwalts
Copy link
Owner

Hi William,

Thanks for the feedback, and I am glad you are finding the module useful. I would be happy to take in a Pull Request from you, and it would allow you to retain credit for the commit without having to note it as a source code comment. Here's how to go about it the GitHub Way:

  1. Navigate to my repo, and then Fork it into your account using the button in the top-right.
  2. Clone your fork onto your localhost and make your desired changes.
  3. Commit your changes and push up into your fork in GitHub.
  4. Navigate to your forked repo, then click the green Compare icon in the top-left area of the source window
  5. Compare it to my branch, then click the Create Pull Request button to make a PR using the diff from your branch.

More info here: https://help.github.com/articles/using-pull-requests

Thanks,

  • Tyler

@fico-williamkimball
Copy link
Author

Done and done; thanks so much!

William W. Kimball, Jr.
Solution Integration – Engineer II

FICO
[email protected]:[email protected]
www.fico.comhttp://www.fico.com/

From: tylerwalts [mailto:[email protected]]
Sent: Friday, September 19, 2014 6:41 PM
To: tylerwalts/puppet-jdk_oracle
Cc: William Kimball
Subject: Re: [puppet-jdk_oracle] Missing utilization of RHEL/CentOS 'alternatives' and 'profile.d' (#30)

Hi William,

Thanks for the feedback, and I am glad you are finding the module useful. I would be happy to take in a Pull Request from you, and it would allow you to retain credit for the commit without having to note it as a source code comment. Here's how to go about it the GitHub Way:

  1. Navigate to my repo, and then Fork it into your account using the button in the top-right.
  2. Clone your fork onto your localhost and make your desired changes.
  3. Commit your changes and push up into your fork in GitHub.
  4. Navigate to your forked repo, then click the green Compare icon in the top-left area of the source window
  5. Compare it to my branch, then click the Create Pull Request button to make a PR using the diff from your branch.

More info here: https://help.github.com/articles/using-pull-requests

Thanks,

  • Tyler


Reply to this email directly or view it on GitHubhttps://github.com//issues/30#issuecomment-56248956.

This email and any files transmitted with it are confidential, proprietary and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete it immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants