--- {%- from "java/map.jinja" import java with context %} java_directory: file.directory: - name: {{ java.install_dir }} - user: root - group: root - dir_mode: 755 - file_mode: 644 java_extract: archive.extracted: - name: {{ java.install_dir }} - source: {{ java.fetch_url }}/jdk-{{ java.version }}_{{ java.os }}-{{ java.arch }}_bin.tar.gz - user: root - group: root - skip_verify: True - if_missing: {{ java.install_dir }}/jdk-{{ java.version }} java_link: file.symlink: - name: {{ java.install_dir }}/default - target: {{ java.install_dir }}/jdk-{{ java.version }} - force: True - user: root - group: root java_updatealternatives_script: file.managed: - name: {{ java.install_dir }}/default/update-alternatives-java.sh - source: salt://java/update-alternatives-java.sh.j2 - template: jinja - user: root - group: root - mode: 755 java_default: cmd.run: - name: {{ java.install_dir }}/default/update-alternatives-java.sh