Skip to content

Commit a774914

Browse files
RendanicUser
authored andcommitted
oradb-datapatch: Bugfix for wrong oracle_home during datapatch
1 parent f665d39 commit a774914

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

roles/oradb-datapatch/defaults/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,12 @@ oracle_env_lsnrctl:
3131

3232
autostartup_service: false
3333
fail_on_db_not_exist: False
34+
35+
oracle_db_home: "{%- if item is defined -%}
36+
{%- if db_homes_config[item.home]['oracle_home'] is defined -%}
37+
{{db_homes_config[item.home]['oracle_home']}}
38+
{%- else -%}
39+
{{oracle_base}}/{{db_homes_config[item.home]['version']}}/{{db_homes_config[item.home]['home']}}
40+
{%- endif -%}
41+
{%- endif -%}"
42+

roles/oradb-datapatch/tasks/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@
1010

1111
- name: oradb-datapatch | Start database (non GI)
1212
oracle_db:
13-
oracle_home={{ oracle_home_db}}
14-
db_name={{ dbh.oracle_db_name }}
15-
db_unique_name={{ dbh.oracle_db_unique_name |default(omit) }}
16-
sid={{ dbh.oracle_db_instance_name |default(omit) }}
13+
# oracle_home={{ oracle_home_db}}
14+
oracle_home={{ oracle_db_home}}
15+
db_name={{ item.oracle_db_name }}
16+
db_unique_name={{ item.oracle_db_unique_name |default(omit) }}
17+
sid={{ item.oracle_db_instance_name |default(omit) }}
1718
state=started
1819
become_user: "{{ oracle_user }}"
1920
with_items: "{{ oracle_databases }}"
20-
when: dbh.oracle_db_type == 'SI'
21+
when: item.oracle_db_type == 'SI'
2122
loop_control:
22-
loop_var: dbh
23-
label: "home: {{ dbh.home }} db_name: {{ dbh.oracle_db_name }}"
23+
label: "home: {{ item.home }} db_name: {{ item.oracle_db_name }}"
2424
tags: startdb
2525

2626
- name: oradb-datapatch | Run datapatch
2727
oracle_datapatch:
28-
oracle_home={{ oracle_home_db }}
28+
oracle_home={{ oracle_db_home }}
2929
db_name={{ item.oracle_db_name }}
3030
db_unique_name={{ item.oracle_db_unique_name |default(omit)}}
3131
sid={{ item.oracle_db_instance_name |default(omit) }}

0 commit comments

Comments
 (0)