-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatch.yml
28 lines (28 loc) · 891 Bytes
/
patch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
- hosts: localhost
tasks:
- name: Check if /etc/oratab exists
stat:
path: /etc/oratab
register: oratab
- debug:
msg: "/etc/oratab does not exists"
when: oratab.stat.exists == false
- name: Check if unzip exists (if not we wont be able to unzip the opatch zipfile)
shell: "command -v unzip"
register: unzip_exists
- debug:
msg: "unzip cannot be found"
when: unzip_exists == false
- name: Copy the opatch zipfile to the target oracle home
copy:
src: p6880880_112000_Linux-x86-64.zip
dest: /u01/oracle/11204
- name: Upgrade opatch
shell: unzip -o /u01/oracle/11204/p6880880_112000_Linux-x86-64.zip -d /u01/oracle/11204
register: unzip
failed_when: unzip.rc != 0
- name: Cleanup the zipfile from the target home
file:
name: /u01/oracle/11204/p6880880_112000_Linux-x86-64.zip
state: absent