classroom/roles/winroom/tasks/jdk.yml

30 lines
694 B
YAML
Raw Permalink Normal View History

2022-10-04 09:02:57 +00:00
- name: Install Oracle JDK
win_package:
2023-09-08 21:29:14 +00:00
path: https://download.oracle.com/java/20/latest/jdk-20_windows-x64_bin.msi
arguments: INSTALLLEVEL=3
2022-10-04 09:02:57 +00:00
- name: Find Java version
win_reg_stat:
path: HKLM:\SOFTWARE\JavaSoft\JDK
name: CurrentVersion
register: reg
- name: Find Java home
win_reg_stat:
path: "HKLM:\\SOFTWARE\\JavaSoft\\JDK\\{{ reg['value'] }}"
name: JavaHome
register: reg
2022-09-25 10:35:45 +00:00
- name: Set JAVA_HOME
win_environment:
name: JAVA_HOME
2022-10-04 09:02:57 +00:00
value: "{{ reg['raw_value'] }}"
2022-09-25 10:35:45 +00:00
level: machine
2022-10-04 09:02:57 +00:00
- name: Disable Java updates
2022-09-25 10:35:45 +00:00
win_regedit:
2022-10-04 09:02:57 +00:00
path: HKLM:\SOFTWARE\WOW6432Node\JavaSoft\Java Update\Policy
name: EnableJavaUpdate
type: dword
data: 0