Skip to content

Commit

Permalink
sap_hana_preconfigure: perform necessary assert changes
Browse files Browse the repository at this point in the history
Relates to issue sap-linuxlab#813.

Signed-off-by: Bernd Finger <[email protected]>
  • Loading branch information
berndfinger committed Jul 19, 2024
1 parent 64ff781 commit f7b02e5
Showing 1 changed file with 9 additions and 9 deletions.
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)

0 comments on commit f7b02e5

Please sign in to comment.