Skip to content

Commit

Permalink
Merge pull request oravirt#269 from Rendanic/prnfs
Browse files Browse the repository at this point in the history
Changes for NFS installation media
  • Loading branch information
Rendanic authored Sep 16, 2022
2 parents 3fe2d85 + 3d8bcc9 commit b88fc4e
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 47 deletions.
4 changes: 4 additions & 0 deletions changelogs/fragments/269-nfs-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- "orasw_meta: added tasks/mount_stage_remote.yml (#269)"
- "orasw_meta: added tasks/umount_stage_remote.yml (#269)"
6 changes: 6 additions & 0 deletions inventory/dbfs/group_vars/all/software_src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ oracle_sw_unpack: false

# Directory for Installation-Media
oracle_stage_remote: /tmp

# Example for Remote NFS
# install_from_nfs: true # Mount NFS-Share?
# nfs_server_sw: 192.168.56.99 # NFS-Server
# nfs_server_sw_path: /sw # NFS-Share
# oracle_stage_remote: /u01/se # local mount point for NFS share
2 changes: 2 additions & 0 deletions roles/orasw_meta/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
install_from_nfs: false

oracle_user: oracle # User that will own the Oracle Installations.
grid_user: grid
grid_install_user: "{% if role_separation %}{{ grid_user }}{% else %}{{ oracle_user }}{% endif %}"
Expand Down
11 changes: 11 additions & 0 deletions roles/orasw_meta/tasks/mount_stage_remote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Do not mount installation media during boot!
- name: orasw_meta | Mount nfs share with installation media
ansible.builtin.mount:
src: "{{ nfs_server_sw }}:{{ nfs_server_sw_path }}"
name: "{{ oracle_stage_remote }}"
fstype: nfs
state: mounted
when: install_from_nfs
tags:
- nfsmountdb
13 changes: 13 additions & 0 deletions roles/orasw_meta/tasks/umount_stage_remote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
# Try to umount and ignore_errors
- name: orasw_meta | Umount nfs share with installation media
ansible.builtin.mount:
src: "{{ nfs_server_sw }}:{{ nfs_server_sw_path }}"
name: "{{ oracle_stage_remote }}"
fstype: nfs
state: absent
# noqa ignore-errors
ignore_errors: true
when: install_from_nfs
tags:
- nfsumountdb
45 changes: 7 additions & 38 deletions roles/oraswdb_install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
- assert

- name: install_home_db | Mount nfs share with installation media
ansible.builtin.mount: src="{{ nfs_server_sw }}:{{ nfs_server_sw_path }}" name={{ oracle_stage_remote }} fstype=nfs state=mounted
when: install_from_nfs
ansible.builtin.include_role:
name: orasw_meta
tasks_from: mount_stage_remote
tags:
- nfsmountdb

Expand Down Expand Up @@ -70,39 +71,6 @@
tags:
- oradbsw

#
# - name: install_home_db | Extract files to stage-area
# unarchive:
# src={{ oracle_stage }}/{{ item[0].filename }}
# dest={{ oracle_stage }}/{{ item[0].version }}
# copy=no
# creates="{{ oracle_stage }}/{{ item[0].version }}/{{ item[0].creates }}"
# with_nested:
# - "{{ oracle_sw_image_db }}"
# - "{{ db_homes_installed }}"
# become: true
# become_user: "{{ oracle_user }}"
# run_once: "{{ configure_cluster }}"
# when: item[0].version == db_homes_config[item[1].home]['version'] and item[1].state|lower == 'present' and oracle_sw_copy and oracle_sw_unpack
# tags:
# - oradbswunpack
#
# - name: install_home_db | Extract files to stage-area (from remote location)
# unarchive:
# src={{ oracle_stage_remote }}/{{ item[0].filename }}
# dest={{ oracle_stage }}/{{ item[0].version }}
# copy=no
# creates="{{ oracle_stage }}/{{ item[0].version }}/{{ item[0].creates }}"
# with_nested:
# - "{{ oracle_sw_image_db }}"
# - "{{ db_homes_installed }}"
# become: true
# become_user: "{{ oracle_user }}"
# run_once: "{{ configure_cluster }}"
# when: item[0].version == db_homes_config[item[1].home]['version'] and item[1].state|lower == 'present' and not oracle_sw_copy and oracle_sw_unpack
# tags:
# - oradbswunpack

- ansible.builtin.include_tasks: install-home-db.yml
with_items:
- "{{ db_homes_installed }}"
Expand All @@ -112,10 +80,11 @@
tags: oradbinstall,dbchopt

- name: install_home_db | Unmount nfs share with installation media
ansible.builtin.mount: src="{{ nfs_server_sw }}:{{ nfs_server_sw_path }}" name={{ oracle_stage_remote }} fstype=nfs state=absent
when: install_from_nfs
ansible.builtin.include_role:
name: orasw_meta
tasks_from: umount_stage_remote
tags:
- nfsunmountdb
- nfsumountdb

- name: install_home_db | copy start/stop script for autostart
ansible.builtin.copy:
Expand Down
14 changes: 11 additions & 3 deletions roles/oraswdb_manage_patches/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
ansible.builtin.stat: path=/etc/oracle/olr.loc
register: olrloc

- name: install_home_db | Mount nfs share with installation media
ansible.builtin.mount: src="{{ nfs_server_sw }}:{{ nfs_server_sw_path }}" name={{ oracle_stage_remote }} fstype=nfs state=mounted
when: install_from_nfs
- name: db_opatch | Mount nfs share with installation media
ansible.builtin.include_role:
name: orasw_meta
tasks_from: mount_stage_remote
tags:
- nfsmountdb

Expand All @@ -29,3 +30,10 @@
loop_var: dbh
when: db_homes_installed is defined and dbh.state == 'present' and dbh.apply_patches |default (False) and apply_patches_db
tags: autopatch

- name: db_opatch | Unmount nfs share with installation media
ansible.builtin.include_role:
name: orasw_meta
tasks_from: umount_stage_remote
tags:
- nfsumountdb
15 changes: 9 additions & 6 deletions roles/oraswgi_install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
- patch_before_rootsh

- name: install_home_gi | Mount nfs share with installation media
ansible.builtin.mount: src="{{ nfs_server_sw }}:{{ nfs_server_sw_path }}" name={{ oracle_stage_remote }} fstype=nfs state=mounted
ansible.builtin.include_role:
name: orasw_meta
tasks_from: mount_stage_remote
tags:
- nfsmountgi
when: install_from_nfs
- nfsmountdb

- name: install_home_gi | Add new dotprofile (GI)
ansible.builtin.template:
Expand Down Expand Up @@ -156,6 +157,8 @@
- olsnodes

- name: install_home_gi | Unmount nfs share with installation media
ansible.builtin.mount: src="{{ nfs_server_sw }}:{{ nfs_server_sw_path }}" name={{ oracle_stage_remote }} fstype=nfs state=absent
when: install_from_nfs
tags: nfsunmountgi
ansible.builtin.include_role:
name: orasw_meta
tasks_from: umount_stage_remote
tags:
- nfsumountdb

0 comments on commit b88fc4e

Please sign in to comment.