|
1 | 1 | --- |
| 2 | +# IMPORTANT !!! |
| 3 | +# This file is shared with 21.3.0.0.yml via symbolic link. |
| 4 | +# |
2 | 5 | - name: install_home_gi |
3 | 6 | tags: |
4 | 7 | - oragridswunpack |
5 | 8 | when: |
6 | 9 | - oracle_home_gi not in checkgiinstall.stdout |
7 | 10 | 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 }}" |
10 | 16 | run_once: "{{ _oraswgi_meta_configure_cluster }}" |
11 | 17 |
|
12 | 18 | - name: install_home_gi | Extract files to ORACLE_HOME (gi) |
13 | 19 | ansible.builtin.unarchive: |
14 | 20 | src: "{{ _oraswgi_install_oracle_gi_image }}" |
15 | 21 | dest: "{{ oracle_home_gi }}" |
16 | 22 | copy: false |
17 | | - with_items: "{{ oracle_sw_image_gi }}" |
| 23 | + with_items: "{{ oracle_sw_image_gi | selectattr('version', 'match', oracle_install_version_gi) }}" |
18 | 24 | loop_control: |
19 | 25 | label: "{{ _oraswgi_install_oracle_gi_image | default('') }}" |
20 | 26 | args: |
21 | 27 | creates: "{{ oracle_home_gi }}/root.sh" |
22 | 28 | become: true |
23 | 29 | become_user: "{{ _grid_install_user }}" |
24 | 30 | 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 |
25 | 35 | 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 }}" |
27 | 41 |
|
28 | | -# Check for an existing GRID_HOME before reinstallation of OPatch |
29 | 42 | - name: install_home_gi | Check for file GridSetup.sh |
30 | 43 | no_log: true |
31 | 44 | ansible.builtin.stat: |
32 | 45 | path: "{{ oracle_home_gi }}/gridSetup.sh" |
33 | 46 | register: stat_gridsetup_result |
34 | 47 | run_once: "{{ _oraswgi_meta_configure_cluster }}" |
| 48 | + become: true |
| 49 | + become_user: "{{ _grid_install_user }}" |
35 | 50 |
|
36 | 51 | - name: install_home_gi | State of GridSetup.sh |
37 | 52 | ansible.builtin.assert: |
| 53 | + quiet: true |
38 | 54 | that: "stat_gridsetup_result.stat.exists == True" |
39 | 55 | msg: "Cannot find {{ oracle_home_gi }}/gridSetup.sh }}" |
40 | 56 | run_once: "{{ _oraswgi_meta_configure_cluster }}" |
|
100 | 116 | when: |
101 | 117 | - item.diskgroup == oracle_asm_init_dg |
102 | 118 |
|
103 | | -- name: "" |
| 119 | +- name: install_home_gi | Block for configure Grid Infrastructure |
104 | 120 | 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']) }} |
106 | 129 |
|
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] |
108 | 133 | when: |
109 | 134 | - force_runcluvfy | default(false) or oracle_home_gi not in checkgiinstall.stdout |
110 | 135 | tags: always |
|
116 | 141 | tags: |
117 | 142 | - asmfd |
118 | 143 |
|
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, '') }}" |
121 | 168 | run_once: true |
122 | 169 |
|
123 | 170 | - name: install_home_gi | Install Grid Infrastructure |
124 | 171 | ansible.builtin.command: |
125 | 172 | # noqa no-changed-when |
126 | | - argv: |
| 173 | + argv: "{{ __argv }}" |
| 174 | + vars: |
| 175 | + __argv: "{{ __argv1 + (patch_before_rootsh | bool | ternary(__argvru, [])) }}" |
| 176 | + __argv1: |
127 | 177 | - "{{ oracle_home_gi }}/gridSetup.sh" |
128 | 178 | - -responseFile |
129 | 179 | - "{{ oracle_rsp_stage }}/{{ _oraswgi_install_oracle_grid_responsefile }}" |
130 | 180 | - -waitforcompletion |
131 | 181 | - -silent |
132 | 182 | - "{{ _oraswgi_install_giignoreprereqparam | default(omit) }}" |
| 183 | + __argvru: |
| 184 | + - -applyRU |
| 185 | + - "{{ __patchru_dir }}" |
133 | 186 | become: true |
134 | 187 | become_user: "{{ _grid_install_user }}" |
135 | 188 | run_once: "{{ _oraswgi_meta_configure_cluster }}" |
|
138 | 191 | register: giinstall |
139 | 192 | failed_when: giinstall.rc not in [0, 6] |
140 | 193 |
|
141 | | - - ansible.builtin.debug: # noqa name[missing] |
| 194 | + - name: Info |
| 195 | + ansible.builtin.debug: |
142 | 196 | var: giinstall.stdout_lines |
143 | 197 | run_once: "{{ _oraswgi_meta_configure_cluster }}" |
144 | 198 | when: giinstall.stdout_lines is defined |
|
172 | 226 | tags: |
173 | 227 | - runroot |
174 | 228 |
|
175 | | - - ansible.builtin.debug: # noqa name[missing] |
| 229 | + - name: Info |
| 230 | + ansible.builtin.debug: |
176 | 231 | var: rootmaster.stdout_lines |
177 | 232 | run_once: "{{ _oraswgi_meta_configure_cluster }}" |
178 | 233 | when: rootmaster.stdout_lines is defined |
179 | 234 |
|
180 | | - - ansible.builtin.debug: # noqa name[missing] |
| 235 | + - name: Info |
| 236 | + ansible.builtin.debug: |
181 | 237 | msg: "install_home_gi | Start Run root script after installation (Other Nodes)" |
182 | 238 | run_once: true |
183 | 239 |
|
|
200 | 256 | - inventory_hostname == item.1 |
201 | 257 | register: rootother |
202 | 258 |
|
203 | | - - ansible.builtin.debug: # noqa name[missing] |
| 259 | + - name: Info |
| 260 | + ansible.builtin.debug: |
204 | 261 | var: rootother.stdout_lines |
205 | 262 | when: rootother.stdout_lines is defined |
206 | 263 |
|
|
0 commit comments