|
2 | 2 | # IMPORTANT !!! |
3 | 3 | # This file is shared with 21.3.0.0.yml via symbolic link. |
4 | 4 | # |
5 | | -- name: install_home_gi |
| 5 | +# execute when Home is not registered in oraInventory |
| 6 | +- name: include 19c/21c | install_home_gi |
6 | 7 | tags: |
7 | 8 | - oragridswunpack |
8 | 9 | when: |
9 | 10 | - oracle_home_gi not in checkgiinstall.stdout |
10 | 11 | block: |
11 | | - - name: Info |
| 12 | + - name: include 19c/21c | Info |
12 | 13 | ansible.builtin.debug: |
13 | 14 | msg: |
14 | | - - "install_home_gi | Start Extract files to ORACLE_HOME (gi)" |
| 15 | + - "Start Extract files to ORACLE_HOME (gi)" |
15 | 16 | - "oracle_home_gi: {{ oracle_home_gi }}" |
16 | 17 | when: |
17 | 18 | - _orasw_meta_primary_node | bool |
18 | 19 |
|
19 | | - - name: install_home_gi | Extract files to ORACLE_HOME (gi) |
| 20 | + - name: include 19c/21c | Extract files to ORACLE_HOME (gi) |
20 | 21 | ansible.builtin.unarchive: |
21 | 22 | src: "{{ _oraswgi_install_oracle_gi_image }}" |
22 | 23 | dest: "{{ oracle_home_gi }}" |
|
31 | 32 | when: |
32 | 33 | - _orasw_meta_primary_node | bool |
33 | 34 |
|
34 | | - - name: install_home_gi | Copy Patches for -applyRU when version >=19c |
| 35 | + - name: include 19c/21c | Copy Patches for -applyRU when version >=19c |
35 | 36 | ansible.builtin.import_role: |
36 | 37 | name: oraswgi_manage_patches |
37 | 38 | when: |
38 | 39 | - patch_before_rootsh |
39 | 40 | - oracle_home_gi not in checkgiinstall.stdout |
40 | 41 | - oracle_install_version_gi is version(19, '>=') |
| 42 | + - apply_patches_gi |
41 | 43 |
|
42 | | -- name: install_home_gi | Check for file GridSetup.sh |
| 44 | +- name: include 19c/21c | Check for file GridSetup.sh |
43 | 45 | ansible.builtin.stat: |
44 | 46 | path: "{{ oracle_home_gi }}/gridSetup.sh" |
45 | 47 | register: stat_gridsetup_result |
|
48 | 50 | when: |
49 | 51 | - _orasw_meta_primary_node | bool |
50 | 52 |
|
51 | | -- name: install_home_gi | State of GridSetup.sh |
| 53 | +- name: include 19c/21c | State of GridSetup.sh |
52 | 54 | ansible.builtin.assert: |
53 | 55 | quiet: true |
54 | | - that: "stat_gridsetup_result.stat.exists == True" |
| 56 | + that: stat_gridsetup_result.stat.exists | bool |
55 | 57 | msg: "Cannot find {{ oracle_home_gi }}/gridSetup.sh }}" |
56 | 58 | when: |
57 | 59 | - _orasw_meta_primary_node | bool |
58 | 60 |
|
59 | | -- name: check for existing cvuqdisk_rpm |
| 61 | +- name: include 19c/21c | check for existing cvuqdisk_rpm |
60 | 62 | ansible.builtin.stat: |
61 | 63 | path: "{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}" |
62 | 64 | register: statcvuqdisk |
63 | | - when: |
64 | | - - _orasw_meta_primary_node | bool |
65 | 65 | tags: cvuqdisk |
66 | 66 |
|
67 | 67 | # Oracle Restart + ASMFD |
68 | 68 | # => cvuqdisk is mandatory |
69 | | -- name: When _oraswgi_meta_configure_cluster |
| 69 | +- name: include 19c/21c | When _oraswgi_meta_configure_cluster |
70 | 70 | 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)) |
72 | 72 | or |
73 | 73 | (not _oraswgi_meta_configure_cluster and device_persistence == 'asmfd') |
74 | 74 | tags: cvuqdisk |
|
77 | 77 | # synchronize didn't work on all environments... |
78 | 78 | # => fetch to ansible controller |
79 | 79 | # => copy to nodes |
80 | | - - name: install_home_gi | copy cvuqdisk to ansible controller |
| 80 | + - name: include 19c/21c | copy cvuqdisk to ansible controller |
81 | 81 | ansible.builtin.fetch: |
82 | 82 | src: "{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}" |
83 | 83 | dest: /tmp |
|
88 | 88 | - statcvuqdisk.stat.exists |
89 | 89 | tags: cvuqdisk |
90 | 90 |
|
91 | | - - name: install_home_gi | copy cvuqdisk to cluster nodes |
| 91 | + - name: include 19c/21c | copy cvuqdisk to cluster nodes |
92 | 92 | ansible.builtin.copy: |
93 | 93 | src: "/tmp/{{ cluster_master }}/{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}" |
94 | 94 | dest: "{{ oracle_rsp_stage }}/{{ cvuqdisk_rpm }}" |
95 | 95 | mode: 0644 |
96 | 96 | tags: cvuqdisk |
97 | 97 |
|
98 | | - - name: install_home_gi | Install cvuqdisk rpm |
| 98 | + - name: include 19c/21c | Install cvuqdisk rpm |
99 | 99 | ansible.builtin.yum: |
100 | 100 | name: "{{ oracle_rsp_stage }}/{{ cvuqdisk_rpm }}" |
101 | 101 | state: present |
102 | 102 | disable_gpg_check: true |
103 | 103 | tags: cvuqdisk |
104 | 104 |
|
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) |
106 | 107 | ansible.builtin.template: |
107 | 108 | src: "grid-install.rsp.{{ oracle_install_version_gi }}.j2" |
108 | 109 | dest: "{{ oracle_rsp_stage }}/{{ _oraswgi_install_oracle_grid_responsefile }}" |
|
119 | 120 | - item.diskgroup == oracle_asm_init_dg |
120 | 121 | - _orasw_meta_primary_node | bool |
121 | 122 |
|
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 |
124 | 137 | vars: |
125 | 138 | # get 1st opatchauto patch with state=present |
| 139 | + # @todo information: Check if path for patches is ok with patch_id/patch_id |
126 | 140 | __applyruopatchauto: |- |
127 | 141 | {{ gi_patches[oracle_install_version_gi]['opatchauto'] |
128 | 142 | | selectattr('state', 'equalto', 'present') | list | first }} |
129 | 143 | __patchru_dir: |- |
130 | 144 | {{ 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) }} |
132 | 146 |
|
133 | 147 | 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 |
139 | 148 |
|
140 | | - - name: ASM Filter Driver |
| 149 | + - name: include 19c/21c | ASM Filter Driver |
141 | 150 | ansible.builtin.include_tasks: asmfd.yml |
142 | 151 | when: |
143 | 152 | - device_persistence == 'asmfd' |
144 | 153 | tags: |
145 | 154 | - asmfd |
146 | 155 |
|
147 | | - - name: install_home_gi | Check for bundle.xml in patchru_dir |
| 156 | + - name: include 19c/21c | Check for bundle.xml in patchru_dir |
148 | 157 | when: |
| 158 | + - apply_patches_gi | bool |
149 | 159 | - patch_before_rootsh | bool |
150 | 160 | - _orasw_meta_primary_node | bool |
151 | 161 | block: |
152 | 162 | # the ORACLE_HOME is damaged, when gridSetup.sh is started wiith wrong path! |
153 | 163 | # => 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 }} |
155 | 165 | ansible.builtin.stat: |
156 | 166 | path: "{{ __patchru_dir }}/bundle.xml" |
157 | 167 | register: __patchru_dir_stat |
158 | 168 |
|
159 | | - - name: install_home_gi | Assert for bundle.xml |
| 169 | + - name: include 19c/21c | Assert for bundle.xml |
160 | 170 | ansible.builtin.assert: |
161 | 171 | quiet: true |
162 | 172 | that: |
163 | 173 | - __patchru_dir_stat.stat.exists |
164 | 174 | fail_msg: "bundle.xml not found in {{ __patchru_dir }}" |
165 | 175 |
|
166 | | - - name: install_home_gi | Start Install Grid Infrastructure" |
| 176 | + - name: include 19c/21c | Start Install Grid Infrastructure" |
167 | 177 | ansible.builtin.debug: |
168 | 178 | msg: |
169 | 179 | - "oracle_home_gi: {{ oracle_home_gi }}" |
| 180 | + - "apply Patches to GI: {{ apply_patches_gi }}" |
170 | 181 | - "apply RU before configuration: {{ patch_before_rootsh }}" |
171 | 182 | - "{{ patch_before_rootsh | bool | ternary('patchru_dir: ' + __patchru_dir, '') }}" |
172 | 183 | - "oracle_script_env: {{ oracle_script_env | default({}) }}" |
173 | 184 | when: |
174 | 185 | - _orasw_meta_primary_node | bool |
175 | 186 |
|
176 | | - - name: Detail inventory for Grid-Infrastructure |
| 187 | + - name: include 19c/21c | Detail inventory for Grid-Infrastructure |
177 | 188 | ansible.builtin.debug: |
178 | 189 | msg: |
179 | 190 | - "oracle_cluster_name: {{ oracle_cluster_name }}" |
| 191 | + - "Nodes in cluster: {{ groups[orasw_meta_cluster_hostgroup] }}" |
| 192 | + - "primary_node: {{ _orasw_meta_primary_node }}" |
180 | 193 | - "oracle_scan: {{ oracle_scan }}" |
181 | 194 | - "oracle_scan_port: {{ oracle_scan_port }}" |
182 | 195 | - "oracle_gi_nic_pub: {{ oracle_gi_nic_pub }}" |
|
185 | 198 | when: |
186 | 199 | - _oraswgi_meta_configure_cluster | bool |
187 | 200 |
|
188 | | - - name: install_home_gi | Install Grid Infrastructure |
| 201 | + - name: include 19c/21c | Install Grid Infrastructure |
189 | 202 | ansible.builtin.command: |
190 | 203 | # noqa no-changed-when |
191 | 204 | argv: "{{ __argv }}" |
192 | 205 | 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, [])) }} |
194 | 210 | __argv1: |
195 | 211 | - "{{ oracle_home_gi }}/gridSetup.sh" |
196 | 212 | - -responseFile |
|
211 | 227 | register: giinstall |
212 | 228 | failed_when: giinstall.rc not in [0, 6] |
213 | 229 |
|
214 | | - - name: Info |
| 230 | + - name: include 19c/21c | Info |
215 | 231 | ansible.builtin.debug: |
216 | 232 | var: giinstall.stdout_lines |
217 | 233 | when: |
218 | 234 | - giinstall.stdout_lines is defined |
219 | 235 | - _orasw_meta_primary_node | bool |
220 | 236 |
|
221 | | -- name: install_home_gi | include role oraswgi_manage_patches |
| 237 | +- name: include 19c/21c | include role oraswgi_manage_patches |
222 | 238 | ansible.builtin.include_role: |
223 | 239 | name: oraswgi_manage_patches |
224 | | - when: patch_before_rootsh and apply_patches_gi |
225 | | - |
226 | | -- name: "" |
227 | 240 | 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 |
229 | 246 | 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 |
231 | 248 | ansible.builtin.command: "{{ oracle_inventory_loc }}/orainstRoot.sh" |
232 | 249 | environment: "{{ oracle_script_env }}" |
233 | 250 | # noqa no-changed-when |
234 | 251 | become: true |
235 | 252 | tags: |
236 | 253 | - runroot |
237 | 254 |
|
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 |
242 | 257 |
|
243 | 258 | - name: install_home_gi | Run root script after installation (Master Node) |
244 | 259 | ansible.builtin.command: "{{ oracle_home_gi }}/root.sh" |
|
0 commit comments