Skip to content

Commit 0b24a3c

Browse files
author
Csaba Daradics
committed
Create mechanism to be able to add custom mount options to AFS shares
Applies to /sapmnt/<SID> and /hana/shared in HA/non-HA deployments
1 parent cb85f3b commit 0b24a3c

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

deploy/ansible/roles-sap-os/2.6-sap-mounts/tasks/2.6.0-afs-mounts.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
- name: "AFS Mount: Set the NFSmount options"
3535
ansible.builtin.set_fact:
3636
afs_mnt_options: 'noresvport,vers=4,minorversion=1,sec=sys'
37+
when: afs_mnt_options is not defined
3738

3839
- name: "AFS Mount: Create list of all_sap_mounts to support"
3940
ansible.builtin.debug:
@@ -427,7 +428,7 @@
427428
'type': 'shared',
428429
'temppath': 'shared',
429430
'mount': "{% if site | default('SITE1') == 'SITE1' %}{{ hana_shared_mountpoint[0] }}{% else %}{{ hana_shared_mountpoint[1] }}{% endif %}",
430-
'opts': 'vers=4,minorversion=1,sec=sys',
431+
'opts': '{{ afs_mnt_options }}{{ "," ~ afs_mnt_extra_options if afs_mnt_extra_options is defined }}',
431432
'path': '/hana/shared',
432433
'owner': '{{ sidadm_uid }}',
433434
'permissions': '0775',
@@ -450,7 +451,7 @@
450451
'type': 'shared',
451452
'temppath': 'shared',
452453
'mount': "{{ hana_shared_mountpoint[0] }}",
453-
'opts': 'vers=4,minorversion=1,sec=sys',
454+
'opts': '{{ afs_mnt_options }}{{ "," ~ afs_mnt_extra_options if afs_mnt_extra_options is defined }}',
454455
'path': '/hana/shared',
455456
'owner': '{{ sidadm_uid }}',
456457
'permissions': '0775',

deploy/ansible/roles-sap/5.8-hanadb-scaleout-pacemaker/tasks/5.8.4.0-clusterPrep-ScaleOut-RedHat.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# We set this to prevent code overflow. Since pacemaker code for both AFS and ANF are the same barring NFS mount options, we parameterize this parameter.
1919
- name: "5.8 HANA Pacemaker Scaleout - NFS Compatibility - set mount options based on NFS source"
2020
ansible.builtin.set_fact:
21-
nfs_mount_options: "{% if NFS_provider == 'ANF' %}defaults,rw,hard,rsize=262144,wsize=262144,proto=tcp,noatime,_netdev,nfsvers=4.1,lock,sec=sys{% else %}noresvport,defaults,rw,hard,proto=tcp,noatime,nfsvers=4.1,lock{% endif %}"
21+
nfs_mount_options: "{% if NFS_provider == 'ANF' %}defaults,rw,hard,rsize=262144,wsize=262144,proto=tcp,noatime,_netdev,nfsvers=4.1,lock,sec=sys{% else %}noresvport,defaults,rw,hard,proto=tcp,noatime,nfsvers=4.1,lock{% if afs_mnt_options is defined and 'nodev,nosuid' in afs_mnt_options %},nodev,nosuid{% endif %}{% endif %}"
2222
directory_path: "{% if NFS_provider == 'ANF' %}/shared{% else %}{% endif %}"
2323

2424
# Ref : https://learn.microsoft.com/en-us/azure/sap/workloads/sap-hana-high-availability-scale-out-hsr-rhel?tabs=lb-portal#create-file-system-resources

0 commit comments

Comments
 (0)