Skip to content

Commit 6afcdae

Browse files
committed
RAC: Reenabled RAC-Support in 4.x
1 parent 6fcfb30 commit 6afcdae

File tree

39 files changed

+276
-102
lines changed

39 files changed

+276
-102
lines changed

.ansible-lint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ exclude_paths:
1717
- playbooks/desupported
1818
- changelogs
1919
- roles/oraemagent_install # deprecated role
20+
- example/*/ansible/playbooks/collections/ansible_collections
21+
- playbooks/collections/ansible_collections
2022

2123
extra_vars:
2224
hostgroup: all

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
LINUX.X64_*.zip
55

66
# ignore for ansible-navigator
7-
playbooks/collections
7+
playbooks/collections/ansible_collections
8+
example/*/ansible/playbooks/collections/ansible_collections
89
ansible-navigator.log
910
navigator/replay/*json
11+

changelogs/fragments/rac.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
minor_changes:
3+
- "RAC: Reenabled RAC-Support in 4.x ()"
4+
breaking_changes:
5+
- "orasw_meta: added variable orasw_meta_cluster_hostgroup for RAC ()"

roles/oraasm_manage_diskgroups/tasks/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
attribute_value: "{{ _oraasm_manage_diskgroups_attr_value | default(omit) }}"
1414
state: "{{ ad_loop.state }}"
1515
environment: "{{ _grid_env }}"
16-
run_once: "{{ _oraswgi_meta_configure_cluster }}"
1716
become: true
1817
become_user: "{{ _grid_install_user }}"
1918
with_items: "{{ asm_diskgroups }}"
@@ -23,4 +22,6 @@
2322
diskgroup: {{ ad_loop.diskgroup | default('') }}
2423
redundancy: {{ ad_loop.properties | map(attribute='redundancy') | first | default('') }}
2524
state: {{ ad_loop.state | default('') }}
25+
when:
26+
- _orasw_meta_primary_node | bool
2627
tags: diskgroup

roles/oradb_manage_db/tasks/manage-db.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@
5454
- name: state
5555
ansible.builtin.debug:
5656
msg: "Maintaining DB - {{ odb.oracle_db_name }}, ORACLE_HOME - {{ _oracle_home_db }}"
57-
run_once: "{{ _oraswgi_meta_configure_cluster }}"
58-
when: odb.state == 'present'
57+
when:
58+
- odb.state == 'present'
59+
- _orasw_meta_primary_node | bool
5960

6061
# dbca_copy_template is for special situations, when using DBCA-templates
6162
# without executing a template task before.

roles/oradb_rman/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@
333333
- odb.1.immediate is defined
334334
- odb.1.immediate
335335
- odb.1.state | default('present') == 'present'
336-
- "((_oraswgi_meta_configure_cluster and inventory_hostname == cluster_master) or not _oraswgi_meta_configure_cluster )"
336+
- _orasw_meta_primary_node | bool
337337
tags:
338338
- rmanexecute
339339

roles/orahost/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@
117117
- name: ssh-keys | Generate SSH keys
118118
local_action: shell rm -f /tmp/id_rsa*; ssh-keygen -q -N "" -f /tmp/id_rsa ; chmod +r /tmp/id_rsa; cat /tmp/id_rsa.pub > /tmp/authorized_keys # noqa yaml no-handler deprecated-local-action ignore-errors no-changed-when fqcn[action-core]
119119
ignore_errors: true
120-
run_once: "{{ _oraswgi_meta_configure_cluster }}"
121120
when:
122121
- configure_ssh
123122
- _oraswgi_meta_configure_cluster
124123
- old_ssh_config
124+
- _orasw_meta_primary_node | bool
125125
become: false
126126
tags:
127127
- sshkeys
@@ -236,11 +236,11 @@
236236
with_items:
237237
- "{{ ssh_keys }}"
238238
- "{{ keyfile }}"
239-
run_once: "{{ _oraswgi_meta_configure_cluster }}"
240239
when:
241240
- configure_ssh
242241
- _oraswgi_meta_configure_cluster
243242
- old_ssh_config
243+
- _orasw_meta_primary_node | bool
244244
ignore_errors: true
245245
become: false
246246
tags:

roles/orahost_meta/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Meta role used by other roles to share variable defaults.
2424
- [oracle_user](#oracle_user)
2525
- [oracle_user_home](#oracle_user_home)
2626
- [role_separation](#role_separation)
27+
- [Discovered Tags](#discovered-tags)
2728
- [Dependencies](#dependencies)
2829
- [License](#license)
2930
- [Author](#author)
@@ -283,6 +284,11 @@ See `grid_user` and `oracle_user` for Grid-Infrastructure user.
283284
role_separation: false
284285
```
285286

287+
## Discovered Tags
288+
289+
**_always_**
290+
291+
**_assert_ansible_oracle_**
286292

287293

288294
## Dependencies
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
- name: assert ansible-oracle variables
3+
tags:
4+
- always
5+
- assert_ansible_oracle
6+
block:
7+
- name: assert orasw_meta_cluster_hostgroup (GI enabled)
8+
when:
9+
- oracle_install_option_gi == 'CRS_CONFIG'
10+
block:
11+
- name: assert orasw_meta_cluster_hostgroup
12+
ansible.builtin.assert:
13+
quiet: true
14+
that:
15+
- orasw_meta_cluster_hostgroup | length > 0
16+
- orasw_meta_cluster_hostgroup in groups
17+
success_msg: >-
18+
orasw_meta_cluster_hostgroup: {{ orasw_meta_cluster_hostgroup }}

roles/orahost_meta/tasks/main.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,23 @@
11
---
2-
# Dummyfile for ansible-doctor
2+
- name: Import assert_cluster.yml
3+
ansible.builtin.import_tasks: assert_cluster.yml
4+
5+
# The state of fact is:
6+
# Single-Instance / Oracle Restart:
7+
# _orasw_meta_primary_node: true
8+
- name: Set fact for _orasw_meta_primary_node (non GI)
9+
ansible.builtin.set_fact:
10+
_orasw_meta_primary_node: true
11+
when:
12+
- oracle_install_option_gi != 'CRS_CONFIG'
13+
14+
# RAC:
15+
# 1st Node:
16+
# _orasw_meta_primary_node: true
17+
# other Nodes:
18+
# _orasw_meta_primary_node: false
19+
- name: Set fact for _orasw_meta_primary_node (GI)
20+
ansible.builtin.set_fact:
21+
_orasw_meta_primary_node: "{{ groups[orasw_meta_cluster_hostgroup][0] == inventory_hostname }}"
22+
when:
23+
- oracle_install_option_gi == 'CRS_CONFIG'

0 commit comments

Comments
 (0)