|
|
135abf |
commit f30be1952fe55cc4a5e153bfd13863f527643d40
|
|
|
135abf |
Author: Bernd Finger <bfinger@redhat.com>
|
|
|
135abf |
Date: Wed Aug 11 21:38:45 2021 +0200
|
|
|
135abf |
|
|
|
135abf |
Solve issues #177, #193, and #194.
|
|
|
135abf |
|
|
|
135abf |
diff --git a/tasks/RedHat/generic/assert-tsx.yml b/tasks/RedHat/generic/assert-tsx.yml
|
|
|
135abf |
index 4ace64c..d7da1d2 100644
|
|
|
135abf |
--- a/tasks/RedHat/generic/assert-tsx.yml
|
|
|
135abf |
+++ b/tasks/RedHat/generic/assert-tsx.yml
|
|
|
135abf |
@@ -4,6 +4,24 @@
|
|
|
135abf |
msg: "imported RedHat/generic/assert-tsx.yml"
|
|
|
135abf |
|
|
|
135abf |
- block:
|
|
|
135abf |
+# There are CPUs which are not capable of enabling the rtm flag, so we just report the status:
|
|
|
135abf |
+ - name: Get all CPU flags
|
|
|
135abf |
+ shell: lscpu | grep "^Flags:"
|
|
|
135abf |
+ register: __sap_hana_preconfigure_register_lscpu_flags
|
|
|
135abf |
+ changed_when: no
|
|
|
135abf |
+
|
|
|
135abf |
+ - name: Report that the rtm CPU flag exists
|
|
|
135abf |
+ debug:
|
|
|
135abf |
+ msg: "INFO: The CPU flags contain ' rtm'."
|
|
|
135abf |
+ when: "' rtm' in __sap_hana_preconfigure_register_lscpu_flags.stdout"
|
|
|
135abf |
+
|
|
|
135abf |
+ - name: Report that the rtm CPU flag does not exist
|
|
|
135abf |
+ debug:
|
|
|
135abf |
+ msg: "INFO: The CPU flags do not contain ' rtm'."
|
|
|
135abf |
+ when: "' rtm' not in __sap_hana_preconfigure_register_lscpu_flags.stdout"
|
|
|
135abf |
+
|
|
|
135abf |
+# Note: Assertions are only necessary if rtm is not in the CPU flags.
|
|
|
135abf |
+# If rtm is present, we just print an INFO message.
|
|
|
135abf |
- name: Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub
|
|
|
135abf |
command: grep GRUB_CMDLINE_LINUX /etc/default/grub
|
|
|
135abf |
register: __sap_hana_preconfigure_register_default_grub_cmdline_tsx_assert
|
|
|
135abf |
@@ -15,6 +33,21 @@
|
|
|
135abf |
fail_msg: "FAIL: 'tsx=on' is not in GRUB_CMDLINE_LINUX in /etc/default/grub!"
|
|
|
135abf |
success_msg: "PASS: 'tsx=on' is in GRUB_CMDLINE_LINUX in /etc/default/grub."
|
|
|
135abf |
ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}"
|
|
|
135abf |
+ when: "' rtm' not in __sap_hana_preconfigure_register_lscpu_flags.stdout"
|
|
|
135abf |
+
|
|
|
135abf |
+ - name: Report if tsx=on is in GRUB_CMDLINE_LINUX in /etc/default/grub
|
|
|
135abf |
+ debug:
|
|
|
135abf |
+ msg: "INFO: 'tsx=on' is in GRUB_CMDLINE_LINUX in /etc/default/grub."
|
|
|
135abf |
+ when:
|
|
|
135abf |
+ - "'tsx=on' in __sap_hana_preconfigure_register_default_grub_cmdline_tsx_assert.stdout"
|
|
|
135abf |
+ - "' rtm' in __sap_hana_preconfigure_register_lscpu_flags.stdout"
|
|
|
135abf |
+
|
|
|
135abf |
+ - name: Report if tsx=on is not in GRUB_CMDLINE_LINUX in /etc/default/grub
|
|
|
135abf |
+ debug:
|
|
|
135abf |
+ msg: "INFO: 'tsx=on' is not in GRUB_CMDLINE_LINUX in /etc/default/grub."
|
|
|
135abf |
+ when:
|
|
|
135abf |
+ - "'tsx=on' not in __sap_hana_preconfigure_register_default_grub_cmdline_tsx_assert.stdout"
|
|
|
135abf |
+ - "' rtm' in __sap_hana_preconfigure_register_lscpu_flags.stdout"
|
|
|
135abf |
|
|
|
135abf |
- name: Get contents of /proc/cmdline
|
|
|
135abf |
command: cat /proc/cmdline
|
|
|
135abf |
@@ -27,20 +60,21 @@
|
|
|
135abf |
fail_msg: "FAIL: 'tsx=on' is not in /proc/cmdline!"
|
|
|
135abf |
success_msg: "PASS: 'tsx=on' is in /proc/cmdline."
|
|
|
135abf |
ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}"
|
|
|
135abf |
+ when: "' rtm' not in __sap_hana_preconfigure_register_lscpu_flags.stdout"
|
|
|
135abf |
|
|
|
135abf |
-# We are counting the number of cpuinfo lines which contain "flags" and subtracting those lines
|
|
|
135abf |
-# which contain "flags" and " rtm ". If the result is 0, all CPUs contain flag "rtm".
|
|
|
135abf |
- - name: Get rtm status of all CPUs
|
|
|
135abf |
- shell: awk '$1=="flags"{n++}$1=="flags"&&$0~" rtm" {a++}END{print n-a}' /proc/cpuinfo
|
|
|
135abf |
- register: __sap_hana_preconfigure_register_cpuinfo_flags_contain_rtm
|
|
|
135abf |
- changed_when: no
|
|
|
135abf |
+ - name: Report if tsx=on is in /proc/cmdline
|
|
|
135abf |
+ debug:
|
|
|
135abf |
+ msg: "INFO: 'tsx=on' is in /proc/cmdline."
|
|
|
135abf |
+ when:
|
|
|
135abf |
+ - "'tsx=on' in __sap_hana_preconfigure_register_proc_cmdline_tsx_assert.stdout"
|
|
|
135abf |
+ - "' rtm' in __sap_hana_preconfigure_register_lscpu_flags.stdout"
|
|
|
135abf |
|
|
|
135abf |
- - name: Assert that all CPUs contain flag rtm
|
|
|
135abf |
- assert:
|
|
|
135abf |
- that: "__sap_hana_preconfigure_register_cpuinfo_flags_contain_rtm.stdout == '0'"
|
|
|
135abf |
- fail_msg: "FAIL: At least one of the CPUs does not contain flag 'rtm'!"
|
|
|
135abf |
- success_msg: "PASS: All CPUs contain flag 'rtm'."
|
|
|
135abf |
- ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}"
|
|
|
135abf |
+ - name: Report if tsx=on is not in /proc/cmdline
|
|
|
135abf |
+ debug:
|
|
|
135abf |
+ msg: "INFO: 'tsx=on' is not in /proc/cmdline."
|
|
|
135abf |
+ when:
|
|
|
135abf |
+ - "'tsx=on' not in __sap_hana_preconfigure_register_proc_cmdline_tsx_assert.stdout"
|
|
|
135abf |
+ - "' rtm' in __sap_hana_preconfigure_register_lscpu_flags.stdout"
|
|
|
135abf |
|
|
|
135abf |
when: ansible_architecture == 'x86_64' and
|
|
|
135abf |
ansible_distribution == 'RedHat' and
|
|
|
135abf |
diff --git a/tasks/RedHat/generic/enable-tsx.yml b/tasks/RedHat/generic/enable-tsx.yml
|
|
|
135abf |
index 879f0bf..3dd6d09 100644
|
|
|
135abf |
--- a/tasks/RedHat/generic/enable-tsx.yml
|
|
|
135abf |
+++ b/tasks/RedHat/generic/enable-tsx.yml
|
|
|
135abf |
@@ -3,7 +3,16 @@
|
|
|
135abf |
- debug:
|
|
|
135abf |
msg: "imported RedHat/generic/enable-tsx.yml"
|
|
|
135abf |
|
|
|
135abf |
-- name: Enable TSX at boot time
|
|
|
135abf |
+- name: Get the CPU flags
|
|
|
135abf |
+ shell: lscpu | grep "^Flags"
|
|
|
135abf |
+ register: __sap_hana_preconfigure_register_lscpu
|
|
|
135abf |
+ when:
|
|
|
135abf |
+ - ansible_architecture == 'x86_64'
|
|
|
135abf |
+ - ansible_distribution == 'RedHat'
|
|
|
135abf |
+ - ansible_distribution_major_version == '8'
|
|
|
135abf |
+ - __sap_hana_preconfigure_fact_ansible_distribution_minor_version >= '3'
|
|
|
135abf |
+
|
|
|
135abf |
+- name: Enable TSX at boot time if CPU flag rtm is not present
|
|
|
135abf |
lineinfile:
|
|
|
135abf |
path: /etc/default/grub
|
|
|
135abf |
backup: yes
|
|
|
135abf |
@@ -14,10 +23,12 @@
|
|
|
135abf |
with_items:
|
|
|
135abf |
- "tsx=on"
|
|
|
135abf |
notify: __sap_hana_preconfigure_regenerate_grub2_conf_handler
|
|
|
135abf |
- when: ansible_architecture == 'x86_64' and
|
|
|
135abf |
- ansible_distribution == 'RedHat' and
|
|
|
135abf |
- ansible_distribution_major_version == '8' and
|
|
|
135abf |
- __sap_hana_preconfigure_fact_ansible_distribution_minor_version >= '3'
|
|
|
135abf |
+ when:
|
|
|
135abf |
+ - ansible_architecture == 'x86_64'
|
|
|
135abf |
+ - ansible_distribution == 'RedHat'
|
|
|
135abf |
+ - ansible_distribution_major_version == '8'
|
|
|
135abf |
+ - __sap_hana_preconfigure_fact_ansible_distribution_minor_version >= '3'
|
|
|
135abf |
+ - not ' rtm' in __sap_hana_preconfigure_register_lscpu.stdout
|
|
|
135abf |
tags: grubconfig
|
|
|
135abf |
loop_control:
|
|
|
135abf |
loop_var: line_item
|
|
|
135abf |
diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml
|
|
|
135abf |
index fabeaac..a5bdb94 100644
|
|
|
135abf |
--- a/tasks/RedHat/installation.yml
|
|
|
135abf |
+++ b/tasks/RedHat/installation.yml
|
|
|
135abf |
@@ -63,22 +63,19 @@
|
|
|
135abf |
- ansible_architecture == "ppc64le"
|
|
|
135abf |
- sap_hana_preconfigure_add_ibm_power_repo|d(true)
|
|
|
135abf |
|
|
|
135abf |
-- name: Accept the license for the IBM tools
|
|
|
135abf |
- shell: |
|
|
|
135abf |
- MORE=+1000 /opt/ibm/lop/configure <<-EOF
|
|
|
135abf |
- y
|
|
|
135abf |
- EOF
|
|
|
135abf |
+- name: Accept the license for the IBM Service and Productivity Tools
|
|
|
135abf |
+ shell: LESS=+q /opt/ibm/lop/configure <<<'y'
|
|
|
135abf |
when:
|
|
|
135abf |
- ansible_architecture == "ppc64le"
|
|
|
135abf |
- sap_hana_preconfigure_add_ibm_power_repo|d(true)
|
|
|
135abf |
|
|
|
135abf |
-- name: Install IBM tools
|
|
|
135abf |
+- name: Install the IBM Service and Productivity Tools
|
|
|
135abf |
package:
|
|
|
135abf |
state: latest
|
|
|
135abf |
name: "{{ __sap_hana_preconfigure_required_ppc64le }}"
|
|
|
135abf |
when: ansible_architecture == "ppc64le"
|
|
|
135abf |
|
|
|
135abf |
-- name: Get status of installed IBM tools
|
|
|
135abf |
+- name: Get the status of installed IBM Service and Productivity Tools
|
|
|
135abf |
yum:
|
|
|
135abf |
name: "{{ __sap_hana_preconfigure_required_ppc64le }}"
|
|
|
135abf |
register: __sap_hana_preconfigure_register_required_ppc64le_packages
|
|
|
135abf |
diff --git a/tasks/sapnote/2055470.yml b/tasks/sapnote/2055470.yml
|
|
|
135abf |
index 5efbd6d..697913c 100644
|
|
|
135abf |
--- a/tasks/sapnote/2055470.yml
|
|
|
135abf |
+++ b/tasks/sapnote/2055470.yml
|
|
|
135abf |
@@ -32,7 +32,7 @@
|
|
|
135abf |
loop_var: line_item
|
|
|
135abf |
|
|
|
135abf |
## This only works if interfacename=device name, otherwise it fails
|
|
|
135abf |
-- name: add largesend options to interface
|
|
|
135abf |
+- name: Add largesend options to interfaces
|
|
|
135abf |
lineinfile:
|
|
|
135abf |
regexp: '^ETHTOOL_OPTIONS_tso='
|
|
|
135abf |
line: ETHTOOL_OPTIONS_tso='-K iface tso on'
|
|
|
135abf |
@@ -45,8 +45,9 @@
|
|
|
135abf |
)
|
|
|
135abf |
loop_control:
|
|
|
135abf |
loop_var: line_item
|
|
|
135abf |
+ ignore_errors: true
|
|
|
135abf |
|
|
|
135abf |
-- name: Add largesend parameters for ppc64le
|
|
|
135abf |
+- name: Add largesend kernel parameters for ppc64le
|
|
|
135abf |
sysctl:
|
|
|
135abf |
sysctl_file: /etc/sysctl.d/ibm_largesend.conf
|
|
|
135abf |
name: "{{ line_item.name }}"
|