|
1 | 1 | --- |
2 | | -- name: Work on Patch {{ dhc_opatch.patchid }} |
| 2 | +- name: loop_Patchid | Work on Patch {{ dhc_opatch.patchid }} |
3 | 3 | ansible.builtin.debug: |
4 | 4 | msg: |
5 | 5 | - >- |
|
14 | 14 | opatchauto: {{ __opatchauto_patchtype }} |
15 | 15 | - >- |
16 | 16 | excludeUPI: {{ dhc_opatch.excludeUPI | default('') }} |
17 | | - patchsubdir: {{ __oraswdb_manage_patches_patchsubdir | default('') }} |
| 17 | + - >- |
| 18 | + oracle_patch_stage: {{ oracle_patch_stage }} |
| 19 | + oracle_sw_copy: {{ oracle_sw_copy | bool }} |
| 20 | + is_sw_source_local: {{ is_sw_source_local | bool }} |
| 21 | +
|
| 22 | +# - name: loop_Patchid | debug data |
| 23 | +# ansible.builtin.debug: |
| 24 | +# msg: |
| 25 | +# - "{{ oracle_sw_patches | selectattr('patchid', 'equalto', dhc_opatch.patchid) }}" |
| 26 | +# - "{{ dhc_opatch.patchid }}" |
18 | 27 |
|
19 | | -- name: Work on oracle_sw_patches |
| 28 | +- name: loop_Patchid | Work on oracle_sw_patches |
20 | 29 | ansible.builtin.include_tasks: loop_opatch_apply.yml |
21 | 30 | vars: |
22 | 31 | __sw_patches_filename_creates: "{{ osp_loop.creates | default((dhc_opatch.patchid | string) + '/README.txt') }}" |
23 | 32 | __patch_unarchive_dir: "{{ oracle_patch_stage }}/{{ db_version }}/{{ __patch_upisubdir }}/" |
24 | 33 | __patch_upisubdir: >- |
25 | | - {%- if osp_loop.unique_patchid is defined -%} |
26 | | - upi_{{ osp_loop.unique_patchid -}}/{% endif -%} |
| 34 | + {{ osp_loop.unique_patchid is defined |
| 35 | + | ternary(osp_loop.unique_patchid, |
| 36 | + osp_loop.patchid) }}/ |
27 | 37 | with_items: |
28 | 38 | - "{{ oracle_sw_patches | selectattr('patchid', 'equalto', dhc_opatch.patchid) }}" |
29 | 39 | loop_control: |
|
38 | 48 | - not dbhome_patches.stdout_lines | select('match', osp_loop.patchid | string) | length > 0 |
39 | 49 | - osp_loop.unique_patchid | default(0) == dhc_opatch.excludeUPI | default(0) |
40 | 50 |
|
41 | | -- name: Info |
| 51 | +- name: loop_Patchid | Info |
42 | 52 | ansible.builtin.debug: |
43 | 53 | msg: Starting opatch apply. This could take some time to complete... |
44 | 54 |
|
45 | 55 | # opatchauto needs root user for execution |
46 | | -- name: Manage patch for DB |
| 56 | +- name: loop_Patchid | Manage patch for DB |
47 | 57 | opitzconsulting.ansible_oracle.oracle_opatch: |
48 | 58 | oracle_home: "{{ oracle_home_db }}" |
49 | 59 | patch_base: >- |
50 | | - {{ oracle_patch_install }}/{{ db_version }}/{{ dhc_opatch.path | default(__patch_upisubdir + (dhc_opatch.patchid | string)) }} |
| 60 | + {{ oracle_patch_install }}/{{ db_version }}/{{ dhc_opatch.path | default(__patch_localsubdir) }} |
51 | 61 | patch_id: "{{ dhc_opatch.patchid }}" |
52 | 62 | patch_version: "{{ dhc_opatch.patchversion | default(omit) }}" |
53 | 63 | exclude_upi: "{{ dhc_opatch.excludeUPI | default(omit) }}" |
|
60 | 70 | become: true |
61 | 71 | become_user: "{{ __opatchauto_patchtype | ternary('root', oracle_user) }}" |
62 | 72 | vars: |
63 | | - __patch_upisubdir: >- |
64 | | - {%- if dhc_opatch.excludeUPI is defined -%} |
65 | | - upi_{{ dhc_opatch.excludeUPI -}}/{% endif -%} |
| 73 | + __patch_localsubdir: >- |
| 74 | + {{ dhc_opatch.excludeUPI | default(dhc_opatch.patchid) }}/{{ dhc_opatch.patchid | string }} |
0 commit comments