From ca5037be39bc98ff70c8fd4e2df0741f31aa35a7 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Tue, 4 Feb 2025 10:50:24 +0100 Subject: [PATCH] Related: RHEL-74075, Fix checkmode in sap_hana_preconfigure --- redhat.sap_install-1.5.2-check_mode.patch | 25 +++++++++++++++++++++++ rhel-system-roles-sap.spec | 14 ++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/redhat.sap_install-1.5.2-check_mode.patch b/redhat.sap_install-1.5.2-check_mode.patch index e2400d5..97674fd 100644 --- a/redhat.sap_install-1.5.2-check_mode.patch +++ b/redhat.sap_install-1.5.2-check_mode.patch @@ -9,3 +9,28 @@ diff -up redhat.sap_install-1.5.2/roles/sap_general_preconfigure/tasks/RedHat/ge changed_when: false # Reason for noqa: The command module tries to run the complete string as a single command +diff -up redhat.sap_install-1.5.2/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml.me redhat.sap_install-1.5.2/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml +--- redhat.sap_install-1.5.2/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml.me 2025-02-04 10:24:11.654505302 +0100 ++++ redhat.sap_install-1.5.2/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml 2025-02-04 10:24:48.064360920 +0100 +@@ -43,7 +43,9 @@ + - name: Set THP to '{{ __sap_hana_preconfigure_fact_thp }}' on the running system + ansible.builtin.shell: echo '{{ __sap_hana_preconfigure_fact_thp }}' > /sys/kernel/mm/transparent_hugepage/enabled + changed_when: true +- when: __sap_hana_preconfigure_register_thp_status_before.stdout.split('[')[1].split(']')[0] != __sap_hana_preconfigure_fact_thp ++ when: ++ - not ansible_check_mode ++ - __sap_hana_preconfigure_register_thp_status_before.stdout.split('[')[1].split(']')[0] != __sap_hana_preconfigure_fact_thp + + - name: Configure - Get the status of THP + ansible.builtin.command: cat /sys/kernel/mm/transparent_hugepage/enabled +diff -up redhat.sap_install-1.5.2/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml.me redhat.sap_install-1.5.2/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml +--- redhat.sap_install-1.5.2/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml.me 2025-02-04 10:24:25.595832908 +0100 ++++ redhat.sap_install-1.5.2/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml 2025-02-04 10:24:48.064360920 +0100 +@@ -72,6 +72,7 @@ + - 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 ++ check_mode: false + changed_when: false + + - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' diff --git a/rhel-system-roles-sap.spec b/rhel-system-roles-sap.spec index b324971..4160581 100644 --- a/rhel-system-roles-sap.spec +++ b/rhel-system-roles-sap.spec @@ -45,7 +45,7 @@ Name: %{package_name} Summary: System Roles to configure RHEL for running SAP NetWeaver- or SAP HANA-based products -Version: 3.8.3 +Version: 3.8.4 Release: 1%{?dist} License: GPL-3.0-or-later Url: https://github.com/redhat-sap/community.sap_install @@ -135,9 +135,10 @@ popd mkdir -p %{collection_dir_sap_install} %{collection_dir_sap_infrastructure} # sap_install collection tar zxf %{github_repo_sap_install}-%{commit_id_sap_install}/%{collection_namespace}-%{collection_name_sap_install}-%{collection_sap_install_version}.tar.gz -C %{collection_dir_sap_install} -# apply Fix for check mode -cp -f %{github_repo_sap_install}-%{commit_id_sap_install}/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml \ -%{collection_dir_sap_install}/roles/sap_general_preconfigure/tasks/RedHat/generic/ +# sap_install collection, Fix check mode +pushd %{collection_dir_sap_install}/ +%patch -P3 -p1 +popd # sap_infrastructure collection tar zxf %{github_repo_sap_infrastructure}-%{commit_id_sap_infrastructure}/%{collection_namespace}-%{collection_name_sap_infrastructure}-%{commit_id_sap_infrastructure}.tar.gz -C %{collection_dir_sap_infrastructure} %endif @@ -244,8 +245,11 @@ popd %endif %changelog +* Tue Feb 04 2025 Than Ngo - 3.8.4-1 +- Related: RHEL-74075, Fix checkmode in sap_hana_preconfigure + * Fri Jan 31 2025 Than Ngo - 3.8.3-1 -- Related RHEL-74075, Fix checkmode for sysctl +- Related: RHEL-74075, Fix checkmode for sysctl * Tue Jan 28 2025 Than Ngo - 3.8.2-1 - Related: RHEL-74075, use redhat.sap_install for *_sap_install_collection