Skip to content

Commit 8b0d4ea

Browse files
pavelpiktatgadiev
authored andcommitted
fix security policy installation for oracle jre (#106)
1 parent fbecfb0 commit 8b0d4ea

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

tasks/Linux/security_policy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
- name: Unzip patch file
1717
unarchive:
1818
src: '{{ security_policy_java_artifact }}'
19-
dest: '{{ java_path }}/{{ java_folder }}/jre/lib/security'
19+
dest: '{{ security_patch_path }}'
2020
remote_src: true
2121
owner: root
2222
group: root
@@ -26,7 +26,7 @@
2626
copy:
2727
src: "{{ java_path }}/{{ java_folder }}/jre/lib/security/\
2828
{{ security_patch_folders[java_major_version|int] }}/{{ policy_item }}"
29-
dest: '{{ java_path }}/{{ java_folder }}/jre/lib/security/'
29+
dest: '{{ security_patch_path }}/'
3030
remote_src: true
3131
directory_mode: true
3232
owner: root
@@ -43,7 +43,7 @@
4343

4444
- name: Apply setting
4545
replace:
46-
path: '{{ java_path }}/{{ java_folder }}/jre/lib/security/java.security'
46+
path: '{{ security_patch_path }}/java.security'
4747
regexp: '#crypto.policy=unlimited'
4848
replace: 'crypto.policy=unlimited'
4949
when: java_major_version | int < 9

vars/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ security_patch_folders:
3030
7: UnlimitedJCEPolicy
3131
8: UnlimitedJCEPolicyJDK8
3232

33+
# security policy path
34+
security_patch_path: >-
35+
{{ (java_package|string == 'jdk')
36+
| ternary(java_path + '/' + java_folder + '/jre/lib/security',
37+
java_path + '/' + java_folder + '/lib/security')
38+
}}
39+
3340
java_folder_ext_transport: '{{ java_def_folder_ext_transport }}'
3441

3542
java_def_folder_ext_transport: >-

0 commit comments

Comments
 (0)