From 6b962bf779d5c7b46393a4f511167ce06ccc5007 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 19 Jul 2024 11:36:23 +0200 Subject: [PATCH 1/4] sap_hana_preconfigure: Ensure the absence of two NetApp NFS parameters ... in file __sap_hana_preconfigure_etc_sysctl_saphana_conf. Solves issue #814. Signed-off-by: Bernd Finger --- .../tasks/sapnote/3024346.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index 765b9316..a63bcb25 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -25,6 +25,22 @@ loop_control: loop_var: line_item +# Due to sysctl config file precedence rules, it can happen that previous entries in +# __sap_hana_preconfigure_etc_sysctl_saphana_conf remain in effect even after setting +# different parameter values in __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf. +# So we have to ensure that those duplicate entries are not present. +# See also https://github.com/sap-linuxlab/community.sap_install/issues/196. + - name: Ensure kernel tunables for NetApp NFS are not in file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' + ansible.builtin.lineinfile: + path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" + regexp: ^{{ line_item }} + state: absent + with_items: + - 'net.core.wmem_max' + - 'net.core.rmem_max' + loop_control: + loop_var: line_item + # Note: The sole purpose of the following two tasks is to collect the current value(s) of the kernel parameters # in __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf so that the "Reload kernel parameters from file ..." task # can correctly report its 'changed' state. See also https://github.com/sap-linuxlab/community.sap_install/issues/752 . From 64ff78179290a50012331c4a27e87624cc99ede2 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 19 Jul 2024 12:10:15 +0200 Subject: [PATCH 2/4] sap_hana_preconfigure: modify version string for SAP note 3024346 Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/README.md | 7 ------- roles/sap_hana_preconfigure/defaults/main.yml | 4 ---- roles/sap_hana_preconfigure/meta/argument_specs.yml | 8 -------- roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml | 5 ++--- roles/sap_hana_preconfigure/vars/RedHat_7.yml | 4 ++-- roles/sap_hana_preconfigure/vars/RedHat_8.yml | 4 ++-- roles/sap_hana_preconfigure/vars/RedHat_9.yml | 4 ++-- 7 files changed, 8 insertions(+), 28 deletions(-) diff --git a/roles/sap_hana_preconfigure/README.md b/roles/sap_hana_preconfigure/README.md index 6ee18a68..4459ca65 100644 --- a/roles/sap_hana_preconfigure/README.md +++ b/roles/sap_hana_preconfigure/README.md @@ -326,13 +326,6 @@ Network related linux kernel parameter settings for platform ppc64le.
Set to `true` to also set NetApp NFS required kernel parameters.
-### sap_hana_preconfigure_use_netapp_settings_nfsv3 -- _Type:_ `bool` -- _Default:_ `false` - -If `sap_hana_preconfigure_use_netapp_settings_nfs` is set to `true` and NFS Version 3 is to be used,
-this parameter must be set to `true` as well.
- ### sap_hana_preconfigure_install_ibm_power_tools - _Type:_ `bool` - _Default:_ `true` diff --git a/roles/sap_hana_preconfigure/defaults/main.yml b/roles/sap_hana_preconfigure/defaults/main.yml index de9bb3ef..741fed62 100644 --- a/roles/sap_hana_preconfigure/defaults/main.yml +++ b/roles/sap_hana_preconfigure/defaults/main.yml @@ -130,10 +130,6 @@ sap_hana_preconfigure_kernel_parameters_ppc64le: "{{ __sap_hana_preconfigure_ker sap_hana_preconfigure_use_netapp_settings_nfs: false # Set to `true` to also set NetApp NFS required kernel parameters. -sap_hana_preconfigure_use_netapp_settings_nfsv3: false -# If `sap_hana_preconfigure_use_netapp_settings_nfs` is set to `true` and NFS Version 3 is to be used, -# this parameter must be set to `true` as well. - sap_hana_preconfigure_install_ibm_power_tools: true # Set this parameter to `false` to not install the IBM Power Systems service and productivity tools. diff --git a/roles/sap_hana_preconfigure/meta/argument_specs.yml b/roles/sap_hana_preconfigure/meta/argument_specs.yml index 1d3427b7..159ed5df 100644 --- a/roles/sap_hana_preconfigure/meta/argument_specs.yml +++ b/roles/sap_hana_preconfigure/meta/argument_specs.yml @@ -273,14 +273,6 @@ argument_specs: required: false type: bool - sap_hana_preconfigure_use_netapp_settings_nfsv3: - default: false - description: - - If `sap_hana_preconfigure_use_netapp_settings_nfs` is set to `true` and NFS Version 3 is to be used, - - this parameter must be set to `true` as well. - required: false - type: bool - sap_hana_preconfigure_install_ibm_power_tools: default: true description: diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index a63bcb25..966eb1ff 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -66,11 +66,10 @@ ansible.builtin.debug: var: __sap_hana_preconfigure_register_netapp_sysctl_p_output_new.stdout_lines - - name: Set kernel tunable for NFSv3 as per SAP note 3024346 + - name: Set kernel tunable 'tcp_max_slot_table_entries' to '128' in file '/etc/modprobe.d/sunrpc.conf' ansible.builtin.lineinfile: path: /etc/modprobe.d/sunrpc.conf - create: yes + create: true mode: 0644 regexp: '^options sunrpc tcp_max_slot_table_entries' line: options sunrpc tcp_max_slot_table_entries=128 - when: sap_hana_preconfigure_use_netapp_settings_nfsv3 diff --git a/roles/sap_hana_preconfigure/vars/RedHat_7.yml b/roles/sap_hana_preconfigure/vars/RedHat_7.yml index ba44937f..e1c09763 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_7.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_7.yml @@ -45,14 +45,14 @@ __sap_hana_preconfigure_sapnotes_versions_x86_64: - { number: '2009879', version: '28' } - { number: '2292690', version: '38' } - { number: '2382421', version: '40' } - - { number: '3024346', version: '3' } + - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2009879', version: '28' } - { number: '2055470', version: '85' } - { number: '2292690', version: '38' } - { number: '2382421', version: '40' } - - { number: '3024346', version: '3' } + - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" diff --git a/roles/sap_hana_preconfigure/vars/RedHat_8.yml b/roles/sap_hana_preconfigure/vars/RedHat_8.yml index d040ea03..432848f1 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_8.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_8.yml @@ -125,13 +125,13 @@ __sap_hana_preconfigure_req_repos_redhat_8_10_ppc64le: __sap_hana_preconfigure_sapnotes_versions_x86_64: - { number: '2777782', version: '40' } - { number: '2382421', version: '40' } - - { number: '3024346', version: '3' } + - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2055470', version: '87' } - { number: '2777782', version: '40' } - { number: '2382421', version: '40' } - - { number: '3024346', version: '3' } + - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" diff --git a/roles/sap_hana_preconfigure/vars/RedHat_9.yml b/roles/sap_hana_preconfigure/vars/RedHat_9.yml index 8c3b476b..ebc31864 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_9.yml @@ -122,13 +122,13 @@ __sap_hana_preconfigure_req_repos_redhat_9_10_ppc64le: __sap_hana_preconfigure_sapnotes_versions_x86_64: - { number: '3108302', version: '9' } - { number: '2382421', version: '45' } - - { number: '3024346', version: '3' } + - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2055470', version: '90' } - { number: '3108302', version: '9' } - { number: '2382421', version: '45' } - - { number: '3024346', version: '3' } + - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" From f7b02e5f769e4c0c53475c1d1d9439b6d301d193 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 19 Jul 2024 14:05:35 +0200 Subject: [PATCH 3/4] sap_hana_preconfigure: perform necessary assert changes Relates to issue #813. Signed-off-by: Bernd Finger --- .../tasks/sapnote/assert-3024346.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml index 62ea1934..7dcbd7b6 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml @@ -43,25 +43,25 @@ - sap_hana_preconfigure_use_netapp_settings_nfs | d(false) - sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_3024346 | d(false) -- name: Check NetApp modprobe conf file for SAP HANA with NFSv3 +- name: Check NetApp modprobe conf file for SAP HANA when: - - sap_hana_preconfigure_use_netapp_settings_nfsv3 | d(false) + - sap_hana_preconfigure_use_netapp_settings_nfs | d(false) - sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_3024346 | d(false) block: - - name: Get info about file /etc/modprobe.d/sunrpc.conf + - name: Get info about file '/etc/modprobe.d/sunrpc.conf' ansible.builtin.stat: path: /etc/modprobe.d/sunrpc.conf register: __sap_hana_preconfigure_register_etc_modprobe_sunrpc_conf_assert - - name: Assert that file /etc/modprobe.d/sunrpc.conf exists + - name: Assert that file '/etc/modprobe.d/sunrpc.conf' exists ansible.builtin.assert: that: __sap_hana_preconfigure_register_etc_modprobe_sunrpc_conf_assert.stat.exists fail_msg: "FAIL: File /etc/modprobe.d/sunrpc.conf does not exist!" success_msg: "PASS: File /etc/modprobe.d/sunrpc.conf exists." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" - - name: Assert that file /etc/modprobe.d/sunrpc.conf is a regular file + - name: Assert that file '/etc/modprobe.d/sunrpc.conf' is a regular file ansible.builtin.assert: that: __sap_hana_preconfigure_register_etc_modprobe_sunrpc_conf_assert.stat.isreg fail_msg: "FAIL: File /etc/modprobe.d/sunrpc.conf is not a regular file!" @@ -69,17 +69,17 @@ ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" when: __sap_hana_preconfigure_register_etc_modprobe_sunrpc_conf_assert.stat.exists -- name: Get value of 'options sunrpc tcp_max_slot_table_entries' from /etc/modprobe.d/sunrpc.conf +- name: Get value of 'options sunrpc tcp_max_slot_table_entries' from '/etc/modprobe.d/sunrpc.conf' ansible.builtin.command: awk 'BEGIN{FS="="}/options sunrpc tcp_max_slot_table_entries/{print $NF}' /etc/modprobe.d/sunrpc.conf register: __sap_hana_preconfigure_register_tcp_max_slot_table_entries_assert changed_when: no ignore_errors: yes when: - - sap_hana_preconfigure_use_netapp_settings_nfsv3 | d(false) + - sap_hana_preconfigure_use_netapp_settings_nfs | d(false) - __sap_hana_preconfigure_register_etc_modprobe_sunrpc_conf_assert.stat.exists - sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_3024346 | d(false) -- name: Assert that 'options sunrpc tcp_max_slot_table_entries' is set correctly in /etc/modprobe.d/sunrpc.conf +- name: Assert that 'options sunrpc tcp_max_slot_table_entries' is set correctly in '/etc/modprobe.d/sunrpc.conf' ansible.builtin.assert: that: __sap_hana_preconfigure_register_tcp_max_slot_table_entries_assert.stdout == '128' fail_msg: "FAIL: The value of 'options sunrpc tcp_max_slot_table_entries' in '/etc/modprobe.d/sunrpc.conf' is @@ -88,6 +88,6 @@ '{{ __sap_hana_preconfigure_register_tcp_max_slot_table_entries_assert.stdout }}'." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" when: - - sap_hana_preconfigure_use_netapp_settings_nfsv3 | d(false) + - sap_hana_preconfigure_use_netapp_settings_nfs | d(false) - __sap_hana_preconfigure_register_etc_modprobe_sunrpc_conf_assert.stat.exists - sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_3024346 | d(false) From 82cb8cf0b49fe45a215a06c796cbfa329c460cd4 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 19 Jul 2024 16:54:33 +0200 Subject: [PATCH 4/4] sap_hana_preconfigure: Resolve merge conflict after PR #811 Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index 966eb1ff..44b7daef 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -70,6 +70,6 @@ ansible.builtin.lineinfile: path: /etc/modprobe.d/sunrpc.conf create: true - mode: 0644 + mode: "0644" regexp: '^options sunrpc tcp_max_slot_table_entries' line: options sunrpc tcp_max_slot_table_entries=128