Ask Your Question
0

upgrade java version installed

asked 2016-04-06 16:12:07 -0500

Yeayu gravatar image

Hello all,

I am currently using the official puppetlabs java module to manage the java packages on a set of centOS systems. The current java package installed is: "java-1.7.0-openjdk" and I am planning to upgrade to "java-1.8.0-openjdk".

When the new version of the package is defined in the java module, puppet goes and installs it successfully, however it lefts behind the previous java version also installed... which causes issues with application dependencies.

Is this as expected? if so, what is the best way to ensure that only the java package version defined while invoking the class remains in the system and others are fully removed?

Any help would be much appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-04-12 03:50:45 -0500

updated 2016-04-13 04:02:00 -0500

I've had a look at the code, and I conclude that what you have found is expected. I think the right thing to do here is raise a feature request requesting that the module optionally accept a list of JDK versions to be ensured as absent. In the mean time, you could handle this in your own base class e.g.:

class profile::base (
  $old_javas = [],
) {
  validate_array($old_javas)
  package { $old_javas:
    ensure => absent,
    before => Class['java'],
  }
  require java
}

Then

---
  profile::base::old_javas:
    - 'java-1.6.0-openjdk'
    - 'java-1.7.0-openjdk'
edit flag offensive delete link more

Comments

I've run into a similar problem with my own internal java module.. puppet only manages what you tell it to, so if you just 'remove' the 1.7 management and add 1.8, it will add that. The problem is when the etc-alternatives don't get updated and still point to the old java.

DarylW gravatar imageDarylW ( 2016-04-13 11:33:41 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-04-06 16:12:07 -0500

Seen: 609 times

Last updated: Apr 13 '16