Skip to content

Commit 3c6a31c

Browse files
committed
oradb-manage-db: bugfixes for include => include_tasks
1 parent d420c1e commit 3c6a31c

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

roles/oradb-manage-db/defaults/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
hostgroup: "{{ group_names[0] }}"
44
oracle_dbca_rsp: "dbca_{{ dbh.oracle_db_name }}.rsp" # Name of responsefile used by dbca. One per database
5-
oracle_netca_rsp: "netca_{{ item.home }}_{{ listener_name_template }}.rsp"
5+
oracle_netca_rsp: "netca_{{ dbh.home }}_{{ listener_name_template }}.rsp"
66
oracle_user: oracle # User that will own the Oracle Installations.
77
oracle_user_home: "/home/{{ oracle_user }}" # Home directory for oracle_user. Needed for passing in ssh-keys, profiles etc
88
oracle_group: oinstall # Primary group for oracle_user.
@@ -52,10 +52,10 @@
5252
oracle_gi_cluster_type: STANDARD
5353
hostgroup_hub: "{{ hostgroup }}-hub"
5454
hostgroup_leaf: "{{ hostgroup }}-leaf"
55-
create_listener: "{% if oracle_install_option_gi is defined %}False{% elif oracle_install_option_gi is undefined %}{% if item.listener_name is defined %}True{% else %}False{% endif %}{% endif %}"
56-
listener_name_template: "{% if item.listener_name is defined %}{{ item.listener_name }}{% else %}{{ listener_name }}{% endif %}"
57-
listener_protocols_template: "{% if item.listener_protocols is defined %}{{ item.listener_protocols }}{% else %}{{ listener_protocols }}{% endif %}"
58-
listener_port_template: "{% if item.listener_port is defined %}{{ item.listener_port }}{% else %}{{ listener_port }}{% endif %}"
55+
create_listener: "{% if oracle_install_option_gi is defined %}False{% elif oracle_install_option_gi is undefined %}{% if dbh.listener_name is defined %}True{% else %}False{% endif %}{% endif %}"
56+
listener_name_template: "{% if dbh.listener_name is defined %}{{ dbh.listener_name }}{% else %}{{ listener_name }}{% endif %}"
57+
listener_protocols_template: "{% if dbh.listener_protocols is defined %}{{ dbh.listener_protocols }}{% else %}{{ listener_protocols }}{% endif %}"
58+
listener_port_template: "{% if dbh.listener_port is defined %}{{ dbh.listener_port }}{% else %}{{ listener_port }}{% endif %}"
5959
listener_name: LISTENER
6060
listener_protocols: TCP
6161
listener_port: 1521
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
- name: listener | Create responsefile for listener configuration
2-
template: src=netca.rsp.{{ item.oracle_version_db }}.j2 dest={{ oracle_rsp_stage }}/{{ oracle_netca_rsp }}
2+
template: src=netca.rsp.{{ dbh.oracle_version_db }}.j2 dest={{ oracle_rsp_stage }}/{{ oracle_netca_rsp }}
33
become: true
44
become_user: "{{ oracle_user }}"
5-
with_items:
6-
- "{{ oracle_databases }}"
75
when: create_listener
6+
# when: create_listener and oracle_install_option_gi is defined and oracle_install_option_gi
87
tags: responsefile_netca, listener_install
98

109
- name: listener | Create listener
1110
shell: "{{ oracle_home_db }}/bin/netca -responseFile {{ oracle_rsp_stage }}/{{ oracle_netca_rsp }} -silent"
12-
with_items:
13-
- "{{ oracle_databases }}"
1411
args:
1512
creates: "{{ oracle_home_db }}/network/admin/listener.ora"
1613
become: true
1714
become_user: "{{ oracle_user }}"
1815
when: create_listener
16+
# when: create_listener and oracle_install_option_gi is defined and oracle_install_option_gi
1917
tags: listener_install

roles/oradb-manage-db/tasks/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
tags: set_fact
99

1010
- include_tasks: listener.yml
11-
when: create_listener
11+
with_items:
12+
- "{{ oracle_databases }}"
13+
loop_control:
14+
loop_var: dbh
15+
when: create_listener and oracle_databases is defined
1216
tags: listener
1317

1418
- name: manage-db | Add change-pdb script

0 commit comments

Comments
 (0)