deploy/ansible/roles-sap-os/2.6-sap-mounts/tasks/2.6.1-anf-mounts.yaml [242:303]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - name:                            "ANF Mount: Remove SAP Directories (ANF)"
      ansible.builtin.file:
        path:                          "/saptmp/sapmnt{{ item.sid | upper }}"
        state:                         absent
      loop:                            "{{ MULTI_SIDS }}"
      when:                            MULTI_SIDS is defined

    - name:                            "ANF Mount: Cleanup fstab and directory (sap_mnt)"
      ansible.posix.mount:
        src:                           "{{ sap_mnt }}"
        path:                          "/saptmp"
        fstype:                        "nfs4"
        opts:                          "rw,hard,rsize=65536,wsize=65536,sec=sys,vers=4.1,tcp"
        state:                         absent

  when:
    - tier == 'sapos'
    - "'scs' in supported_tiers"
    - sap_mnt is defined

# /*---------------------------------------------------------------------------8
# |                                                                            |
# |                Perform the sap_mnt mounts                                  |
# |                Create directories and make them immutable                  |
# |                                                                            |
# +------------------------------------4--------------------------------------*/

- name:                                "ANF Mount: Create SAP Directories (sapmnt)"
  ansible.builtin.file:
    owner:                             "{{ item.sidadm_uid }}"
    group:                             sapsys
    mode:                              0755
    path:                              "/sapmnt/{{ item.sid }}"
    state:                             directory
  register: is_created_now
  loop:                                "{{ all_sap_mounts }}"
  when:
    - tier == 'sapos'
    - node_tier in ['app','scs','ers', 'pas'] or 'scs' in supported_tiers
    - sap_mnt is defined

- name:                                "ANF Mount: Change attribute only when we create SAP Directories (sap_mnt)"
  ansible.builtin.file:
    path:                              "{{ item.item.path }}"
    state:                             directory
    mode:                              0755
    attr:                              i+
  loop: "{{ is_created_now.results }}"
  when:
    - tier == 'sapos'
    - item.item is changed
  register: set_immutable_attribute

- name:                                "ANF Mount: Create SAP Directories (scs & ers)"
  ansible.builtin.file:
    path:                              "{{ item.path }}"
    state:                             directory
    owner:                             '{{ sidadm_uid }}'
    group:                             sapsys
    mode:                              0755
  loop:
    - { path: '/usr/sap/{{ sap_sid | upper }}' }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



deploy/ansible/roles-sap-os/2.6-sap-mounts/tasks/2.6.8-anf-mounts-simplemount.yaml [233:294]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - name:                            "ANF Mount: Remove SAP Directories (ANF)"
      ansible.builtin.file:
        path:                          "/saptmp/sapmnt{{ item.sid | upper }}"
        state:                         absent
      loop:                            "{{ MULTI_SIDS }}"
      when:                            MULTI_SIDS is defined

    - name:                            "ANF Mount: Cleanup fstab and directory (sap_mnt)"
      ansible.posix.mount:
        src:                           "{{ sap_mnt }}"
        path:                          "/saptmp"
        fstype:                        "nfs4"
        opts:                          "rw,hard,rsize=65536,wsize=65536,sec=sys,vers=4.1,tcp"
        state:                         absent

  when:
    - tier == 'sapos'
    - "'scs' in supported_tiers"
    - sap_mnt is defined

# /*---------------------------------------------------------------------------8
# |                                                                            |
# |                Perform the sap_mnt mounts                                  |
# |                Create directories and make them immutable                  |
# |                                                                            |
# +------------------------------------4--------------------------------------*/

- name:                                "ANF Mount: Create SAP Directories (sapmnt)"
  ansible.builtin.file:
    owner:                             "{{ item.sidadm_uid }}"
    group:                             sapsys
    mode:                              0755
    path:                              "/sapmnt/{{ item.sid }}"
    state:                             directory
  register: is_created_now
  loop:                                "{{ all_sap_mounts }}"
  when:
    - tier == 'sapos'
    - node_tier in ['app','scs','ers', 'pas'] or 'scs' in supported_tiers
    - sap_mnt is defined

- name:                                "ANF Mount: Change attribute only when we create SAP Directories (sap_mnt)"
  ansible.builtin.file:
    path:                              "{{ item.item.path }}"
    state:                             directory
    mode:                              0755
    attr:                              i+
  loop: "{{ is_created_now.results }}"
  when:
    - tier == 'sapos'
    - item.item is changed
  register: set_immutable_attribute

- name:                                "ANF Mount: Create SAP Directories (scs & ers)"
  ansible.builtin.file:
    path:                              "{{ item.path }}"
    state:                             directory
    owner:                             '{{ sidadm_uid }}'
    group:                             sapsys
    mode:                              0755
  loop:
    - { path: '/usr/sap/{{ sap_sid | upper }}' }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



