From 937574ec67c2adff1ba86dab80e0a6985a95cb65 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 10:01:13 +0200 Subject: [PATCH 01/11] sap_hana_preconfigure: add task change validation, task #1 The task "Reload kernel parameters from file /etc/sysctl.d/sap_hana.conf" now recognizes a parameter change. Relates to #752. Signed-off-by: Bernd Finger --- .../tasks/sapnote/2382421.yml | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml index b9f0985d6..7272c5e0a 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml @@ -11,7 +11,7 @@ when: sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_2382421 | d(false) block: - - name: Modify entries in file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' + - name: Ensure correct entries in file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' ansible.builtin.lineinfile: path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" create: yes @@ -67,11 +67,21 @@ line: "net.core.rmem_max={{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem.stdout.split()[-1] }}" state: present -# Reason for noqa: We unconditionally reload the kernel parameters without first checking the current values - - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' # noqa no-changed-when + - name: Construct the command for getting all current parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' + ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" + register: __sap_hana_preconfigure_register_saphana_conf_sysctl_command + changed_when: false + + - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' + ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_saphana_conf_sysctl_command.stdout }}" + register: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output_old + changed_when: false + + - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' ansible.builtin.command: sysctl -p "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" - register: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output + register: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output_new + changed_when: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output_old.stdout != __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output_new.stdout - name: Display kernel parameters for network tuning ansible.builtin.debug: - var: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output.stdout_lines + var: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output_new.stdout_lines From 6b08367d7c48251f41e0e7b2879ba00cd8e83f00 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 10:11:30 +0200 Subject: [PATCH 02/11] sap_hana_preconfigure: add task change validation, task #2 The task "Reload kernel parameters from file /etc/sysctl.d/91-NetApp-HANA.conf" now recognizes a parameter change. Relates to #752. Signed-off-by: Bernd Finger --- .../tasks/sapnote/3024346.yml | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index 9055a84f4..f399634c8 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -13,7 +13,7 @@ - sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_3024346|d(false) block: - - name: Modify entries in file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' + - name: Ensure correct entries in file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' ansible.builtin.lineinfile: path: "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" create: yes @@ -25,14 +25,24 @@ loop_control: loop_var: line_item -# Reason for noqa: We unconditionally reload the kernel parameters without first checking the current values - - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' # noqa no-changed-when + - name: Construct the command for getting all current parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' + ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" + register: __sap_hana_preconfigure_register_netapp_sysctl_command + changed_when: false + + - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' + ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_netapp_sysctl_command.stdout }} | sed 's,\t, ,g'" + register: __sap_hana_preconfigure_register_netapp_sysctl_p_output_old + changed_when: false + + - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' ansible.builtin.command: sysctl -p "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" - register: __sap_hana_preconfigure_register_netapp_sysctl_p_output + register: __sap_hana_preconfigure_register_netapp_sysctl_p_output_new + changed_when: __sap_hana_preconfigure_register_netapp_sysctl_p_output_old.stdout != __sap_hana_preconfigure_register_netapp_sysctl_p_output_new.stdout - name: Display kernel parameters for NetApp NFS ansible.builtin.debug: - var: __sap_hana_preconfigure_register_netapp_sysctl_p_output.stdout_lines + var: __sap_hana_preconfigure_register_netapp_sysctl_p_output_new.stdout_lines - name: Set kernel tunable for NFSv3 as per SAP note 3024346 ansible.builtin.lineinfile: From 63962d085947f3b0d1ec9918647ab5195822f89f Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 11:41:45 +0200 Subject: [PATCH 03/11] sap_general_preconfigure: add task change validation, task #1 The task "Reload kernel parameters from file /etc/sysctl.d/sap.conf" now recognizes a parameter change. Relates to #752. Signed-off-by: Bernd Finger --- .../generic/configure-kernel-parameters.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml index a1d75dfd0..32cabbfb3 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml @@ -13,11 +13,21 @@ loop_control: loop_var: line_item +- name: Construct the command for getting all current parameters of file '{{ sap_general_preconfigure_etc_sysctl_sap_conf }}' + ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' "{{ sap_general_preconfigure_etc_sysctl_sap_conf }}" + register: __sap_general_preconfigure_register_sap_conf_sysctl_command + changed_when: false + +- name: Get all currently active values of the parameters of file '{{ sap_general_preconfigure_etc_sysctl_sap_conf }}' + ansible.builtin.shell: "{{ __sap_general_preconfigure_register_sap_conf_sysctl_command.stdout }}" + register: __sap_general_preconfigure_register_sap_conf_sysctl_p_output_old + changed_when: false + - name: Reload kernel parameters from file '{{ sap_general_preconfigure_etc_sysctl_sap_conf }}' ansible.builtin.command: sysctl -p "{{ sap_general_preconfigure_etc_sysctl_sap_conf }}" - register: __sap_general_preconfigure_register_sap_conf_sysctl_p_output - changed_when: true + register: __sap_general_preconfigure_register_sap_conf_sysctl_p_output_new + changed_when: __sap_general_preconfigure_register_sap_conf_sysctl_p_output_old.stdout != __sap_general_preconfigure_register_sap_conf_sysctl_p_output_new.stdout - name: Display kernel parameters after setting kernel.pid_max ansible.builtin.debug: - var: __sap_general_preconfigure_register_sap_conf_sysctl_p_output.stdout_lines + var: __sap_general_preconfigure_register_sap_conf_sysctl_p_output_new.stdout_lines From 7ac6ced3b65a143db7f385ede3a042525c3c8375 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 12:00:04 +0200 Subject: [PATCH 04/11] sap_general_preconfigure: add tag for skipping molecule test, task #2 The task "Ensure that the required package groups are installed, RHEL 8.1" now has a tag for skipping the molecule idempotency test Relates to #752. Signed-off-by: Bernd Finger --- roles/sap_general_preconfigure/tasks/RedHat/installation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml index 1fa7b2afb..4de0d93dc 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml @@ -120,6 +120,7 @@ ansible.builtin.command: "yum install {{ sap_general_preconfigure_packagegroups | join(' ') }} --nobest --exclude=kernel* -y" register: __sap_general_preconfigure_register_yum_group_install when: ansible_distribution_version == '8.1' + tags: molecule-idempotence-notest # possible replacement once we no longer need Ansible 2.9 compatibility: #- name: Ensure that the required package groups are installed, RHEL 8 and 9 From ec479ac6b0c0bc431e87083e2556c26f1a8f9cf1 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 13:03:48 +0200 Subject: [PATCH 05/11] sap_general_preconfigure: add more tags for skipping molecule tests Relates to #752. Signed-off-by: Bernd Finger --- roles/sap_general_preconfigure/handlers/main.yml | 1 + roles/sap_general_preconfigure/tasks/RedHat/installation.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/roles/sap_general_preconfigure/handlers/main.yml b/roles/sap_general_preconfigure/handlers/main.yml index cdbd8a607..e54f6dd56 100644 --- a/roles/sap_general_preconfigure/handlers/main.yml +++ b/roles/sap_general_preconfigure/handlers/main.yml @@ -43,6 +43,7 @@ - name: Remount /dev/shm # noqa command-instead-of-module no-changed-when ansible.builtin.command: mount -o remount /dev/shm listen: __sap_general_preconfigure_mount_tmpfs_handler + tags: molecule-idempotence-notest - name: Check if /dev/shm is available ansible.builtin.command: df -h /dev/shm diff --git a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml index 4de0d93dc..55ff79239 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml @@ -74,6 +74,7 @@ # and then having to compare the output against the list of desired repos - name: Run the subscription-manager command # noqa no-changed-when ansible.builtin.command: "{{ __sap_general_preconfigure_fact_subscription_manager_command }}" + tags: molecule-idempotence-notest # Reason for noqa: We need the output of the yum command - name: Get list of enabled repositories @@ -104,6 +105,7 @@ when: - sap_general_preconfigure_set_minor_release - __sap_general_preconfigure_register_subscription_manager_release.stdout != ansible_distribution_version + tags: molecule-idempotence-notest - name: Ensure that the required package groups are installed, RHEL except 8.1 ansible.builtin.package: From b2856a94b9a0be3822b056405cc6d8c403202c28 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 13:06:14 +0200 Subject: [PATCH 06/11] sap_hana_preconfigure: add tag for skipping molecule test Relates to #752. Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/tasks/RedHat/installation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml b/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml index a7a51f79f..1ffcd4be5 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml @@ -42,6 +42,7 @@ - name: Enable required repositories # noqa no-changed-when ansible.builtin.command: "subscription-manager repos {{ __sap_hana_preconfigure_fact_required_repos_args | map('quote') | join(' ') }}" register: __sap_hana_preconfigure_register_subscription_enable_repos + tags: molecule-idempotence-notest - name: Display the output of the subscription-manager repos --enable command ansible.builtin.debug: From 19b372c9fe77215313807dd2067041548cf3b787 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 14:33:07 +0200 Subject: [PATCH 07/11] sap_hana_preconfigure: add task change validation, task #3 The task "Reload kernel parameters from file '/etc/sysctl.d/ibm_largesend.conf'" now recognizes a parameter change. Relates to #752. Signed-off-by: Bernd Finger --- .../tasks/sapnote/2055470.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml index 286c35ee5..258a6c0d0 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml @@ -66,11 +66,21 @@ loop_control: loop_var: line_item -# Reason for noqa: We unconditionally reload the kernel parameters without first checking the current values - - name: Reload kernel parameters from file '/etc/sysctl.d/ibm_largesend.conf' # noqa no-changed-when + - name: Construct the command for getting all current parameters of file '/etc/sysctl.d/ibm_largesend.conf' + ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' /etc/sysctl.d/ibm_largesend.conf + register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_command + changed_when: false + + - name: Get all currently active values of the parameters of file '/etc/sysctl.d/ibm_largesend.conf' + ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_ibm_largesend_sysctl_command.stdout }}" + register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output_old + changed_when: false + + - name: Reload kernel parameters from file '/etc/sysctl.d/ibm_largesend.conf' ansible.builtin.command: sysctl -p /etc/sysctl.d/ibm_largesend.conf - register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output + register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output_new + changed_when: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output_old.stdout != __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output_new.stdout - name: Display largesend kernel parameters ansible.builtin.debug: - var: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output.stdout_lines + var: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output_new.stdout_lines From 7d5daaff98e19b60b67c2be84f35d2f098dac29f Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 15:53:17 +0200 Subject: [PATCH 08/11] sap*preconfigure: Ansible-lint cleanup for the modifications for #752 Signed-off-by: Bernd Finger --- .../tasks/RedHat/generic/configure-kernel-parameters.yml | 3 ++- roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml | 3 ++- roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml | 2 +- roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml index 32cabbfb3..6c681f68e 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml @@ -18,7 +18,8 @@ register: __sap_general_preconfigure_register_sap_conf_sysctl_command changed_when: false -- name: Get all currently active values of the parameters of file '{{ sap_general_preconfigure_etc_sysctl_sap_conf }}' +# Reason for noqa: The command module tries to run the complete string as a single command +- name: Get all currently active values of the parameters of file '{{ sap_general_preconfigure_etc_sysctl_sap_conf }}' # noqa command-instead-of-shell ansible.builtin.shell: "{{ __sap_general_preconfigure_register_sap_conf_sysctl_command.stdout }}" register: __sap_general_preconfigure_register_sap_conf_sysctl_p_output_old changed_when: false diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml index 258a6c0d0..0a33286cc 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml @@ -71,7 +71,8 @@ register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_command changed_when: false - - name: Get all currently active values of the parameters of file '/etc/sysctl.d/ibm_largesend.conf' +# Reason for noqa: The command module tries to run the complete string as a single command + - name: Get all currently active values of the parameters of file '/etc/sysctl.d/ibm_largesend.conf' # noqa command-instead-of-shell ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_ibm_largesend_sysctl_command.stdout }}" register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output_old changed_when: false diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml index 7272c5e0a..07e84488a 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml @@ -73,7 +73,7 @@ changed_when: false - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' - ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_saphana_conf_sysctl_command.stdout }}" + ansible.builtin.command: "{{ __sap_hana_preconfigure_register_saphana_conf_sysctl_command.stdout }}" register: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output_old changed_when: false diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index f399634c8..9000acf28 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -30,7 +30,9 @@ register: __sap_hana_preconfigure_register_netapp_sysctl_command changed_when: false - - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' +# Reason for noqa: when adding 'set -o pipefail', the complete string is attempted to be executed as a single command. Also +# the command after the pipe is not expected to fail. + - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' # noqa risky-shell-pipe ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_netapp_sysctl_command.stdout }} | sed 's,\t, ,g'" register: __sap_hana_preconfigure_register_netapp_sysctl_p_output_old changed_when: false From ca7d234cece022667f8d6aa5fa20cbd314685e72 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 16:20:53 +0200 Subject: [PATCH 09/11] sap_hana_preconfigure: Add ansible-lint 6.22.2 compliance Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index 9000acf28..b2428b3ea 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -30,9 +30,10 @@ register: __sap_hana_preconfigure_register_netapp_sysctl_command changed_when: false -# Reason for noqa: when adding 'set -o pipefail', the complete string is attempted to be executed as a single command. Also -# the command after the pipe is not expected to fail. - - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' # noqa risky-shell-pipe +# Reason for noqa - risky-shell-pipe: when adding 'set -o pipefail', the complete string is attempted to be executed as a single command. +# Also the command after the pipe is not expected to fail. +# Reason for noqa - no-tabs: This is a false positive in ansible-lint 6.22.2, removed in 24.5.0. See https://github.com/ansible/ansible-lint/issues/4020 + - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' # noqa risky-shell-pipe no-tabs ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_netapp_sysctl_command.stdout }} | sed 's,\t, ,g'" register: __sap_hana_preconfigure_register_netapp_sysctl_p_output_old changed_when: false From 401d314cf524cb272dddc631b13499c3c15d7a38 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 19 Jul 2024 10:32:32 +0200 Subject: [PATCH 10/11] sap*preconfigure: Add explanations for the additional tasks These additional tasks are necessary to correctly report the 'changed' state of 'sysctl -p'. Relates to #752. Signed-off-by: Bernd Finger --- .../tasks/RedHat/generic/configure-kernel-parameters.yml | 3 +++ roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml | 3 +++ roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml index 6c681f68e..f498cdce8 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml @@ -13,6 +13,9 @@ 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_general_preconfigure_etc_sysctl_sap_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 . - name: Construct the command for getting all current parameters of file '{{ sap_general_preconfigure_etc_sysctl_sap_conf }}' ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' "{{ sap_general_preconfigure_etc_sysctl_sap_conf }}" register: __sap_general_preconfigure_register_sap_conf_sysctl_command diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml index 0a33286cc..8bd97e5ec 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml @@ -66,6 +66,9 @@ 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 '/etc/sysctl.d/ibm_largesend.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 . - name: Construct the command for getting all current parameters of file '/etc/sysctl.d/ibm_largesend.conf' ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' /etc/sysctl.d/ibm_largesend.conf register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_command diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index b2428b3ea..765b93169 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -25,6 +25,9 @@ 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 . - name: Construct the command for getting all current parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" register: __sap_hana_preconfigure_register_netapp_sysctl_command From f3abff5a288e3f83b0c9ee845e6473d8a3b9c856 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 19 Jul 2024 10:51:50 +0200 Subject: [PATCH 11/11] sap_hana_preconfigure: Add explanation for one more task This additional task is necessary to correctly report the 'changed' state of 'sysctl -p'. Relates to #752. Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml index 07e84488a..823a604f9 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml @@ -67,6 +67,9 @@ line: "net.core.rmem_max={{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem.stdout.split()[-1] }}" state: present +# 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_saphana_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 . - name: Construct the command for getting all current parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" register: __sap_hana_preconfigure_register_saphana_conf_sysctl_command