Skip to content

Commit d02ce77

Browse files
committed
oraswgi: Added Support for gridSetup.sh -applyRU for 19c and 21c
The option to preinstall patches during gridSetup has been improved. This change add the option '-applyRU' to the execution of gridSetup.sh for 19c and 21c instead of the installation of patches with opatch after the unarchive. The installation of OneOff patches with `opatch apply` has been added for 19c+, too. The installation of patches with copy of patches from ansible controller or download via http has been added, too.
1 parent fa681df commit d02ce77

22 files changed

+681
-537
lines changed

changelogs/fragments/oraswgi.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
minor_changes:
3+
- "oiraswgi: Added Support for gridSetup.sh -applyRU for 19c and 21c ()"

roles/oraswgi_install/tasks/19.3.0.0.yml

Lines changed: 72 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,56 @@
11
---
2+
# IMPORTANT !!!
3+
# This file is shared with 21.3.0.0.yml via symbolic link.
4+
#
25
- name: install_home_gi
36
tags:
47
- oragridswunpack
58
when:
69
- oracle_home_gi not in checkgiinstall.stdout
710
block:
8-
- ansible.builtin.debug: # noqa name[missing]
9-
msg: "install_home_gi | Start Extract files to ORACLE_HOME (gi)"
11+
- name: Info
12+
ansible.builtin.debug:
13+
msg:
14+
- "install_home_gi | Start Extract files to ORACLE_HOME (gi)"
15+
- "oracle_home_gi: {{ oracle_home_gi }}"
1016
run_once: "{{ _oraswgi_meta_configure_cluster }}"
1117

1218
- name: install_home_gi | Extract files to ORACLE_HOME (gi)
1319
ansible.builtin.unarchive:
1420
src: "{{ _oraswgi_install_oracle_gi_image }}"
1521
dest: "{{ oracle_home_gi }}"
1622
copy: false
17-
with_items: "{{ oracle_sw_image_gi }}"
23+
with_items: "{{ oracle_sw_image_gi | selectattr('version', 'match', oracle_install_version_gi) }}"
1824
loop_control:
1925
label: "{{ _oraswgi_install_oracle_gi_image | default('') }}"
2026
args:
2127
creates: "{{ oracle_home_gi }}/root.sh"
2228
become: true
2329
become_user: "{{ _grid_install_user }}"
2430
run_once: "{{ _oraswgi_meta_configure_cluster }}"
31+
32+
- name: install_home_gi | Copy Patches for -applyRU when version >=19c
33+
ansible.builtin.import_role:
34+
name: oraswgi_manage_patches
2535
when:
26-
- oracle_install_version_gi == item.version
36+
- patch_before_rootsh
37+
- oracle_home_gi not in checkgiinstall.stdout
38+
- oracle_install_version_gi is version(19, '>=')
39+
vars:
40+
oracle_user: "{{ grid_user }}"
2741

28-
# Check for an existing GRID_HOME before reinstallation of OPatch
2942
- name: install_home_gi | Check for file GridSetup.sh
3043
no_log: true
3144
ansible.builtin.stat:
3245
path: "{{ oracle_home_gi }}/gridSetup.sh"
3346
register: stat_gridsetup_result
3447
run_once: "{{ _oraswgi_meta_configure_cluster }}"
48+
become: true
49+
become_user: "{{ _grid_install_user }}"
3550

3651
- name: install_home_gi | State of GridSetup.sh
3752
ansible.builtin.assert:
53+
quiet: true
3854
that: "stat_gridsetup_result.stat.exists == True"
3955
msg: "Cannot find {{ oracle_home_gi }}/gridSetup.sh }}"
4056
run_once: "{{ _oraswgi_meta_configure_cluster }}"
@@ -100,11 +116,20 @@
100116
when:
101117
- item.diskgroup == oracle_asm_init_dg
102118

103-
- name: ""
119+
- name: install_home_gi | Block for configure Grid Infrastructure
104120
when: oracle_home_gi not in checkgiinstall.stdout
105-
block: # when: oracle_home_gi not in checkgiinstall.stdout
121+
vars:
122+
# get 1st opatchauto patch with state=present
123+
__applyruopatchauto: |-
124+
{{ gi_patches[oracle_install_version_gi]['opatchauto']
125+
| selectattr('state', 'match', 'present') | list | first }}
126+
__patchru_dir: |-
127+
{{ oracle_sw_copy | bool | ternary(oracle_stage, oracle_stage_remote) }}/patches/{{ oracle_install_version_gi }}/
128+
{{- __applyruopatchauto['path'] | default(__applyruopatchauto['patchid']) }}
106129
107-
- ansible.builtin.include_tasks: runcluvfy.yml # noqa name[missing]
130+
block:
131+
- name: Execute cluvfy
132+
ansible.builtin.include_tasks: runcluvfy.yml # noqa name[missing]
108133
when:
109134
- force_runcluvfy | default(false) or oracle_home_gi not in checkgiinstall.stdout
110135
tags: always
@@ -116,20 +141,48 @@
116141
tags:
117142
- asmfd
118143

119-
- ansible.builtin.debug:
120-
msg: "install_home_gi | Start Install Grid Infrastructure" # noqa name[missing]
144+
- name: install_home_gi | Check for bundle.xml in patchru_dir
145+
when:
146+
- patch_before_rootsh | bool
147+
block:
148+
# the ORACLE_HOME is damaged, when gridSetup.sh is started wiith wrong path!
149+
# => Check for existing file bundle.xml
150+
- name: install_home_gi | Check for bundle.xml in {{ __patchru_dir }}
151+
ansible.builtin.stat:
152+
path: "{{ __patchru_dir }}/bundle.xml"
153+
register: __patchru_dir_stat
154+
155+
- name: install_home_gi | Assert for bundle.xml
156+
ansible.builtin.assert:
157+
quiet: true
158+
that:
159+
- __patchru_dir_stat.stat.exists
160+
fail_msg: "bundle.xml not found in {{ __patchru_dir }}"
161+
162+
- name: install_home_gi | Start Install Grid Infrastructure"
163+
ansible.builtin.debug:
164+
msg:
165+
- "oracle_home_gi: {{ oracle_home_gi }}"
166+
- "apply RU before configuration: {{ patch_before_rootsh }}"
167+
- "{{ patch_before_rootsh | bool | ternary('patchru_dir: ' + __patchru_dir, '') }}"
121168
run_once: true
122169

123170
- name: install_home_gi | Install Grid Infrastructure
124171
ansible.builtin.command:
125172
# noqa no-changed-when
126-
argv:
173+
argv: "{{ __argv }}"
174+
vars:
175+
__argv: "{{ __argv1 + (patch_before_rootsh | bool | ternary(__argvru, [])) }}"
176+
__argv1:
127177
- "{{ oracle_home_gi }}/gridSetup.sh"
128178
- -responseFile
129179
- "{{ oracle_rsp_stage }}/{{ _oraswgi_install_oracle_grid_responsefile }}"
130180
- -waitforcompletion
131181
- -silent
132182
- "{{ _oraswgi_install_giignoreprereqparam | default(omit) }}"
183+
__argvru:
184+
- -applyRU
185+
- "{{ __patchru_dir }}"
133186
become: true
134187
become_user: "{{ _grid_install_user }}"
135188
run_once: "{{ _oraswgi_meta_configure_cluster }}"
@@ -138,7 +191,8 @@
138191
register: giinstall
139192
failed_when: giinstall.rc not in [0, 6]
140193

141-
- ansible.builtin.debug: # noqa name[missing]
194+
- name: Info
195+
ansible.builtin.debug:
142196
var: giinstall.stdout_lines
143197
run_once: "{{ _oraswgi_meta_configure_cluster }}"
144198
when: giinstall.stdout_lines is defined
@@ -172,12 +226,14 @@
172226
tags:
173227
- runroot
174228

175-
- ansible.builtin.debug: # noqa name[missing]
229+
- name: Info
230+
ansible.builtin.debug:
176231
var: rootmaster.stdout_lines
177232
run_once: "{{ _oraswgi_meta_configure_cluster }}"
178233
when: rootmaster.stdout_lines is defined
179234

180-
- ansible.builtin.debug: # noqa name[missing]
235+
- name: Info
236+
ansible.builtin.debug:
181237
msg: "install_home_gi | Start Run root script after installation (Other Nodes)"
182238
run_once: true
183239

@@ -200,7 +256,8 @@
200256
- inventory_hostname == item.1
201257
register: rootother
202258

203-
- ansible.builtin.debug: # noqa name[missing]
259+
- name: Info
260+
ansible.builtin.debug:
204261
var: rootother.stdout_lines
205262
when: rootother.stdout_lines is defined
206263

roles/oraswgi_install/tasks/21.3.0.0.yml

Lines changed: 0 additions & 218 deletions
This file was deleted.

0 commit comments

Comments
 (0)