Skip to content

Commit ddf0a0d

Browse files
committed
oraswgi_install: Next refactoring of role for RAC
1 parent 497d218 commit ddf0a0d

File tree

7 files changed

+171
-80
lines changed

7 files changed

+171
-80
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
minor_changes:
3+
- "oraswgi_install: Next refactoring of role for RAC ()"

roles/oraswgi_install/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,6 @@ run_configtoolallcommand: true
271271

272272
**_nfsumountdb_**
273273

274-
**_olsnodes_**
275-
276274
**_opatchls_**
277275

278276
**_oragridinstall_**
@@ -297,6 +295,12 @@ run_configtoolallcommand: true
297295

298296
- (bug): oracle_vip is not flexible enough.
299297
- (bug): oracle_ic_net will be removed in the future
298+
- (bug): ConfigTools should not depend on olr.loc...
299+
- (bug): ConfigTools should not depend on olr.loc...
300+
- (information): add selectattr to asm_diskgroups
301+
- (information): Check if path for patches is ok with patch_id/patch_id
302+
- (information): add selectattr to asm_diskgroups
303+
- (information): Check if path for patches is ok with patch_id/patch_id
300304

301305
## Dependencies
302306

roles/oraswgi_install/tasks/19.3.0.0.yml

Lines changed: 59 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
# IMPORTANT !!!
33
# This file is shared with 21.3.0.0.yml via symbolic link.
44
#
5-
- name: install_home_gi
5+
# execute when Home is not registered in oraInventory
6+
- name: include 19c/21c | install_home_gi
67
tags:
78
- oragridswunpack
89
when:
910
- oracle_home_gi not in checkgiinstall.stdout
1011
block:
11-
- name: Info
12+
- name: include 19c/21c | Info
1213
ansible.builtin.debug:
1314
msg:
14-
- "install_home_gi | Start Extract files to ORACLE_HOME (gi)"
15+
- "Start Extract files to ORACLE_HOME (gi)"
1516
- "oracle_home_gi: {{ oracle_home_gi }}"
1617
when:
1718
- _orasw_meta_primary_node | bool
1819

19-
- name: install_home_gi | Extract files to ORACLE_HOME (gi)
20+
- name: include 19c/21c | Extract files to ORACLE_HOME (gi)
2021
ansible.builtin.unarchive:
2122
src: "{{ _oraswgi_install_oracle_gi_image }}"
2223
dest: "{{ oracle_home_gi }}"
@@ -31,15 +32,16 @@
3132
when:
3233
- _orasw_meta_primary_node | bool
3334

34-
- name: install_home_gi | Copy Patches for -applyRU when version >=19c
35+
- name: include 19c/21c | Copy Patches for -applyRU when version >=19c
3536
ansible.builtin.import_role:
3637
name: oraswgi_manage_patches
3738
when:
3839
- patch_before_rootsh
3940
- oracle_home_gi not in checkgiinstall.stdout
4041
- oracle_install_version_gi is version(19, '>=')
42+
- apply_patches_gi
4143

42-
- name: install_home_gi | Check for file GridSetup.sh
44+
- name: include 19c/21c | Check for file GridSetup.sh
4345
ansible.builtin.stat:
4446
path: "{{ oracle_home_gi }}/gridSetup.sh"
4547
register: stat_gridsetup_result
@@ -48,27 +50,25 @@
4850
when:
4951
- _orasw_meta_primary_node | bool
5052

51-
- name: install_home_gi | State of GridSetup.sh
53+
- name: include 19c/21c | State of GridSetup.sh
5254
ansible.builtin.assert:
5355
quiet: true
54-
that: "stat_gridsetup_result.stat.exists == True"
56+
that: stat_gridsetup_result.stat.exists | bool
5557
msg: "Cannot find {{ oracle_home_gi }}/gridSetup.sh }}"
5658
when:
5759
- _orasw_meta_primary_node | bool
5860

59-
- name: check for existing cvuqdisk_rpm
61+
- name: include 19c/21c | check for existing cvuqdisk_rpm
6062
ansible.builtin.stat:
6163
path: "{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}"
6264
register: statcvuqdisk
63-
when:
64-
- _orasw_meta_primary_node | bool
6565
tags: cvuqdisk
6666

6767
# Oracle Restart + ASMFD
6868
# => cvuqdisk is mandatory
69-
- name: When _oraswgi_meta_configure_cluster
69+
- name: include 19c/21c | When _oraswgi_meta_configure_cluster
7070
when:
71-
- (_oraswgi_meta_configure_cluster and hostvars[cluster_master]['statcvuqdisk']['stat']['exists'])
71+
- (_oraswgi_meta_configure_cluster and hostvars[cluster_master]['statcvuqdisk']['stat']['exists'] | default(false))
7272
or
7373
(not _oraswgi_meta_configure_cluster and device_persistence == 'asmfd')
7474
tags: cvuqdisk
@@ -77,7 +77,7 @@
7777
# synchronize didn't work on all environments...
7878
# => fetch to ansible controller
7979
# => copy to nodes
80-
- name: install_home_gi | copy cvuqdisk to ansible controller
80+
- name: include 19c/21c | copy cvuqdisk to ansible controller
8181
ansible.builtin.fetch:
8282
src: "{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}"
8383
dest: /tmp
@@ -88,21 +88,22 @@
8888
- statcvuqdisk.stat.exists
8989
tags: cvuqdisk
9090

91-
- name: install_home_gi | copy cvuqdisk to cluster nodes
91+
- name: include 19c/21c | copy cvuqdisk to cluster nodes
9292
ansible.builtin.copy:
9393
src: "/tmp/{{ cluster_master }}/{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}"
9494
dest: "{{ oracle_rsp_stage }}/{{ cvuqdisk_rpm }}"
9595
mode: 0644
9696
tags: cvuqdisk
9797

98-
- name: install_home_gi | Install cvuqdisk rpm
98+
- name: include 19c/21c | Install cvuqdisk rpm
9999
ansible.builtin.yum:
100100
name: "{{ oracle_rsp_stage }}/{{ cvuqdisk_rpm }}"
101101
state: present
102102
disable_gpg_check: true
103103
tags: cvuqdisk
104104

105-
- name: install_home_gi | Setup response file for install (GI)
105+
# @todo information: add selectattr to asm_diskgroups
106+
- name: include 19c/21c | Setup response file for install (GI)
106107
ansible.builtin.template:
107108
src: "grid-install.rsp.{{ oracle_install_version_gi }}.j2"
108109
dest: "{{ oracle_rsp_stage }}/{{ _oraswgi_install_oracle_grid_responsefile }}"
@@ -119,64 +120,76 @@
119120
- item.diskgroup == oracle_asm_init_dg
120121
- _orasw_meta_primary_node | bool
121122

122-
- name: install_home_gi | Block for configure Grid Infrastructure
123-
when: oracle_home_gi not in checkgiinstall.stdout
123+
- name: include 19c/21c | Execute cluvfy
124+
ansible.builtin.include_tasks: runcluvfy.yml # noqa name[missing]
125+
when:
126+
- force_runcluvfy | default(false) or oracle_home_gi not in checkgiinstall.stdout
127+
tags: always
128+
129+
# The state for olr.loc is used to check if root.sh has been executed
130+
- name: Get current state of olr.loc
131+
ansible.builtin.stat:
132+
path: /etc/oracle/olr.loc
133+
register: olrloc
134+
135+
- name: include 19c/21c | Block for configure Grid Infrastructure
136+
when: not olrloc.stat.exists | bool
124137
vars:
125138
# get 1st opatchauto patch with state=present
139+
# @todo information: Check if path for patches is ok with patch_id/patch_id
126140
__applyruopatchauto: |-
127141
{{ gi_patches[oracle_install_version_gi]['opatchauto']
128142
| selectattr('state', 'equalto', 'present') | list | first }}
129143
__patchru_dir: |-
130144
{{ oracle_sw_copy | bool | ternary(oracle_stage, oracle_stage_remote) }}/patches/{{ oracle_install_version_gi }}/
131-
{{- __applyruopatchauto['path'] | default(__applyruopatchauto['patchid']) }}
145+
{{- __applyruopatchauto['path'] | default((__applyruopatchauto['patchid'] | string) + '/' + __applyruopatchauto['patchid'] | string) }}
132146
133147
block:
134-
- name: Execute cluvfy
135-
ansible.builtin.include_tasks: runcluvfy.yml # noqa name[missing]
136-
when:
137-
- force_runcluvfy | default(false) or oracle_home_gi not in checkgiinstall.stdout
138-
tags: always
139148

140-
- name: ASM Filter Driver
149+
- name: include 19c/21c | ASM Filter Driver
141150
ansible.builtin.include_tasks: asmfd.yml
142151
when:
143152
- device_persistence == 'asmfd'
144153
tags:
145154
- asmfd
146155

147-
- name: install_home_gi | Check for bundle.xml in patchru_dir
156+
- name: include 19c/21c | Check for bundle.xml in patchru_dir
148157
when:
158+
- apply_patches_gi | bool
149159
- patch_before_rootsh | bool
150160
- _orasw_meta_primary_node | bool
151161
block:
152162
# the ORACLE_HOME is damaged, when gridSetup.sh is started wiith wrong path!
153163
# => Check for existing file bundle.xml
154-
- name: install_home_gi | Check for bundle.xml in {{ __patchru_dir }}
164+
- name: include 19c/21c | Check for bundle.xml in {{ __patchru_dir }}
155165
ansible.builtin.stat:
156166
path: "{{ __patchru_dir }}/bundle.xml"
157167
register: __patchru_dir_stat
158168

159-
- name: install_home_gi | Assert for bundle.xml
169+
- name: include 19c/21c | Assert for bundle.xml
160170
ansible.builtin.assert:
161171
quiet: true
162172
that:
163173
- __patchru_dir_stat.stat.exists
164174
fail_msg: "bundle.xml not found in {{ __patchru_dir }}"
165175

166-
- name: install_home_gi | Start Install Grid Infrastructure"
176+
- name: include 19c/21c | Start Install Grid Infrastructure"
167177
ansible.builtin.debug:
168178
msg:
169179
- "oracle_home_gi: {{ oracle_home_gi }}"
180+
- "apply Patches to GI: {{ apply_patches_gi }}"
170181
- "apply RU before configuration: {{ patch_before_rootsh }}"
171182
- "{{ patch_before_rootsh | bool | ternary('patchru_dir: ' + __patchru_dir, '') }}"
172183
- "oracle_script_env: {{ oracle_script_env | default({}) }}"
173184
when:
174185
- _orasw_meta_primary_node | bool
175186

176-
- name: Detail inventory for Grid-Infrastructure
187+
- name: include 19c/21c | Detail inventory for Grid-Infrastructure
177188
ansible.builtin.debug:
178189
msg:
179190
- "oracle_cluster_name: {{ oracle_cluster_name }}"
191+
- "Nodes in cluster: {{ groups[orasw_meta_cluster_hostgroup] }}"
192+
- "primary_node: {{ _orasw_meta_primary_node }}"
180193
- "oracle_scan: {{ oracle_scan }}"
181194
- "oracle_scan_port: {{ oracle_scan_port }}"
182195
- "oracle_gi_nic_pub: {{ oracle_gi_nic_pub }}"
@@ -185,12 +198,15 @@
185198
when:
186199
- _oraswgi_meta_configure_cluster | bool
187200

188-
- name: install_home_gi | Install Grid Infrastructure
201+
- name: include 19c/21c | Install Grid Infrastructure
189202
ansible.builtin.command:
190203
# noqa no-changed-when
191204
argv: "{{ __argv }}"
192205
vars:
193-
__argv: "{{ __argv1 + (patch_before_rootsh | bool | ternary(__argvru, [])) }}"
206+
__argv: >-
207+
{{ __argv1
208+
+ ((patch_before_rootsh | bool and apply_patches_gi | bool)
209+
| ternary(__argvru, [])) }}
194210
__argv1:
195211
- "{{ oracle_home_gi }}/gridSetup.sh"
196212
- -responseFile
@@ -211,34 +227,33 @@
211227
register: giinstall
212228
failed_when: giinstall.rc not in [0, 6]
213229

214-
- name: Info
230+
- name: include 19c/21c | Info
215231
ansible.builtin.debug:
216232
var: giinstall.stdout_lines
217233
when:
218234
- giinstall.stdout_lines is defined
219235
- _orasw_meta_primary_node | bool
220236

221-
- name: install_home_gi | include role oraswgi_manage_patches
237+
- name: include 19c/21c | include role oraswgi_manage_patches
222238
ansible.builtin.include_role:
223239
name: oraswgi_manage_patches
224-
when: patch_before_rootsh and apply_patches_gi
225-
226-
- name: ""
227240
when:
228-
- oracle_home_gi not in checkgiinstall.stdout
241+
- patch_before_rootsh | bool
242+
- apply_patches_gi | bool
243+
244+
- name: include 19c/21c | not olrloc.stat.exists
245+
when: not olrloc.stat.exists | bool
229246
block: # when: oracle_home_gi not in checkgiinstall.stdout
230-
- name: install_home_gi | Run oraInstroot script after installation
247+
- name: include 19c/21c | Run oraInstroot script after installation
231248
ansible.builtin.command: "{{ oracle_inventory_loc }}/orainstRoot.sh"
232249
environment: "{{ oracle_script_env }}"
233250
# noqa no-changed-when
234251
become: true
235252
tags:
236253
- runroot
237254

238-
- ansible.builtin.debug: # noqa name[missing]
239-
msg: "install_home_gi | Start Run root script after installation (Master Node)"
240-
when:
241-
- _orasw_meta_primary_node | bool
255+
- name: include 19c/21c | include_tasks root.sh.yml
256+
ansible.builtin.include_tasks: root.sh.yml
242257

243258
- name: install_home_gi | Run root script after installation (Master Node)
244259
ansible.builtin.command: "{{ oracle_home_gi }}/root.sh"

0 commit comments

Comments
 (0)