Skip to content

Commit ba1bc42

Browse files
Mikael SandströmMikael Sandström
authored andcommitted
Updated oraswgi-opatch
1 parent 2e13827 commit ba1bc42

File tree

4 files changed

+49
-47
lines changed

4 files changed

+49
-47
lines changed

oraswgi-opatch/defaults/main.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@
3838

3939

4040
oracle_sw_image_gi_psu: # Files containing the installation media for Grid Infrastructure
41-
- { filename: p19392646_121020_Linux-x86-64.zip, patchid: 19392646, version: 12.1.0.2, description: GI-PSU-Oct-2014 }
42-
- { filename: p19380115_112040_Linux-x86-64.zip, patchid: 19380115, version: 11.2.0.4, description: GI-PSU-Oct-2014 }
41+
#- { filename: p19392646_121020_Linux-x86-64.zip, patchid: 19392646, version: 12.1.0.2, patchversion: 12.1.0.2.1, description: GI-PSU-Oct-2014 }
42+
- { filename: p20485724_121020_Linux-x86-64.zip, patchid: 20485724, version: 12.1.0.2, patchversion: 12.1.0.2.3, description: GI-PSU-Apr-2015 }
43+
#- { filename: p19380115_112040_Linux-x86-64.zip, patchid: 19380115, version: 11.2.0.4, patchversion: 11.2.0.4.4, description: GI-PSU-Oct-2014 }
44+
- { filename: p20485808_112040_Linux-x86-64.zip, patchid: 20485808, version: 11.2.0.4, patchversion: 11.2.0.4.6, description: GI-PSU-Apr-2015 }
45+
46+
4347

4448
oracle_opatch_patch:
4549
- { filename: p6880880_121010_Linux-x86-64.zip, version: 12.1.0.2 }

oraswgi-opatch/files/ocmrsp.expect

Lines changed: 0 additions & 19 deletions
This file was deleted.

oraswgi-opatch/tasks/main.yml

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
---
22

3+
- name: Check which GI patches are applied
4+
shell: "{{ oracle_home_gi }}/OPatch/opatch lspatches -oh {{ oracle_home_gi }} |grep {{ item.patchversion }} |wc -l"
5+
sudo: yes
6+
sudo_user: "{{ grid_install_user }}"
7+
with_items: oracle_sw_image_gi_psu
8+
tags: check_applied_gi_patches
9+
when: oracle_psu_apply_gi
10+
register: gi_applied_patches
11+
12+
313
- name: Create stage directory
4-
file: dest={{ oracle_psu_stage }} mode=775 owner={{ grid_install_user }} group={{ oracle_group }} state=directory
14+
file: dest={{ oracle_psu_stage }}/{{ oracle_install_version_gi }} mode=775 owner={{ grid_install_user }} group={{ oracle_group }} state=directory
515
tags:
616
- directoriespsu
717
when: oracle_psu_apply_gi
@@ -25,7 +35,7 @@
2535
- oragridopatchget
2636

2737
- name: Extract OPatch to stage-area
28-
unarchive: src={{ oracle_stage }}/{{ item.filename }} dest={{ oracle_psu_stage }} copy=no
38+
unarchive: src={{ oracle_stage }}/{{ item.filename }} dest={{ oracle_psu_stage }}/{{ oracle_install_version_gi }} copy=no
2939
sudo: yes
3040
sudo_user: "{{ grid_install_user }}"
3141
with_items: oracle_opatch_patch
@@ -34,53 +44,57 @@
3444
- oragridpatchunpack
3545

3646
- name: Extract GI psu files to stage-area
37-
unarchive: src={{ oracle_stage }}/{{ item.filename }} dest={{ oracle_psu_stage }} copy=no
47+
unarchive: src={{ oracle_stage }}/{{ item.filename }} dest={{ oracle_psu_stage }}/{{ oracle_install_version_gi }} copy=no
3848
sudo: yes
3949
sudo_user: "{{ grid_install_user }}"
4050
with_items: oracle_sw_image_gi_psu
4151
when: oracle_psu_apply_gi and "{{ item.version }}" == "{{ oracle_install_version_gi }}"
4252
tags:
4353
- oragridpsuunpack
4454

55+
4556
- name: Distribute latest opatch
46-
shell: rm -rf {{ oracle_home_gi }}/OPatch; cp -Rvp {{ oracle_psu_stage }}/OPatch {{ oracle_home_gi }}; chown -R {{ grid_user }}:{{ oracle_group }} {{ oracle_home_gi }}/OPatch
57+
shell: rm -rf {{ oracle_home_gi }}/OPatch; cp -Rvp {{ oracle_psu_stage }}/{{ oracle_install_version_gi }}/OPatch {{ oracle_home_gi }}; chown -R {{ grid_install_user }}:{{ oracle_group }} {{ oracle_home_gi }}/OPatch
4758
when: oracle_psu_apply_gi
4859
tags:
4960
- oragridnewopatch
5061

5162
- name: Configure ocm.rsp (1)
52-
template: src=ocmrsp.expect.j2 dest={{ oracle_psu_stage }}/ocmrsp.expect mode=0777 force=yes
63+
template: src=ocmrsp.expect.j2 dest={{ oracle_psu_stage }}/{{ oracle_install_version_gi }}/ocmrsp.expect mode=0777 force=yes
5364
when: oracle_psu_apply_gi
5465
sudo: yes
5566
sudo_user: "{{ grid_install_user }}"
5667
tags:
5768
- ocmconfig
5869

5970
- name: Configure ocm.rsp (2)
60-
shell: "{{ oracle_psu_stage }}/ocmrsp.expect"
71+
shell: "{{ oracle_psu_stage }}/{{ oracle_install_version_gi }}/ocmrsp.expect"
6172
when: oracle_psu_apply_gi
6273
sudo: yes
6374
sudo_user: "{{ grid_install_user }}"
6475
tags:
6576
- ocmconfig
6677

6778
- name: Apply PSU to GI (v12.1) (Master node)
68-
shell: "{{ oracle_home_gi }}/OPatch/opatchauto apply {{ oracle_psu_stage }}/{{ item.patchid }} -oh {{ oracle_home_gi }} -ocmrf {{ oracle_psu_stage }}/ocm.rsp "
69-
with_items: oracle_sw_image_gi_psu
79+
shell: "{{ oracle_home_gi }}/OPatch/opatchauto apply {{ oracle_psu_stage }}/{{ oracle_install_version_gi }}/{{ item.0.patchid }} -oh {{ oracle_home_gi }} -ocmrf {{ oracle_psu_stage }}/{{ oracle_install_version_gi }}/ocm.rsp "
80+
with_together:
81+
- oracle_sw_image_gi_psu
82+
- gi_applied_patches.results
7083
tags:
71-
- oragridpsuapply
72-
when: master_node and oracle_psu_apply_gi and '12.1' in oracle_install_version_gi and "{{ item.version }}" == "{{ oracle_install_version_gi }}"
84+
- apply_psu_grid
85+
when: master_node and oracle_psu_apply_gi and '12.1' in oracle_install_version_gi and "{{ item.0.version }}" == "{{ oracle_install_version_gi }}" and not {{ item.1.stdout }} != 0
7386
register: psuapplym
7487

88+
7589
- name: Apply PSU to GI (v11.2) (Master node)
76-
shell: "{{ oracle_home_gi }}/OPatch/opatch auto {{ oracle_psu_stage }}/{{ item.patchid }} -oh {{ oracle_home_gi }} -ocmrf {{ oracle_psu_stage }}/ocm.rsp "
77-
with_items: oracle_sw_image_gi_psu
78-
tags:
79-
- oragridpsuapply
80-
when: master_node and oracle_psu_apply_gi and '11.2' in oracle_install_version_gi and "{{ item.version }}" == "{{ oracle_install_version_gi }}"
90+
shell: "{{ oracle_home_gi }}/OPatch/opatch auto {{ oracle_psu_stage }}/{{ oracle_install_version_gi }}/{{ item.0.patchid }} -oh {{ oracle_home_gi }} -ocmrf {{ oracle_psu_stage }}/{{ oracle_install_version_gi }}/ocm.rsp "
91+
with_together:
92+
- oracle_sw_image_gi_psu
93+
- gi_applied_patches.results
94+
tags: apply_psu_grid
95+
when: master_node and oracle_psu_apply_gi and '11.2' in oracle_install_version_gi and "{{ item.0.version }}" == "{{ oracle_install_version_gi }}" and not {{ item.1.stdout }} != 0
8196
register: psuapplym
8297

83-
8498
- debug: var=psuapplym.stdout_lines
8599
when: master_node and oracle_psu_apply_gi
86100
tags:
@@ -98,19 +112,22 @@
98112
when: master_node
99113

100114
- name: Apply PSU to GI (v12.1) (other nodes)
101-
shell: "{{ oracle_home_gi }}/OPatch/opatchauto apply {{ oracle_psu_stage }}/{{ item.patchid }} -oh {{ oracle_home_gi }} -ocmrf {{ oracle_psu_stage }}/ocm.rsp "
102-
with_items: oracle_sw_image_gi_psu
115+
shell: "{{ oracle_home_gi }}/OPatch/opatchauto apply {{ oracle_psu_stage }}/{{ oracle_install_version_gi }}/{{ item.0.patchid }} -oh {{ oracle_home_gi }} -ocmrf {{ oracle_psu_stage }}/{{ oracle_install_version_gi }}/ocm.rsp "
116+
with_together:
117+
- oracle_sw_image_gi_psu
118+
- gi_applied_patches.results
103119
tags:
104-
- oragridpsuapply
105-
when: not master_node and oracle_psu_apply_gi and '12.1' in oracle_install_version_gi and "{{ item.version }}" == "{{ oracle_install_version_gi }}"
120+
- apply_psu_grid
121+
when: not master_node and oracle_psu_apply_gi and '12.1' in oracle_install_version_gi and "{{ item.0.version }}" == "{{ oracle_install_version_gi }}" and not {{ item.1.stdout }} != 0
106122
register: psuapplyo
107123

108124
- name: Apply PSU to GI (v11.2) (other nodes)
109-
shell: "{{ oracle_home_gi }}/OPatch/opatch auto {{ oracle_psu_stage }}/{{ item.patchid }} -oh {{ oracle_home_gi }} -ocmrf {{ oracle_psu_stage }}/ocm.rsp "
110-
with_items: oracle_sw_image_gi_psu
111-
tags:
112-
- oragridpsuapply
113-
when: not master_node and oracle_psu_apply_gi and '11.2' in oracle_install_version_gi and "{{ item.version }}" == "{{ oracle_install_version_gi }}"
125+
shell: "{{ oracle_home_gi }}/OPatch/opatch auto {{ oracle_psu_stage }}/{{ oracle_install_version_gi }}/{{ item.0.patchid }} -oh {{ oracle_home_gi }} -ocmrf {{ oracle_psu_stage }}/{{ oracle_install_version_gi }}/ocm.rsp "
126+
with_together:
127+
- oracle_sw_image_gi_psu
128+
- gi_applied_patches.results
129+
tags: apply_psu_grid
130+
when: not master_node and oracle_psu_apply_gi and '11.2' in oracle_install_version_gi and "{{ item.0.version }}" == "{{ oracle_install_version_gi }}" and not {{ item.1.stdout }} != 0
114131
register: psuapplyo
115132

116133
- debug: var=psuapplyo.stdout_lines

oraswgi-opatch/templates/ocmrsp.expect.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/expect -f
2-
spawn {{ oracle_home_gi }}/OPatch/ocm/bin/emocmrsp -no_banner -output {{ oracle_psu_stage }}/ocm.rsp
2+
spawn {{ oracle_home_gi }}/OPatch/ocm/bin/emocmrsp -no_banner -output {{ oracle_psu_stage }}/{{ oracle_install_version_gi }}/ocm.rsp
33
expect {
44
"Email address/User Name:"
55
{

0 commit comments

Comments
 (0)