Skip to content

Commit

Permalink
Merge pull request #816 from berndfinger/issue-813-netapp-sap-note-30…
Browse files Browse the repository at this point in the history
…24346-v10

sap_hana_preconfigure/RHEL/NetApp: Sync with SAP note 3024346 v.10
  • Loading branch information
berndfinger authored Jul 19, 2024
2 parents 48031f0 + 71cbdc1 commit d42e442
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 37 deletions.
7 changes: 0 additions & 7 deletions roles/sap_hana_preconfigure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,6 @@ Network related linux kernel parameter settings for platform ppc64le.<br>

Set to `true` to also set NetApp NFS required kernel parameters.<br>

### 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,<br>
this parameter must be set to `true` as well.<br>

### sap_hana_preconfigure_install_ibm_power_tools
- _Type:_ `bool`
- _Default:_ `true`
Expand Down
4 changes: 0 additions & 4 deletions roles/sap_hana_preconfigure/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 0 additions & 8 deletions roles/sap_hana_preconfigure/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 18 additions & 3 deletions roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand All @@ -50,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
18 changes: 9 additions & 9 deletions roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,43 +43,43 @@
- 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!"
success_msg: "PASS: File /etc/modprobe.d/sunrpc.conf is a regular file."
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
Expand All @@ -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)
4 changes: 2 additions & 2 deletions roles/sap_hana_preconfigure/vars/RedHat_7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}"

Expand Down
4 changes: 2 additions & 2 deletions roles/sap_hana_preconfigure/vars/RedHat_8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}"

Expand Down
4 changes: 2 additions & 2 deletions roles/sap_hana_preconfigure/vars/RedHat_9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}"

Expand Down

0 comments on commit d42e442

Please sign in to comment.