Skip to content

Commit 0968ca8

Browse files
committed
GI Patching: Better detection if GI is configured.
- By default, if apply_patches_gi: True -> patches will be applied before root.sh and other configuration is performed. If GI is already configured, patches will be applied accordingly (opatchauto/opatch auto ......), which means the GI stack will be stopped, patched and started (on all nodes at the same time)
1 parent df7d289 commit 0968ca8

File tree

5 files changed

+29
-10
lines changed

5 files changed

+29
-10
lines changed

roles/oraswgi-install/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
oracle_gi_cluster_type: STANDARD # STANDARD | FLEX | STANDALONE (12.2 specific)
8787
oracle_install_option_gi: "{% if configure_cluster %}CRS_CONFIG{% else %}HA_CONFIG{% endif %}"
8888
oracle_install_version_gi: 12.2.0.1
89-
patch_before_rootsh: False
89+
patch_before_rootsh: True
9090
apply_patches_gi: False
9191

9292
#oracle_asm_storage_option: LOCAL_ASM_STORAGE # LOCAL_ASM_STORAGE | FLEX_ASM_STORAGE

roles/oraswgi-install/tasks/12.2.0.1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
become_user: "{{ grid_install_user }}"
2121
tags:
2222
- oragridswunpack
23-
when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version
23+
when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and not oracle_sw_copy
2424

2525
# Check for an existing GRID_HOME before reinstallation of OPatch
2626
- name: install-home-gi | Check for file GridSetup.sh

roles/oraswgi-install/tasks/main.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
changed_when: False
99
register: checkgiinstall
1010

11+
- name: install-home-gi | check if GI has been configured
12+
stat: path=/etc/oracle/olr.loc
13+
register: olrloc
14+
1115
- name: install-home-gi | set fact for patch_before_rootsh
1216
set_fact:
1317
patch_before_rootsh: False
14-
when: oracle_home_gi in checkgiinstall.stdout and patch_before_rootsh
18+
when: olrloc.stat.exists and patch_before_rootsh
1519

1620
- name: install-home-gi | Mount nfs share with installation media
1721
mount: src="{{ nfs_server_sw }}:{{ nfs_server_sw_path }}" name={{ oracle_stage_remote }} fstype=nfs state=mounted
@@ -96,6 +100,10 @@
96100
- glogingi
97101
when: oracle_home_gi not in checkgiinstall.stdout
98102

103+
- include_role:
104+
name: oraswgi-manage-patches
105+
when: not patch_before_rootsh and apply_patches_gi
106+
99107
- name: install-home-gi | Check opatch lsinventory (GI)
100108
shell: "{{ oracle_home_gi }}/OPatch/opatch lspatches"
101109
become: yes

roles/oraswgi-manage-patches/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
ocm_response_file: "{{ oracle_patch_stage }}/{{ oracle_install_version_gi }}/ocm.rsp"
4040

4141
apply_patches_gi: False
42-
patch_before_rootsh: False
42+
patch_before_rootsh: True
4343

4444
gi_patches:
4545
12.2.0.1:

roles/oraswgi-manage-patches/tasks/main.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
---
2+
- name: gi-opatch | check if GI has been configured
3+
stat: path=/etc/oracle/olr.loc
4+
register: olrloc
5+
6+
- name: gi-opatch | set fact for patch_before_rootsh
7+
set_fact:
8+
patch_before_rootsh: False
9+
when: olrloc.stat.exists and patch_before_rootsh
210

311
- name: gi-opatch | Create patch-base directory (version specific)
412
file:
@@ -41,7 +49,7 @@
4149
tags:
4250
- ocmconfig
4351

44-
- name: gi-opatch | Apply opatchauto patches to GI (after sofware only install)
52+
- name: gi-opatch | Manage opatchauto patches for GI (after software only install)
4553
oracle_opatch:
4654
oracle_home={{ oracle_home_gi }}
4755
patch_base={{ oracle_patch_install }}/{{ oracle_install_version_gi}}/{{ item.0.path | default (item.0.patchid)}}/{{ item.1}}
@@ -50,6 +58,7 @@
5058
opatchauto=False
5159
conflict_check=True
5260
ocm_response_file={{ ocm_response_file | default(omit)}}
61+
output=verbose
5362
state=present
5463
with_subelements:
5564
- "{{gi_patches[oracle_install_version_gi]['opatchauto']}}"
@@ -59,10 +68,10 @@
5968
become_user: "{{ grid_install_user }}"
6069
tags:
6170
- apply_psu_grid
62-
when: apply_patches_gi and gi_patches is defined and gi_patches[oracle_install_version_gi] is defined and gi_patches[oracle_install_version_gi]['opatchauto'] is defined and item.0.apply and patch_before_rootsh
71+
when: apply_patches_gi and gi_patches is defined and gi_patches[oracle_install_version_gi] is defined and gi_patches[oracle_install_version_gi]['opatchauto'] is defined and item.0.apply and patch_before_rootsh and not olrloc.stat.exists
6372
register: psuapplym
6473

65-
- name: gi-opatch | Apply opatchauto patches to GI
74+
- name: gi-opatch | Manage opatchauto patches for GI
6675
oracle_opatch:
6776
oracle_home={{ oracle_home_gi }}
6877
patch_base={{ oracle_patch_install }}/{{ oracle_install_version_gi}}/{{ item.path | default (item.patchid)}}/
@@ -71,16 +80,17 @@
7180
opatchauto=True
7281
conflict_check=True
7382
ocm_response_file={{ ocm_response_file | default(omit)}}
83+
output=verbose
7484
state=present
7585
with_items:
7686
- "{{gi_patches[oracle_install_version_gi]['opatchauto']}}"
7787
#run_once: "{{ configure_cluster}}"
7888
tags:
7989
- apply_psu_grid
80-
when: apply_patches_gi and gi_patches is defined and gi_patches[oracle_install_version_gi] is defined and gi_patches[oracle_install_version_gi]['opatchauto'] is defined and item.apply and not patch_before_rootsh
90+
when: apply_patches_gi and gi_patches is defined and gi_patches[oracle_install_version_gi] is defined and gi_patches[oracle_install_version_gi]['opatchauto'] is defined and item.apply and not patch_before_rootsh and olrloc.stat.exists
8191
register: psuapplym
8292

83-
- name: gi-opatch | Apply non opatchauto patches to GI
93+
- name: gi-opatch | Manage non opatchauto patches for GI
8494
oracle_opatch:
8595
oracle_home={{ oracle_home_gi }}
8696
patch_base={{ oracle_patch_install }}/{{ oracle_install_version_gi}}/{{ item.path | default (item.patchid)}}/
@@ -89,6 +99,7 @@
8999
opatchauto=False
90100
conflict_check=True
91101
ocm_response_file={{ ocm_response_file | default(omit)}}
102+
output=verbose
92103
state=present
93104
with_items:
94105
- "{{gi_patches[oracle_install_version_gi]['opatch']}}"
@@ -97,7 +108,7 @@
97108
become_user: "{{ grid_install_user }}"
98109
tags:
99110
- apply_psu_grid
100-
when: apply_patches_gi and gi_patches is defined and gi_patches[oracle_install_version_gi] is defined and gi_patches[oracle_install_version_gi]['opatch'] is defined and item.apply #and not patch_before_rootsh
111+
when: apply_patches_gi and gi_patches is defined and gi_patches[oracle_install_version_gi] is defined and gi_patches[oracle_install_version_gi]['opatch'] is defined and item.apply and patch_before_rootsh and not olrloc.stat.exists
101112
register: psuapplym
102113
#
103114
#

0 commit comments

Comments
 (0)