paulbsd-salt/states/java/install.sls

46 lines
1.1 KiB
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "java/map.jinja" import java with context %}
2023-01-04 23:33:41 +01:00
java-directory:
2020-07-10 00:58:55 +02:00
file.directory:
- name: {{ java.install_dir }}
- user: root
- group: root
- dir_mode: 755
- file_mode: 644
2023-01-04 23:33:41 +01:00
java-extract:
2020-07-10 00:58:55 +02:00
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 }}
2023-01-04 23:33:41 +01:00
java-link:
2020-07-10 00:58:55 +02:00
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
2023-01-04 23:33:41 +01:00
- require:
- archive: java-extract
2020-07-10 00:58:55 +02:00
2023-01-04 23:33:41 +01:00
java-update-alternatives-script:
2020-07-10 00:58:55 +02:00
file.managed:
- name: {{ java.install_dir }}/default/update-alternatives-java.sh
2023-01-04 23:33:41 +01:00
- source: salt://java/templates/update-alternatives-java.sh.j2
2020-07-10 00:58:55 +02:00
- template: jinja
- user: root
- group: root
- mode: 755
2023-01-04 23:33:41 +01:00
- require:
- archive: java-extract
2020-07-10 00:58:55 +02:00
2023-01-04 23:33:41 +01:00
java-default:
2020-07-10 00:58:55 +02:00
cmd.run:
2021-08-19 21:15:24 +02:00
- name: {{ java.install_dir }}/default/update-alternatives-java.sh
2023-01-04 23:33:41 +01:00
- require:
- archive: java-extract