Created
January 9, 2018 16:59
-
-
Save anonymous/5ee1534f1aad3a2c9feb946251817440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set up alternatives to properly use openjdk | |
{% set openjdk_executable = "/usr/lib/jvm/jre-1." + environment.version + ".0-openjdk/bin/java" %} | |
java_executable_exists: | |
file.exists: | |
- name: {{ openjdk_executable}} | |
# old | |
java_alternatives_installed: # This reports as a state failure but actually succeeds per https://github.com/saltstack/salt/issues/38802 | |
alternatives.install: | |
- name: java | |
- link: /usr/bin/java | |
- path: {{ openjdk_executable}} | |
- priority: 9000 | |
- require: | |
- file: java_executable_exists | |
# new | |
java_alternatives_installed: | |
cmd.run: | |
- name: alternatives --install /usr/bin/java java {{ openjdk_executable }} 9000 # does this work? | |
- require: | |
- file: java_executable_exists |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment