-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpatch_oracle.yml
56 lines (49 loc) · 1.72 KB
/
patch_oracle.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
---
- hosts: oracle_patching
gather_facts: true
become: true
become_user: oracle
environment:
ORACLE_HOME: '{{ oracle_home_path }}'
PATH: '{{ oracle_home_path }}/OPatch:/opt/ora/app/oracle:.:/bin:/usr/ccs/bin:/usr/bin:/usr/sbin:/usr/ucb:/usr/openwin/bin:/usr/local/bin:/opt/ora/app/oracle/lbin:/opt/ora/app/oracle/product/{{ oracle_binary_version }}/bin:/opt/ora/app/oracle/product/{{ oracle_binary_version }}/bin:/usr/local/bin/perl:/home/ORADBA/local_bin:/usr/local/sbin'
ORACLE_BASE: '/opt/ora/app/oracle'
LD_LIBRARY_PATH: '/usr/lib:/opt/ora/app/oracle/product/{{ oracle_binary_version }}/lib:/usr/dt/lib:/usr/ucblib'
ORAENV_ASK: 'NO'
roles:
- { role: prep }
- { role: patching }
tasks:
- name: "Set the list of database SIDs if not set from prep"
set_fact:
DATABASE_SID: '{{ manual_post_sid_string|splitSidString }}'
when: DATABASE_SID is undefined
tags:
- post
- name: "Loop over the post role with each applicable SID"
include_role:
name: post
environment:
ORACLE_SID: '{{ sid }}'
loop_control:
loop_var: sid
with_items: '{{ DATABASE_SID }}'
tags:
- post
post_tasks:
- name: "Final --- Remove the Ansible patching directory ({{ ansible_patches_dir }})"
file:
#path instead of src required pre v2.3
path: '{{ ansible_patches_dir }}'
state: absent
tags:
- final
- post
- name: 'Final --- Enable crontab only after all databases have been patched'
command: '/bin/bash gen_crontab.sh ; /bin/bash crontab -r'
args:
chdir: '/opt/ora/app/oracle/crontab'
ignore_errors: yes
tags:
- final
- post
...