|
20 | 20 | - name: Loop_stage_patch | Become User to oracle |
21 | 21 | become: true |
22 | 22 | become_user: "{{ _grid_install_user }}" |
| 23 | + vars: |
| 24 | + _oraswgi_manage_patches_sw_patch_dict: "{{ osp_loop }}" |
| 25 | + _oraswgi_manage_patches_unique_patchid: >- |
| 26 | + {{ _oraswgi_manage_patches_sw_patch_dict.unique_patchid | default(_oraswgi_manage_patches_sw_patch_dict.patchid) }} |
| 27 | + _oraswgi_manage_patches_unarchive_dir: "{{ oracle_patch_stage }}/{{ _oraswgi_manage_patches_sw_patch_dict.version }}/{{ _oraswgi_manage_patches_unique_patchid }}" |
| 28 | + _oraswgi_manage_patches_creates: >- |
| 29 | + {{ _oraswgi_manage_patches_unarchive_dir }}/{{ _oraswgi_manage_patches_sw_patch_dict.creates | default((_oraswgi_manage_patches_sw_patch_dict.patchid | string) + '/README.txt') }} |
| 30 | +
|
23 | 31 | block: |
24 | | - - name: Loop_stage_patch | Copy oracle DB patch (opatch) to server |
| 32 | + - name: Loop_stage_patch | State data for loop_stage_patch.yml |
| 33 | + ansible.builtin.debug: |
| 34 | + msg: |
| 35 | + - >- |
| 36 | + patchid: {{ _oraswgi_manage_patches_sw_patch_dict['patchid'] | default('') }} |
| 37 | + unique_patchid: {{ _oraswgi_manage_patches_unique_patchid | default('') }} |
| 38 | + - >- |
| 39 | + oracle_patch_stage: {{ oracle_patch_stage }} |
| 40 | + is_sw_source_local: {{ is_sw_source_local | bool }} |
| 41 | + - >- |
| 42 | + creates: {{ _oraswgi_manage_patches_creates }} |
| 43 | + patch_unarchive_dir: {{ _oraswgi_manage_patches_unarchive_dir }} |
| 44 | +
|
| 45 | + - name: Loop_stage_patch | Check for unarchived patch archive |
| 46 | + ansible.builtin.stat: |
| 47 | + path: "{{ _oraswgi_manage_patches_creates }}" |
| 48 | + register: checkpatcharchiveres |
| 49 | + |
| 50 | + - name: Loop_stage_patch | Copy oracle GI/Restart patch to server (local) |
| 51 | + ansible.builtin.copy: |
| 52 | + src: "{{ oracle_sw_source_local }}/{{ _oraswgi_manage_patches_sw_patch_dict.filename }}" |
| 53 | + dest: "{{ oracle_stage }}/{{ _oraswgi_manage_patches_sw_patch_dict.filename }}" |
| 54 | + mode: "0644" |
| 55 | + force: false |
25 | 56 | when: |
26 | 57 | - oracle_sw_copy | bool |
27 | 58 | - osp_loop.state == 'present' |
|
64 | 95 | block: |
65 | 96 | - name: Loop_stage_patch | Create destination folder for unarchive |
66 | 97 | ansible.builtin.file: |
67 | | - dest: "{{ __patch_unarchive_dir }}" |
68 | | - mode: 0755 |
| 98 | + dest: "{{ _oraswgi_manage_patches_unarchive_dir }}" |
| 99 | + mode: 0775 |
69 | 100 | state: directory |
| 101 | + owner: "{{ _grid_install_user }}" |
| 102 | + group: "{{ oracle_group }}" |
| 103 | + become: true |
| 104 | + become_user: root |
70 | 105 |
|
71 | 106 | - name: Loop_stage_patch | Extract one-off patch files to patch base |
72 | 107 | ansible.builtin.unarchive: |
73 | | - src: "{{ oracle_stage }}/{{ osp_loop.filename }}" |
74 | | - dest: "{{ __patch_unarchive_dir }}" |
75 | | - creates: "{{ __patch_unarchive_dir }}/{{ __sw_patches_filename_creates }}" |
| 108 | + src: "{{ oracle_stage }}/{{ _oraswgi_manage_patches_sw_patch_dict.filename }}" |
| 109 | + dest: "{{ _oraswgi_manage_patches_unarchive_dir }}" |
| 110 | + creates: "{{ _oraswgi_manage_patches_creates }}" |
76 | 111 | copy: false |
| 112 | + owner: "{{ _grid_install_user }}" |
| 113 | + group: "{{ oracle_group }}" |
| 114 | + mode: o+r,g+r |
| 115 | + become: true |
| 116 | + become_user: root |
77 | 117 |
|
78 | 118 | - name: Loop_stage_patch | Remove patch archive from stage |
79 | 119 | ansible.builtin.file: |
80 | | - path: "{{ oracle_stage }}/{{ osp_loop.filename }}" |
| 120 | + path: "{{ oracle_stage }}/{{ _oraswgi_manage_patches_sw_patch_dict.filename }}" |
81 | 121 | state: absent |
82 | 122 | when: |
83 | 123 | - oracle_sw_copy | bool |
0 commit comments