updated java state
This commit is contained in:
parent
6e011a0658
commit
3643ea114e
@ -1,6 +1,6 @@
|
||||
---
|
||||
{%- from "java/map.jinja" import java with context %}
|
||||
java_directory:
|
||||
java-directory:
|
||||
file.directory:
|
||||
- name: {{ java.install_dir }}
|
||||
- user: root
|
||||
@ -8,7 +8,7 @@ java_directory:
|
||||
- dir_mode: 755
|
||||
- file_mode: 644
|
||||
|
||||
java_extract:
|
||||
java-extract:
|
||||
archive.extracted:
|
||||
- name: {{ java.install_dir }}
|
||||
- source: {{ java.fetch_url }}/jdk-{{ java.version }}_{{ java.os }}-{{ java.arch }}_bin.tar.gz
|
||||
@ -17,23 +17,29 @@ java_extract:
|
||||
- skip_verify: true
|
||||
- if_missing: {{ java.install_dir }}/jdk-{{ java.version }}
|
||||
|
||||
java_link:
|
||||
java-link:
|
||||
file.symlink:
|
||||
- name: {{ java.install_dir }}/default
|
||||
- target: {{ java.install_dir }}/jdk-{{ java.version }}
|
||||
- force: true
|
||||
- user: root
|
||||
- group: root
|
||||
- require:
|
||||
- archive: java-extract
|
||||
|
||||
java_updatealternatives_script:
|
||||
java-update-alternatives-script:
|
||||
file.managed:
|
||||
- name: {{ java.install_dir }}/default/update-alternatives-java.sh
|
||||
- source: salt://java/update-alternatives-java.sh.j2
|
||||
- source: salt://java/templates/update-alternatives-java.sh.j2
|
||||
- template: jinja
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 755
|
||||
- require:
|
||||
- archive: java-extract
|
||||
|
||||
java_default:
|
||||
java-default:
|
||||
cmd.run:
|
||||
- name: {{ java.install_dir }}/default/update-alternatives-java.sh
|
||||
- require:
|
||||
- archive: java-extract
|
||||
|
@ -8,6 +8,9 @@ x86_64:
|
||||
arm64:
|
||||
arch: aarch64
|
||||
|
||||
armhf:
|
||||
arch: armhf
|
||||
|
||||
# 386:
|
||||
# arch: 386
|
||||
|
||||
@ -16,6 +19,3 @@ arm64:
|
||||
|
||||
# armv7l:
|
||||
# arch: arm
|
||||
|
||||
# armhf:
|
||||
# arch: arm
|
||||
|
7
states/java/templates/update-alternatives-java.sh.j2
Normal file
7
states/java/templates/update-alternatives-java.sh.j2
Normal file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
{%- from "java/map.jinja" import java with context %}
|
||||
for item in $(ls {{ java.install_dir }}/default/bin)
|
||||
do
|
||||
update-alternatives --install /usr/bin/${item} ${item} {{ java.install_dir }}/default/bin/${item} 1
|
||||
update-alternatives --set ${item} {{ java.install_dir }}/default/bin/${item}
|
||||
done
|
Loading…
Reference in New Issue
Block a user