deploy/ansible/roles-sap-os/2.6-sap-mounts/tasks/2.6.3-oracle-multi-sid.yaml [4:68]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---

# Create Run Flag Directory
- name:                                "2.6 SAP Mounts (Oracle shared home) : Create run flag directory"
  become:                              true
  become_user:                         root
  ansible.builtin.file:
    path:                              /etc/sap_deployment_automation
    state:                             directory
    mode:                              0755
    owner:                             oracle
    group:                             oinstall

- name:                                "2.6 SAP Mounts (Oracle shared home): - Gather Logical volumes created in 1.5.2-disk-setup-ora-multi-sid"
  ansible.builtin.include_vars:        disks_config_ora_msid.yml

- name:                                "2.6 SAP Mounts (Oracle shared home): - Load logical volumes"
  ansible.builtin.set_fact:
    logical_volume_groups: "{{ lookup('template', '../../roles-os/1.5.2-disk-setup-ora-multi-sid/templates/logical_volume_group.j2') }}"

- name:                                "2.6 SAP Mounts (Oracle shared home): Check if LVs exists."
  ansible.builtin.stat:
    path:                              "{{ dev_path_from_lv_item }}"
  loop:                                "{{ logical_volume_groups }}"
  register:                             oravgstat

- name:                                "2.6 SAP Mounts (Oracle shared home): Mount LVs"
  ansible.builtin.debug:
    var:                               oravgstat
    verbosity:                         2

- name:                                "2.6 SAP Mounts (Oracle shared home): Gather existing LVs"
  ansible.builtin.set_fact:
    lvexists: "{{ oravgstat.results | selectattr('stat.exists', 'equalto', true) | map(attribute='item.lv') | list }}"

- name:                                "2.6 SAP Mounts (Oracle shared home): debug"
  ansible.builtin.debug:
    var:                               lvexists
    verbosity:                         2

# Mount Oracle File System before mounting the sub-directories.
- name:                                "2.6 SAP Mounts (Oracle shared home): Mount oracle Filesystem"
  become:                              true
  become_user:                         root
  ansible.posix.mount:
    src:                               "{{ item.src }}"
    path:                              "{{ item.path }}"
    fstype:                            "{{ item.type }}"
    opts:                              defaults
    state:                             mounted
  loop:
    - { node_tier: 'oracle-multi-sid', type: 'xfs', src: '/dev/vg_oracle/lv_oracle', path: '/oracle'  }
    - { node_tier: 'oracle-multi-sid', type: 'xfs', src: '/dev/vg_sap/lv_usrsap',    path: '/usr/sap' }
  when:
    - item.node_tier == "oracle-multi-sid"

# Mount File systems
- name:                                "2.6 SAP Mounts (Oracle shared home): Mount File systems for Oracle"
  become:                              true
  become_user:                         root
  ansible.posix.mount:
    src:                               "{{ dev_path_from_lv_item }}"
    # path:   "{{ ['/'~item.lv | split('_')[-2], anydb_sid | upper, item.lv | split('_')[-1]] | join('/') }}"
    path: >-
        {%- set lv_parts = item.lv.split('_') -%}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



deploy/ansible/roles-sap-os/2.6-sap-mounts/tasks/2.6.5-oracle-multi-sid.yaml [4:68]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---

# Create Run Flag Directory
- name:                                "2.6 SAP Mounts (Oracle shared home) : Create run flag directory"
  become:                              true
  become_user:                         root
  ansible.builtin.file:
    path:                              /etc/sap_deployment_automation
    state:                             directory
    mode:                              0755
    owner:                             oracle
    group:                             oinstall

- name:                                "2.6 SAP Mounts (Oracle shared home): - Gather Logical volumes created in 1.5.2-disk-setup-ora-multi-sid"
  ansible.builtin.include_vars:                        disks_config_ora_msid.yml

- name:                                "2.6 SAP Mounts (Oracle shared home): - Load logical volumes"
  ansible.builtin.set_fact:
    logical_volume_groups: "{{ lookup('template', '../../roles-os/1.5.2-disk-setup-ora-multi-sid/templates/logical_volume_group.j2') }}"

- name:                                "2.6 SAP Mounts (Oracle shared home): Check if LVs exists."
  ansible.builtin.stat:
    path:                              "{{ dev_path_from_lv_item }}"
  loop:                                "{{ logical_volume_groups }}"
  register:                             oravgstat

- name:                                "2.6 SAP Mounts (Oracle shared home): Mount LVs"
  ansible.builtin.debug:
    var:                               oravgstat
    verbosity:                         2

- name:                                "2.6 SAP Mounts (Oracle shared home): Gather existing LVs"
  ansible.builtin.set_fact:
    lvexists: "{{ oravgstat.results | selectattr('stat.exists', 'equalto', true) | map(attribute='item.lv') | list }}"

- name:                                "2.6 SAP Mounts (Oracle shared home): debug"
  ansible.builtin.debug:
    var:                               lvexists
    verbosity:                         2

# Mount Oracle File System before mounting the sub-directories.
- name:                                "2.6 SAP Mounts (Oracle shared home): Mount oracle Filesystem"
  become:                              true
  become_user:                         root
  ansible.posix.mount:
    src:                               "{{ item.src }}"
    path:                              "{{ item.path }}"
    fstype:                            "{{ item.type }}"
    opts:                              defaults
    state:                             mounted
  loop:
    - { node_tier: 'oracle-multi-sid',  type: 'xfs',   src: '/dev/vg_oracle/lv_oracle',      path: '/oracle'         }
    - { node_tier: 'oracle-multi-sid',  type: 'xfs',   src: '/dev/vg_sap/lv_usrsap',      path: '/usr/sap'         }
  when:
    - item.node_tier == "oracle-multi-sid"

# Mount File systems
- name:                                "2.6 SAP Mounts (Oracle shared home): Mount File systems for Oracle"
  become:                              true
  become_user:                         root
  ansible.posix.mount:
    src:                               "{{ dev_path_from_lv_item }}"
    # path:   "{{ ['/'~item.lv|split('_')[-2], anydb_sid|upper, item.lv|split('_')[-1]] | join('/') }}"
    path: >-
        {%- set lv_parts = item.lv.split('_') -%}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



