azavea / ansible-java

An Ansible role for installing Java.
Apache License 2.0
4 stars 15 forks source link

Check for an existing java before install. #1

Closed matt2000 closed 9 years ago

matt2000 commented 9 years ago

This makes it easy to use, for example, Oracle Java, with other roles that depend on this role. I just set the Oracle Java role to go first.

hectcastro commented 9 years ago

Hey @matt2000, thanks for using our roles and for taking the time to assemble a PR.

We are going to hit this problem soon as well, and are looking to conditionalize the azavea.java role so that it supports OpenJDK and Oracle JVM. Would that solve your problem too?

Ultimately, azavea.java would have an attribute that determines which flavor of the JDK is installed:

java_flavor: "openjdk"
matt2000 commented 9 years ago

Yeah that would work too. This was the quick & easy solution that let me use your existing oracle-java role unmodified.

hectcastro commented 9 years ago

@matt2000 We updated the azavea.java role to accommodate installing OpenJDK and Oracle Java (v0.2.1). Something like this should allow you to install Oracle Java 7:

roles:
  - { role: "azavea.java", java_version: "7u76*", java_flavor: "oracle", java_oracle_accept_license_agreement: True }

Please open an issue if it does not work out, and thanks again for contributing!