Skip to content

Commit 7afec5e

Browse files
martinfanning1Martin Fanning
andauthored
Add in Patching of the Oracle Java JDK for Oracle Databse (#146)
* Add in Patching of the Oracle JDK Add in Patching of the Oracle JDK which looks to be now released as a seperate Patch to the Databae Patch This often causes compliancy issues in Qualys - so adding in this extra tasks - only ran if the specific var file has a jdk_patch_filename specified - to add this patch. Kept it seperate in case there is not JDK Patch. * Update Galaxy Update Galaxy * Update Java version of latest OHS 12.2.1.4 Update Java version of latest OHS 12.2.1.4 to ensure compiance in Qualys... This is likely the last OHS fixpack for 12.2.1.4.. So Java version should be updated each quarter.. --------- Co-authored-by: Martin Fanning <mfanning@merative.com>
1 parent 1145992 commit 7afec5e

File tree

5 files changed

+93
-3
lines changed

5 files changed

+93
-3
lines changed

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ name: spm_middleware
1111

1212
# The version of the collection. Must be compatible with semantic versioning
1313
# Please note. version also exists in /github/workflows/release.yml and will need to be update also
14-
version: 1.10.1
14+
version: 1.10.2
1515

1616
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
1717
readme: README.md

roles/ohs/vars/v12.2.1.4.250609.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ opatch_version: 13.9.4.2.20
2626
opatch_folder: 6880880
2727

2828
# JDK Information
29-
java_zip_path: 'WLS/jdk-8u461-linux-x64.tar.gz'
30-
java_version_path: 'jdk1.8.0_461'
29+
java_zip_path: 'WLS/jdk-8u471-linux-x64.tar.gz'
30+
java_version_path: 'jdk1.8.0_471'
3131
jdk_folder: "{{ ohs_home }}/oracle_common/jdk"
3232

3333
template_jar: "ohs_standalone_template.jar"

roles/oracle/tasks/jdkpatch.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
- name: Check if JDK patch already applied
3+
become: yes
4+
become_user: oracle
5+
shell: "{{ oracle_home }}/OPatch/opatch lsinventory | grep -q {{ jdk_patch_number }}"
6+
ignore_errors: true
7+
register: jdk_patch_applied
8+
changed_when: false
9+
environment:
10+
ORACLE_HOME: "{{ oracle_home }}"
11+
12+
- name: "Copy JDK Patch {{ jdk_patch_filename }}"
13+
copy:
14+
src: "{{ oracle_installer_path }}/{{ jdk_patch_filename }}"
15+
dest: "/tmp//{{ jdk_patch_filename }}"
16+
owner: oracle
17+
group: oinstall
18+
when: download_url is not defined and jdk_patch_applied.rc != 0
19+
20+
- name: "Download JDK Patch {{ jdk_patch_filename }}"
21+
get_url:
22+
url: "{{ download_url }}/{{ oracle_installer_path }}/JDKPatch/{{ jdk_patch_filename }}"
23+
dest: "/tmp/{{ jdk_patch_filename }}"
24+
owner: oracle
25+
group: oinstall
26+
headers: "{{ download_header }}"
27+
when: download_url is defined and jdk_patch_applied.rc != 0
28+
29+
- name: "Extract JDK Patch {{ jdk_patch_filename }}"
30+
unarchive:
31+
remote_src: yes
32+
src: "/tmp/{{ jdk_patch_filename }}"
33+
dest: /tmp/
34+
owner: oracle
35+
group: oinstall
36+
when: jdk_patch_applied.rc != 0
37+
38+
- name: "Apply JDK Patch {{ jdk_patch_number }}"
39+
become: yes
40+
become_user: oracle
41+
command: $ORACLE_HOME/OPatch/opatch apply -silent
42+
args:
43+
chdir: "/tmp/{{ jdk_patch_number }}"
44+
environment:
45+
ORACLE_HOME: "{{ oracle_home }}"
46+
ORACLE_SID: "{{ oracle_sid }}"
47+
async: 900
48+
poll: 0
49+
register: patch_checker
50+
when: jdk_patch_applied.rc != 0
51+
52+
# Avoid travis timeout
53+
- name: 'JDK Patch - check status'
54+
become: yes
55+
become_user: oracle
56+
async_status:
57+
jid: "{{ patch_checker.ansible_job_id }}"
58+
register: job_result
59+
until: job_result.finished
60+
retries: 30
61+
delay: 30
62+
when: jdk_patch_applied.rc != 0
63+
64+
- name: Cleanup
65+
file:
66+
path: "{{ item }}"
67+
state: absent
68+
loop:
69+
- /tmp/{{ jdk_patch_filename }}
70+
- /tmp/{{ jdk_patch_number }}

roles/oracle/tasks/main.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,22 @@
2828
include_tasks: "patch.yml"
2929
when: patch_filename is defined and oracle_version_status.rc != 0
3030

31+
- name: Check if JDK Patch already applied
32+
become: yes
33+
become_user: oracle
34+
# shell: "echo 'SELECT * FROM v$version;' | $ORACLE_HOME/bin/sqlplus / as sysdba | grep -i {{ oracle_version }}"
35+
shell: "$ORACLE_HOME/OPatch/opatch lspatches | grep -i {{ jdk_patch_number }}"
36+
register: jdk_version_status
37+
changed_when: False
38+
ignore_errors: True
39+
environment:
40+
ORACLE_HOME: "{{ oracle_home }}"
41+
ORACLE_SID: "{{ oracle_sid }}"
42+
43+
- name: Install JDK Patch
44+
include_tasks: "jdkpatch.yml"
45+
when: jdk_patch_filename is defined and jdk_version_status.rc != 0
46+
3147
- name: Props and Profile
3248
include_tasks: "dot_profile.yml"
3349

roles/oracle/vars/v19.29.0.0.0.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ patch_number: 38291812 # used for directory
1212
# Add OPatch values when bundled OPatch needs to be upgraded
1313
opatch_filename: p6880880_190000_Linux-x86-64.zip
1414
opatch_version: 12.2.0.1.48
15+
16+
# jdk patch values
17+
jdk_patch_filename: p38245243_190000_Linux-x86-64.zip
18+
jdk_patch_number: 38245243 # used for directory

0 commit comments

Comments
 (0)