2020-07-10 00:58:55 +02:00
|
|
|
---
|
|
|
|
{%- 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
|
2020-09-12 17:41:35 +02:00
|
|
|
- skip_verify: true
|
2020-07-10 00:58:55 +02:00
|
|
|
- if_missing: {{ java.install_dir }}/jdk-{{ java.version }}
|
|
|
|
|
|
|
|
java_link:
|
|
|
|
file.symlink:
|
|
|
|
- name: {{ java.install_dir }}/default
|
|
|
|
- target: {{ java.install_dir }}/jdk-{{ java.version }}
|
2020-09-12 17:41:35 +02:00
|
|
|
- force: true
|
2020-07-10 00:58:55 +02:00
|
|
|
- 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:
|
2021-08-19 21:15:24 +02:00
|
|
|
- name: {{ java.install_dir }}/default/update-alternatives-java.sh
|