Skip to content

Commit 2fa1f71

Browse files
committed
oraswdb_install: Support for readonly ORACLE_HOME
1 parent a167231 commit 2fa1f71

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

roles/oraswdb_install/tasks/19.3.0.0.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: install_home_db | Install Oracle Database Server
3-
ansible.builtin.command: "{{ oracle_home_db }}/runInstaller -responseFile {{ oracle_rsp_stage }}/{{ oracle_db_responsefile }} -ignorePrereq -silent -waitforcompletion"
3+
ansible.builtin.command: "{{ oracle_home_db }}/runInstaller -responseFile {{ oracle_rsp_stage }}/{{ oracle_db_responsefile }} -ignorePrereq -silent -waitforcompletion {% if db_homes_config[dbh.home]['oracle_home_name'] is defined %}ORACLE_HOME_NAME={{ db_homes_config[dbh.home]['oracle_home_name'] }}{% endif %}"
44
become: true
55
become_user: "{{ oracle_user }}"
66
run_once: "{{ configure_cluster }}"
@@ -18,3 +18,5 @@
1818
tags:
1919
- oradbinstall
2020
ignore_errors: true
21+
22+
- include_tasks: roohctl.yml

roles/oraswdb_install/tasks/21.3.0.0.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: install_home_db | Install Oracle Database Server
3-
ansible.builtin.command: "{{ oracle_home_db }}/runInstaller -responseFile {{ oracle_rsp_stage }}/{{ oracle_db_responsefile }} -ignorePrereq -silent -waitforcompletion"
3+
ansible.builtin.command: "{{ oracle_home_db }}/runInstaller -responseFile {{ oracle_rsp_stage }}/{{ oracle_db_responsefile }} -ignorePrereq -silent -waitforcompletion {% if db_homes_config[dbh.home]['oracle_home_name'] is defined %}ORACLE_HOME_NAME={{ db_homes_config[dbh.home]['oracle_home_name'] }}{% endif %}"
44
become: true
55
become_user: "{{ oracle_user }}"
66
run_once: "{{ configure_cluster }}"
@@ -18,3 +18,5 @@
1818
tags:
1919
- oradbinstall
2020
ignore_errors: true
21+
22+
- include_tasks: roohctl.yml
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# we need a known value for ORACLE_HOME_NAME for later usage in ansible-oracle
3+
- name: install_home_db | Check Inventory for enabled readonly home
4+
ansible.builtin.assert:
5+
fail_msg: Missing oracle_home_name key in db_homes_config for enabled readonly_home
6+
that:
7+
- db_homes_config[dbh.home]['oracle_home_name'] is defined
8+
when:
9+
- db_homes_config[dbh.home]['readonly_home'] | default(false)
10+
11+
- name: install_home_db | Configure Read Only Oracle Home
12+
ansible.builtin.command: "{{ oracle_home_db }}/bin/roohctl {% if db_homes_config[dbh.home]['readonly_home'] | default(false) %}-enable{% else %}-disable{% endif %}"
13+
become: true
14+
become_user: "{{ oracle_user }}"
15+
run_once: "{{ configure_cluster }}"
16+
when:
17+
- oracle_home_db not in existing_dbhome.stdout_lines
18+
tags:
19+
- roohctl
20+
register: roohctl
21+
failed_when: roohctl.rc not in [0]
22+
23+
- ansible.builtin.debug: var=roohctl.stdout_lines
24+
# noqa unnamed-task ignore-errors
25+
run_once: "{{ configure_cluster }}"
26+
when:
27+
- oracle_home_db not in existing_dbhome.stdout_lines
28+
- roohctl.changed
29+
tags:
30+
- roohctl
31+
ignore_errors: true

0 commit comments

Comments
 (0)