forked from ajitsingh25/weblogic-patching
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apply.yml
66 lines (52 loc) · 1.72 KB
/
apply.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#- name: main
- hosts: all
become: true
become_user: "{{oracle_user}}"
gather_facts: false
tasks:
- stat:
path: "{{oracle_home}}"
register: ohCheck
- set_fact:
rollback_psu: "false"
- debug:
var: rollback_psu
when: not rollback_psu
- name: Check if Oracle_Home Exists
fail:
msg: Message {{oracle_home}} doesn't exits on {{ansible_hostname}}.
when: not ohCheck.stat.exists
- debug:
msg: "{{ patch_name }}"
tags: debug
- name: Run pre-check tasks
include: tasks/pre_checks.yml
tags: pre_checks
when: (quarterly_patches[oracle_version]) is defined or (oneoff_patches[oracle_version]) is defined
- name: Check PSU patches if already applied
shell: opatch lspatches | grep ';'| cut -d';' -f1 | grep {{ quarterly_patches[oracle_version][patch_name].patchid }}
environment: "{{ env }}"
register: psuappliedpatch
when: (quarterly_patches[oracle_version]) is defined
ignore_errors: yes
async: 900
poll: 30
- debug:
var: psuappliedpatch
tags: debug
- name: Extract PSU and One-off patches
include: tasks/extract_files.yml
tags: extract_files
when: (quarterly_patches[oracle_version]) is defined or (oneoff_patches[oracle_version]) is defined
- name: Apply Quarterly Patch
include: tasks/psu_apply.yml
when: psuappliedpatch.stdout|string == "" and (quarterly_patches[oracle_version]) is defined
- name: Apply One-off Patch
include: tasks/oneoff_apply.yml
when: oneoff_patches[oracle_version] is defined
- name: Applied Patch[s] Output
include: tasks/post_checks.yml
tags: list_patch
- name: Cleanup the patch zips
include: tasks/cleanup.yml
tags: always