40 lines
1.0 KiB
Plaintext
40 lines
1.0 KiB
Plaintext
---
|
|
{%- 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
|