Resolves: #2002286, merge patches from 9.0.0-beta branch

This commit is contained in:
Than Ngo 2021-09-09 11:29:03 +02:00
parent 3644c21ab4
commit 72316d9071
5 changed files with 183 additions and 1 deletions

View File

@ -35,7 +35,7 @@
Name: %{package_name}
Summary: System Roles to configure RHEL for running SAP NetWeaver- or SAP HANA-based products
Version: 3.1.1
Release: 10%{?dist}
Release: 11%{?dist}
License: GPLv3+
Url: https://github.com/berndfinger
Source0: https://github.com/linux-system-roles/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz
@ -46,9 +46,13 @@ Source4: README.md
Source5: galaxy.yml
# patches 0-49 for sap-preconfigure
Patch1: sap-preconfigure-69de334fecbce65506bbea15b1b9bcd643528352.patch
Patch2: sap-preconfigure-fa66c6722c0bf31c651c1d63972d9a32b9218ccf.patch
Patch3: sap-preconfigure-62908fd7a79a4ef0d38ce2e48bca5970eb0f2304.patch
# patches 50-99 for sap-hana-preconfigure
Patch50: sap-hana-preconfigure-md2html-error.patch
Patch51: sap-hana-preconfigure-f30be1952fe55cc4a5e153bfd13863f527643d40.patch
Patch52: sap-hana-preconfigure-61b366bb366f1dca0684d00f7cbf4563f71630e6.patch
Patch53: sap-hana-preconfigure-2557f321ab86bba4cbf463eaf69df8d1bb3a2261.patch
# patches 100-149 for sap-netweaver-preconfigur
Patch100: sap-netweaver-preconfigure-rhel9.patch
@ -136,10 +140,14 @@ sed -i -e 's|name: rhel|name: %{collection_name}|' galaxy.yml
pushd sap-preconfigure
%patch1 -p1
%patch2 -p1
%patch3 -p1
popd
pushd sap-hana-preconfigure
%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
popd
pushd sap-netweaver-preconfigure
%patch100 -p1
@ -249,6 +257,11 @@ popd
%endif
%changelog
* Wed Sep 01 2021 Than Ngo <than@redhat.com> - 3.1.1-11
- fix yum group install errors on RHEL 7
- use grubby for setting tsx=on
- set min kernel version for RHEL 8.4 x86_64
* Fri Aug 20 2021 Than Ngo <than@redhat.com> - 3.1.1-10
- Related: #1977195, fix #149, #177, #193, #194

View File

@ -0,0 +1,63 @@
commit 2557f321ab86bba4cbf463eaf69df8d1bb3a2261
Author: Bernd Finger <bfinger@redhat.com>
Date: Mon Sep 6 09:26:10 2021 +0200
use grubby for setting tsx=on; set min kernel version for RHEL 8.4 x86_64
diff --git a/handlers/main.yml b/handlers/main.yml
index 0d81021..8387bc7 100644
--- a/handlers/main.yml
+++ b/handlers/main.yml
@@ -49,6 +49,12 @@
- __sap_hana_preconfigure_register_stat_sys_firmware_efi.stat.exists
- sap_hana_preconfigure_run_grub2_mkconfig|d(true)
+- name: "Run grubby"
+ command: grubby --args="tsx=on" --update-kernel=ALL
+ register: __sap_hana_preconfigure_register_grubby_update
+ listen: __sap_hana_preconfigure_grubby_update_handler
+ notify: __sap_hana_preconfigure_reboot_handler
+
- name: Reboot the managed node
reboot:
test_command: /bin/true
diff --git a/tasks/RedHat/generic/enable-tsx.yml b/tasks/RedHat/generic/enable-tsx.yml
index c4be81c..09b87d3 100644
--- a/tasks/RedHat/generic/enable-tsx.yml
+++ b/tasks/RedHat/generic/enable-tsx.yml
@@ -4,21 +4,11 @@
msg: "imported RedHat/generic/enable-tsx.yml"
- name: Enable TSX at boot time
- lineinfile:
- path: /etc/default/grub
- backup: yes
- backrefs: yes
- state: present
- regexp: '^(GRUB_CMDLINE_LINUX=(?!.* {{ line_item }}).*). *$'
- line: "\\1 {{ line_item }}\""
- with_items:
- - "tsx=on"
- notify: __sap_hana_preconfigure_regenerate_grub2_conf_handler
+ command: /bin/true
+ notify: __sap_hana_preconfigure_grubby_update_handler
when:
- ansible_architecture == 'x86_64'
- ansible_distribution == 'RedHat'
- ansible_distribution_major_version == '8'
- __sap_hana_preconfigure_fact_ansible_distribution_minor_version >= '3'
tags: grubconfig
- loop_control:
- loop_var: line_item
diff --git a/vars/RedHat_8.yml b/vars/RedHat_8.yml
index 29efc7a..dd77300 100644
--- a/vars/RedHat_8.yml
+++ b/vars/RedHat_8.yml
@@ -135,6 +135,7 @@ __sap_hana_preconfigure_min_packages_8_3_x86_64:
__sap_hana_preconfigure_min_packages_8_3_ppc64le:
__sap_hana_preconfigure_min_packages_8_4_x86_64:
+ - [ 'kernel' , '4.18.0-305.3.1.el8_4' ]
__sap_hana_preconfigure_min_packages_8_4_ppc64le:

View File

@ -0,0 +1,36 @@
commit 61b366bb366f1dca0684d00f7cbf4563f71630e6
Author: Bernd Finger <bfinger@redhat.com>
Date: Fri Sep 3 12:16:35 2021 +0200
add tsx=on to the kernel command line unconditionally
diff --git a/tasks/RedHat/generic/enable-tsx.yml b/tasks/RedHat/generic/enable-tsx.yml
index 3dd6d09..c4be81c 100644
--- a/tasks/RedHat/generic/enable-tsx.yml
+++ b/tasks/RedHat/generic/enable-tsx.yml
@@ -3,16 +3,7 @@
- debug:
msg: "imported RedHat/generic/enable-tsx.yml"
-- name: Get the CPU flags
- shell: lscpu | grep "^Flags"
- register: __sap_hana_preconfigure_register_lscpu
- when:
- - ansible_architecture == 'x86_64'
- - ansible_distribution == 'RedHat'
- - ansible_distribution_major_version == '8'
- - __sap_hana_preconfigure_fact_ansible_distribution_minor_version >= '3'
-
-- name: Enable TSX at boot time if CPU flag rtm is not present
+- name: Enable TSX at boot time
lineinfile:
path: /etc/default/grub
backup: yes
@@ -28,7 +19,6 @@
- ansible_distribution == 'RedHat'
- ansible_distribution_major_version == '8'
- __sap_hana_preconfigure_fact_ansible_distribution_minor_version >= '3'
- - not ' rtm' in __sap_hana_preconfigure_register_lscpu.stdout
tags: grubconfig
loop_control:
loop_var: line_item

View File

@ -0,0 +1,31 @@
commit 62908fd7a79a4ef0d38ce2e48bca5970eb0f2304
Author: Bernd Finger <bfinger@redhat.com>
Date: Tue Aug 31 16:38:13 2021 +0200
fix yum group install errors on RHEL 7
diff --git a/tasks/installation.yml b/tasks/installation.yml
index ac63e9f..3ff6ef4 100644
--- a/tasks/installation.yml
+++ b/tasks/installation.yml
@@ -1,7 +1,7 @@
---
- name: Ensure required package groups are installed, RHEL 7
- command: yum install "{{ sap_preconfigure_packagegroups|join('')|quote }}" -y
+ command: "yum install {{ sap_preconfigure_packagegroups|join(' ') }} -y"
args:
warn: false
register: __sap_preconfigure_register_yum_group_install
@@ -9,9 +9,9 @@
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version == '7'
-- name: Ensure required package groups are installed, RHEL 8 and later
+- name: Ensure required package groups are installed, RHEL 8 and RHEL 9
# Note: We want to avoid unwanted package upgrades, see bug 1983749.
- command: yum install "{{ sap_preconfigure_packagegroups|join('')|quote }}" --nobest --exclude="kernel*" -y
+ command: "yum install {{ sap_preconfigure_packagegroups|join(' ') }} --nobest --exclude=kernel* -y"
args:
warn: false
register: __sap_preconfigure_register_yum_group_install

View File

@ -0,0 +1,39 @@
commit fa66c6722c0bf31c651c1d63972d9a32b9218ccf
Author: Bernd Finger <bfinger@redhat.com>
Date: Mon Aug 30 22:10:49 2021 +0200
do not use yum option "--nobest" on RHEL 7
diff --git a/tasks/installation.yml b/tasks/installation.yml
index 096c993..ac63e9f 100644
--- a/tasks/installation.yml
+++ b/tasks/installation.yml
@@ -1,12 +1,25 @@
---
-- name: Ensure required package groups are installed
-# Note: We cannot use the package module here as this will do a default group install,
-# which could lead to unwanted package upgrades. See bug 1983749.
+- name: Ensure required package groups are installed, RHEL 7
+ command: yum install "{{ sap_preconfigure_packagegroups|join('')|quote }}" -y
+ args:
+ warn: false
+ register: __sap_preconfigure_register_yum_group_install
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_distribution_major_version == '7'
+
+- name: Ensure required package groups are installed, RHEL 8 and later
+# Note: We want to avoid unwanted package upgrades, see bug 1983749.
command: yum install "{{ sap_preconfigure_packagegroups|join('')|quote }}" --nobest --exclude="kernel*" -y
args:
warn: false
register: __sap_preconfigure_register_yum_group_install
+ when:
+ - ansible_os_family == 'RedHat'
+ - (ansible_distribution_major_version == '8' or
+ ansible_distribution_major_version == '9'
+ )
- debug:
var: __sap_preconfigure_register_yum_group_install