Skip to content

Commit

Permalink
minor fixes for role separation in Oracle Restart
Browse files Browse the repository at this point in the history
  • Loading branch information
Rendanic committed Feb 24, 2024
1 parent fc8682b commit abbb72f
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 13 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/role_sparation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- "minor fixes for role separation in Oracle Restart (oravirt#409)"
2 changes: 0 additions & 2 deletions roles/oraswgi_install/tasks/19.3.0.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
- patch_before_rootsh
- oracle_home_gi not in checkgiinstall.stdout
- oracle_install_version_gi is version(19, '>=')
vars:
oracle_user: "{{ grid_user }}"

- name: install_home_gi | Check for file GridSetup.sh
no_log: true
Expand Down
19 changes: 16 additions & 3 deletions roles/oraswgi_install/tasks/assert.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Oraswdb_install | Assert variables
- name: Oraswgi_install | Assert variables
ansible.builtin.assert:
quiet: true
that:
Expand All @@ -9,15 +9,28 @@
tags: always

# RAC is not supported at the moment!
- name: Oraswdb_install | Assert oracle_install_option_gi
- name: Oraswgi_install | Assert oracle_install_option_gi
ansible.builtin.assert:
quiet: true
that:
- oracle_install_option_gi in ('HA_CONFIG')
# - oracle_install_option_gi in ('HA_CONFIG', 'CRS_CONFIG')
tags: always

- name: Oraswdb_install | Assert Grid-Infrastructure variables
- name: Oraswgi_install | Assert role_separation
ansible.builtin.assert:
quiet: true
that:
- (role_separation and grid_user != oracle_user)
or
not role_separation
fail_msg: >-
Role separation is enabled.
Different values for grid_user={{ grid_user }}
and oracle_user={{ oracle_user }} needed.
tags: always

- name: Oraswgi_install | Assert Grid-Infrastructure variables
ansible.builtin.assert:
quiet: true
that:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: loop_remove_single_opatch | Get unique_patch_id from installed patch
ansible.builtin.command: "{{ oracle_home_gi }}/OPatch/opatch lspatches -oh {{ oracle_home_gi }} -id {{ gip_opatch.patchid }}"
become: true
become_user: "{{ oracle_user }}"
become_user: "{{ _grid_install_user }}"
changed_when: false
register: gihome_oneoff_res

Expand Down Expand Up @@ -33,4 +33,4 @@
output: verbose
state: "{{ gip_opatch.state }}"
become: true
become_user: "{{ oracle_user }}"
become_user: "{{ _grid_install_user }}"
2 changes: 1 addition & 1 deletion roles/oraswgi_manage_patches/tasks/loop_stage_patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- name: Loop_stage_patch | Become User to oracle
become: true
become_user: "{{ oracle_user }}"
become_user: "{{ _grid_install_user }}"
block:
- name: Loop_stage_patch | Copy oracle DB patch (opatch) to server
when:
Expand Down
4 changes: 2 additions & 2 deletions roles/oraswgi_manage_patches/tasks/post_install_patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: post_install_patch | Get list of current installed patches
ansible.builtin.command: "{{ oracle_home_gi }}/OPatch/opatch lspatches -oh {{ oracle_home_gi }}"
become: true
become_user: "{{ grid_user }}"
become_user: "{{ _grid_install_user }}"
changed_when: false
register: gihome_patches

Expand Down Expand Up @@ -116,7 +116,7 @@
- name: post_install_patch | Get new list of current installed patches
ansible.builtin.command: "{{ oracle_home_gi }}/OPatch/opatch lspatches -oh {{ oracle_home_gi }}"
become: true
become_user: "{{ oracle_user }}"
become_user: "{{ _grid_install_user }}"
changed_when: false
register: dbhome_patches
when:
Expand Down
2 changes: 1 addition & 1 deletion roles/oraswgi_manage_patches/tasks/roothas_postpatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ansible.builtin.stat:
path: "{{ oracle_home_gi }}/bin"
become: true
become_user: "{{ grid_user }}"
become_user: "{{ _grid_install_user }}"
register: oraclehomegi_stat

- name: roothas_postpatch | Execute roothas.sh -postpatch
Expand Down
2 changes: 1 addition & 1 deletion roles/oraswgi_manage_patches/tasks/roothas_prepatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ansible.builtin.stat:
path: "{{ oracle_home_gi }}/bin"
become: true
become_user: "{{ grid_user }}"
become_user: "{{ _grid_install_user }}"
register: oraclehomegi_stat

- name: roothas_prepatch | Execute roothas.sh -prepatch
Expand Down
5 changes: 4 additions & 1 deletion roles/oraswgi_meta/tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@

- name: Type of Installation
ansible.builtin.debug:
msg: "oracle_install_option_gi: {{ oracle_install_option_gi }}"
msg:
- "oracle_install_option_gi: {{ oracle_install_option_gi }}"
- "role_separation: {{ role_separation }}"
- "_grid_install_user: {{ _grid_install_user }} (internal variable. Use grid_user + role_separation in inventory.)"

- name: Assert Variables for Restart/Grid Infrastructure Setup
ansible.builtin.assert:
Expand Down

0 comments on commit abbb72f

Please sign in to comment.