Skip to content

Commit

Permalink
oraswgi_manage_patches
Browse files Browse the repository at this point in the history
  • Loading branch information
Rendanic committed Jun 16, 2024
1 parent 044551a commit 293018b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 23 deletions.
4 changes: 0 additions & 4 deletions roles/oraswgi_manage_patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Install/Remove Patches from Oracle Database Homes

- [Requirements](#requirements)
- [Discovered Tags](#discovered-tags)
- [Open Tasks](#open-tasks)
- [Dependencies](#dependencies)
- [License](#license)
- [Author](#author)
Expand All @@ -26,9 +25,6 @@ Install/Remove Patches from Oracle Database Homes

**_current_opatch_version_**

## Open Tasks

- (information): support for www download missing

## Dependencies

Expand Down
3 changes: 2 additions & 1 deletion roles/oraswgi_manage_patches/tasks/loop_patchid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
opatchauto: {{ __opatchauto_patchtype }}
- >-
patchsubdir: {{ __oraswdb_manage_patches_patchsubdir | default('') }}
custom_path: {{ gip_opatch.0.path | default('') }}
- name: loop_patchid | Work on oracle_sw_patches
ansible.builtin.include_tasks: loop_stage_patch.yml
Expand Down Expand Up @@ -45,7 +46,7 @@
opitzconsulting.ansible_oracle.oracle_opatch:
oracle_home: "{{ oracle_home_gi }}"
patch_base: >-
{{ oracle_patch_install }}/{{ oracle_install_version_gi }}/{{ dhc_opatch.path | default(__patch_base_local) }}
{{ oracle_patch_install }}/{{ oracle_install_version_gi }}/{{ gip_opatch.0.path | default(__patch_base_local) }}
patch_id: "{{ gip_opatch.0.patchid }}"
patch_version: "{{ gip_opatch.0.patchversion | default(omit) }}"
exclude_upi: "{{ gip_opatch.0.excludeUPI | default(omit) }}"
Expand Down
22 changes: 5 additions & 17 deletions roles/oraswgi_manage_patches/tasks/loop_stage_patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
oracle_patch_stage: {{ oracle_patch_stage }}
oracle_sw_copy: {{ oracle_sw_copy | bool }}
is_sw_source_local: {{ is_sw_source_local | bool }}
- >-
creates: {{ __sw_patches_filename_creates }}
patch_unarchive_dir: {{ __patch_unarchive_dir }}
- name: Loop_stage_patch | Become User to oracle
become: true
Expand Down Expand Up @@ -45,25 +42,17 @@
- name: Loop_stage_patch | Check for unarchived patch archive
ansible.builtin.stat:
path: "{{ _oraswgi_manage_patches_creates }}"
register: checkpatcharchiveres
register: __checkpatcharchiveres

- name: Loop_stage_patch | Copy oracle GI/Restart patch to server (local)
ansible.builtin.copy:
src: "{{ oracle_sw_source_local }}/{{ _oraswgi_manage_patches_sw_patch_dict.filename }}"
dest: "{{ oracle_stage }}/{{ _oraswgi_manage_patches_sw_patch_dict.filename }}"
mode: "0644"
force: false
when:
- oracle_sw_copy | bool
- osp_loop.state == 'present'
block:

- name: Loop_stage_patch | Check for unarchived patch archive
ansible.builtin.stat:
path: "{{ __patch_unarchive_dir }}/{{ __sw_patches_filename_creates }}"
register: checkpatcharchiveres
vars:
__sw_patches_filename_creates: "{{ osp_loop.creates | default((osp_loop.patchid | string) + '/README.txt') }}"
path: "{{ _oraswgi_manage_patches_creates }}"
register: __checkpatcharchiveres

- name: Loop_stage_patch | Copy oracle GI patch (opatch) to server (local)
ansible.builtin.copy:
Expand All @@ -73,7 +62,7 @@
force: false
when:
- is_sw_source_local | bool
- not checkpatcharchiveres.stat.exists
- not __checkpatcharchiveres.stat.exists

- name: Loop_stage_patch | Copy oracle GI patch (opatch) to server (www)
ansible.builtin.get_url:
Expand All @@ -83,13 +72,12 @@
force: false
when:
- not is_sw_source_local | bool
- not checkpatcharchiveres.stat.exists | bool
- not __checkpatcharchiveres.stat.exists | bool

- name: Loop_stage_patch | Extract one-off patch files to patch base
when:
- oracle_sw_copy | bool
- oracle_sw_unpack | bool
- osp_loop.state == 'present'
tags:
- oraswdbpsuunpack1
block:
Expand Down
2 changes: 1 addition & 1 deletion roles/oraswgi_manage_patches/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
- name: Set facts for installed patches
ansible.builtin.set_fact:
_oraswgi_gi_patches: >-
{{ opatch_content['InventoryInstance']['patches']['patch'] | ansible.utils.keep_keys(target=['uniquePatchID', 'patchID', 'patchDescription']) }}
{{ opatch_content['InventoryInstance']['patches']['patch'] | default([]) | ansible.utils.keep_keys(target=['uniquePatchID', 'patchID', 'patchDescription']) }}
vars:
opatch_content: "{{ _opatch_lsinv_xml_res['content'] | b64decode | ansible.utils.from_xml }}"

Expand Down

0 comments on commit 293018b

Please sign in to comment.