Merge branch 'c8' into a8

This commit is contained in:
eabdullin 2021-12-16 13:44:57 +03:00 committed by root
commit 7697b3e7f4
19 changed files with 809 additions and 457 deletions

7
.gitignore vendored
View File

@ -1,3 +1,4 @@
SOURCES/sap-hana-preconfigure.tar.gz
SOURCES/sap-netweaver-preconfigure.tar.gz
SOURCES/sap-preconfigure.tar.gz
SOURCES/auto-maintenance-ec364d2e0bd422b69f34871a1188114f368097a0.tar.gz
SOURCES/sap-hana-preconfigure-9f22b540bc41e2d10fbc1250b36a7ef08129feb2.tar.gz
SOURCES/sap-netweaver-preconfigure-337ba5580ba862e1adac59dcda8a126cdf561225.tar.gz
SOURCES/sap-preconfigure-9bed558b55cedc8939f6b3d4436436a6aaaf095c.tar.gz

View File

@ -1,3 +1,4 @@
2a6d0af7d9ee7fdd8501e52476f9b42c54e3a50c SOURCES/sap-hana-preconfigure.tar.gz
65265d647f2e65227aa54e5173ef8c29b11d6764 SOURCES/sap-netweaver-preconfigure.tar.gz
2b1fd31c00102824db00626a95f3f64dc5813983 SOURCES/sap-preconfigure.tar.gz
bfd618e94056a68c75de22dfcde7b29445850176 SOURCES/auto-maintenance-ec364d2e0bd422b69f34871a1188114f368097a0.tar.gz
91e5bb8f301a95c289cb1464477ffa4efb4755f8 SOURCES/sap-hana-preconfigure-9f22b540bc41e2d10fbc1250b36a7ef08129feb2.tar.gz
aee8838be13eb656116dfe7e73146fbbb557f6cd SOURCES/sap-netweaver-preconfigure-337ba5580ba862e1adac59dcda8a126cdf561225.tar.gz
0ce21e34b45d2d57231d7a48c588295ad464b73f SOURCES/sap-preconfigure-9bed558b55cedc8939f6b3d4436436a6aaaf095c.tar.gz

52
SOURCES/README.md Normal file
View File

@ -0,0 +1,52 @@
Red Hat Enterprise Linux System Roles for SAP Ansible Collection
=====================================
Red Hat Enterprise Linux System Roles for SAP is a set of roles for preparing Red Hat Enterprise Linux systems for the initial installation of SAP NetWeaver and SAP HANA.
## Dependencies
If installing from RPM, any dependencies will be installed with the package.
Otherwise, the dependencies are listed in `requirements.txt` and/or `bindep.txt`.
## Installation
There are currently two ways to use the Red Hat Enterprise Linux System Roles for SAP Collection in your setup.
### Installation from Automation Hub
You can install the collection from Automation Hub by running:
```
ansible-galaxy collection install sap.rhel
```
After the installation, the roles are available as `sap.rhel.<role_name>`.
Please see the [Using Ansible collections documentation](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for further details.
### Installation via RPM
You can install the collection with the software package management tool `dnf` by running:
```
dnf install rhel-system-roles-sap
```
## Documentation
The official RHEL System Roles for SAP documentation can be found [here](https://access.redhat.com/articles/4488731).
## Support
### Supported Ansible Versions
The supported Ansible versions are aligned with currently maintained Ansible versions that support Collections (Ansible 2.9 and later). You can find the list of maintained Ansible versions [here](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#release-status).
### Modules and Plugins
The modules and other plugins in this collection are private, used only internally to the collection, unless otherwise noted.
### Supported Roles
<!--ts-->
* preconfigure
* hana_preconfigure
* netweaver_preconfigure
<!--te-->

58
SOURCES/galaxy.yml Normal file
View File

@ -0,0 +1,58 @@
### REQUIRED
# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with
# underscores or numbers and cannot contain consecutive underscores
namespace: sap
# The name of the collection. Has the same character restrictions as 'namespace'
name: rhel
# The version of the collection. Must be compatible with semantic versioning
version: 3.1.1
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
# @nicks:irc/im.site#channel'
authors:
- Bernd Finger <bfinger@redhat.com>
- Markus Koch <mkoch@redhat.com>
### OPTIONAL but strongly recommended
# A short summary description of the collection
description: Ansible Collection to prepare a RHEL 7.6 or later system for the installation of SAP NetWeaver or SAP HANA
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
license:
- GPL-3.0-or-later
- Apache-2.0
# The path to the license file for the collection. This path is relative to the root of the collection. This key is
# mutually exclusive with 'license'
# license_file: ''
# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
# requirements as 'namespace' and 'name'
tags: [sap]
# Collections that this collection requires to be installed for it to be usable. The key of the dict is the
# collection label 'namespace.name'. The value is a version range
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
# range specifiers can be set and are separated by ','
dependencies: {}
# The URL of the originating SCM repository
repository: https://github.com/sap-linux-roles/sap-linux-roles.github.io/
# The URL to any online docs
documentation: https://github.com/sap-linux-roles/sap-linux-roles.github.io/blob/master/README.md
# The URL to the homepage of the collection/project
homepage: https://sap-linux-roles.github.io
# The URL to the collection issue tracker
issues: https://github.com/sap-linux-roles/sap-linux-roles.github.io/issues

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

@ -1,28 +0,0 @@
commit 29003efa866e8f691076023ccf2eede2032173d6
Author: Bernd Finger <bfinger@redhat.com>
Date: Thu Mar 4 13:10:01 2021 +0100
added detailed explanations for sap_hana_preconfigure_kernel_parameters_ppc64le in README.md
diff --git a/README.md b/README.md
index 74ca820..50359b5 100644
--- a/README.md
+++ b/README.md
@@ -245,6 +245,17 @@ sap_hana_preconfigure_kernel_parameters:
- { name: net.ipv4.tcp_slow_start_after_idle, value: 0 }
```
+### HANA kernel parameters for IBM POWER servers
+[SAP Note 2055470](https://launchpad.support.sap.com/#/notes/2055470) contains links to IBM documents for SAP HANA on POWER.
+Among these is a document document which contains certain recommended Linux kernel settings for SAP HANA on POWER:
+Network_Configuration_for_HANA_Workloads_on_IBM_Power_Servers_V7.1.pdf.
+This document is linked from SAP note 2055470 via "SAP HANA on IBM Power Systems and IBM System Storage - Guides", then via
+"SAP on Linux and IBM Storage Guides (incl. HANA)", and then then via
+"SAP on Power Linux Network and Fibre Channel Guides".
+The default parameter recommendations are also defined in ./vars/{{ansible_os_release}}.yml. If you need to add or change parameters
+for your system, copy these parameters from the vars file into the variable sap_hana_preconfigure_kernel_parameters_ppc64le and
+add or change your settings, similar to the previous example.
+
Example Playbook
----------------

View File

@ -1,93 +0,0 @@
commit 3714dbb80889e65fb7152456fe262ab1fcc5e3e5
Author: Bernd Finger <bfinger@redhat.com>
Date: Thu Mar 4 10:31:24 2021 +0100
fix issue #170
diff --git a/defaults/main.yml b/defaults/main.yml
index b63c14b..02768cc 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -92,6 +92,8 @@ sap_hana_preconfigure_fail_if_reboot_required: yes
sap_hana_preconfigure_kernel_parameters: "{{ __sap_hana_preconfigure_kernel_parameters_default }}"
+sap_hana_preconfigure_kernel_parameters_ppc64le: "{{ __sap_hana_preconfigure_kernel_parameters_default_ppc64le }}"
+
sap_hana_preconfigure_add_ibm_power_repo: yes
# sap_hana_preconfigure_ibm_power_repo_url: 'http://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-3.0.0-19.noarch.rpm'
diff --git a/tasks/sapnote/2055470.yml b/tasks/sapnote/2055470.yml
index b958e52..2f41057 100644
--- a/tasks/sapnote/2055470.yml
+++ b/tasks/sapnote/2055470.yml
@@ -37,7 +37,7 @@
loop_control:
loop_var: line_item
-- name: add largesend parameter
+- name: Add largesend parameters for ppc64le
sysctl:
sysctl_file: /etc/sysctl.d/ibm_largesend.conf
name: "{{ line_item.name }}"
@@ -45,12 +45,7 @@
state: present
sysctl_set: yes
reload: yes
- with_items:
- - { name: net.core.rmem_max, value: 56623104 }
- - { name: net.core.wmem_max, value: 56623104 }
- - { name: net.ipv4.tcp_rmem, value: "65536 262088 56623104" }
- - { name: net.ipv4.tcp_wmem, value: "65536 262088 56623104" }
- - { name: net.ipv4.tcp_mem, value: "56623104 56623104 56623104" }
+ with_items: "{{ sap_hana_preconfigure_kernel_parameters_ppc64le }}"
loop_control:
loop_var: line_item
diff --git a/tasks/sapnote/assert-2055470.yml b/tasks/sapnote/assert-2055470.yml
index 2aaa697..3a87e05 100644
--- a/tasks/sapnote/assert-2055470.yml
+++ b/tasks/sapnote/assert-2055470.yml
@@ -74,7 +74,7 @@
- name: Get and assert kernel tunables for ppc64le
include_tasks: ../RedHat/generic/sapnote-2055470-loop-block.yml
- loop: "{{ __sap_hana_preconfigure_kernel_parameters_default_ppc64le }}"
+ loop: "{{ sap_hana_preconfigure_kernel_parameters_ppc64le }}"
loop_control:
loop_var: line_item
when:
diff --git a/vars/RedHat_7.yml b/vars/RedHat_7.yml
index 585f304..9dc0d83 100644
--- a/vars/RedHat_7.yml
+++ b/vars/RedHat_7.yml
@@ -207,4 +207,12 @@ __sap_hana_preconfigure_kernel_parameters_default:
# So we do not change the default.
# - { name: net.ipv4.tcp_syn_retries, value: 8 }
+# Network related kernel parameters for ppc64le:
+__sap_hana_preconfigure_kernel_parameters_default_ppc64le:
+ - { name: net.core.rmem_max, value: 56623104 }
+ - { name: net.core.wmem_max, value: 56623104 }
+ - { name: net.ipv4.tcp_rmem, value: "65536 262088 56623104" }
+ - { name: net.ipv4.tcp_wmem, value: "65536 262088 56623104" }
+ - { name: net.ipv4.tcp_mem, value: "56623104 56623104 56623104" }
+
...
diff --git a/vars/RedHat_8.yml b/vars/RedHat_8.yml
index 2109126..843c034 100644
--- a/vars/RedHat_8.yml
+++ b/vars/RedHat_8.yml
@@ -205,4 +205,12 @@ __sap_hana_preconfigure_kernel_parameters_default:
# So we do not change the default.
# - { name: net.ipv4.tcp_syn_retries, value: 8 }
+# Network related kernel parameters for ppc64le:
+__sap_hana_preconfigure_kernel_parameters_default_ppc64le:
+ - { name: net.core.rmem_max, value: 56623104 }
+ - { name: net.core.wmem_max, value: 56623104 }
+ - { name: net.ipv4.tcp_rmem, value: "65536 262088 56623104" }
+ - { name: net.ipv4.tcp_wmem, value: "65536 262088 56623104" }
+ - { name: net.ipv4.tcp_mem, value: "56623104 56623104 56623104" }
+
...

View File

@ -1,26 +0,0 @@
commit 4d55594e2e1cba77a095f146b7498e00949f9678
Author: Bernd Finger <bfinger@redhat.com>
Date: Thu Mar 4 14:35:06 2021 +0100
typos in README.md
diff --git a/README.md b/README.md
index 50359b5..3f251d5 100644
--- a/README.md
+++ b/README.md
@@ -247,12 +247,12 @@ sap_hana_preconfigure_kernel_parameters:
### HANA kernel parameters for IBM POWER servers
[SAP Note 2055470](https://launchpad.support.sap.com/#/notes/2055470) contains links to IBM documents for SAP HANA on POWER.
-Among these is a document document which contains certain recommended Linux kernel settings for SAP HANA on POWER:
+Among these is a document which contains certain recommended Linux kernel settings for SAP HANA on POWER:
Network_Configuration_for_HANA_Workloads_on_IBM_Power_Servers_V7.1.pdf.
This document is linked from SAP note 2055470 via "SAP HANA on IBM Power Systems and IBM System Storage - Guides", then via
-"SAP on Linux and IBM Storage Guides (incl. HANA)", and then then via
+"SAP on Linux and IBM Storage Guides (incl. HANA)", and then via
"SAP on Power Linux Network and Fibre Channel Guides".
-The default parameter recommendations are also defined in ./vars/{{ansible_os_release}}.yml. If you need to add or change parameters
+The default parameter recommendations are defined in ./vars/{{ansible_os_release}}.yml. If you need to add or change parameters
for your system, copy these parameters from the vars file into the variable sap_hana_preconfigure_kernel_parameters_ppc64le and
add or change your settings, similar to the previous example.

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

@ -1,197 +0,0 @@
commit 7ffd72dcbb8cda6e9b12d9d9f23a20866b143d02
Author: Bernd Finger <bfinger@redhat.com>
Date: Tue Feb 23 18:52:16 2021 +0100
fix issues #163 and #164
diff --git a/README.md b/README.md
index b6f6232..74ca820 100644
--- a/README.md
+++ b/README.md
@@ -62,7 +62,7 @@ Do not run this role against an SAP HANA or other production system. The role wi
Changes
-------
-The previous version of this role used variable sap_hana_preconfigure_use_tuned_where_possible to switch between either tuned settings or kernel command line settings (where applicable).
+1) Previous versions of this role used variable sap_hana_preconfigure_use_tuned_where_possible to switch between either tuned settings or kernel command line settings (where applicable).
The current version modifies this behavior:
- The variable sap_hana_preconfigure_use_tuned_where_possible has been renamed to sap_hana_preconfigure_use_tuned
- The variable sap_hana_preconfigure_switch_to_tuned_profile_sap_hana has been removed.
@@ -70,6 +70,12 @@ The current version modifies this behavior:
If sap_hana_preconfigure_use_tuned is set to `no`, the role will perform a static configuration, including the modification of the linux command line in grub.
- The role can use tuned, or configure the kernel command line, or both.
+2) Previous versions of this role used variable sap_hana_preconfigure_selinux_state to set the SELinux state to disabled, which is mentioned in
+SAP notes 2292690 (RHEL 7) and 2777782 (RHEL 8). As role sap-preconfigure already allows to specify the desired SELinux state, and as
+sap-preconfigure is run before sap-hana-preconfigure, there is no need any more to let sap-hana-preconfigure configure the SELinux state.
+Same applies to the assertion of the SELinux state. Because of this, variable sap_hana_preconfigure_selinux_state has been removed from this role and
+tasks 2292690/08-disable-selinux.yml and 2777782/01-assert-selinux.yml have been commented out.
+
Role Variables
--------------
@@ -91,8 +97,8 @@ sap_hana_preconfigure_configuration
### Define configuration steps of SAP notes
For defining one or more configuration steps of SAP notes to be executed or checked only, set variable `sap_hana_preconfigure_config_all` to `no`, `sap_hana_preconfigure_configuration` to `yes`, and one or more of the following variables to `yes`:
```yaml
-sap_hana_preconfigure_2777782_[01...10], example: sap_hana_preconfigure_2777782_05
-sap_hana_preconfigure_2292690_[01...10], example: sap_hana_preconfigure_2292690_02
+sap_hana_preconfigure_2777782_[02...10], example: sap_hana_preconfigure_2777782_05
+sap_hana_preconfigure_2292690_[01...07,09,10], example: sap_hana_preconfigure_2292690_02
sap_hana_preconfigure_2009879_3_9
sap_hana_preconfigure_2009879_3_14_[1...4]
sap_hana_preconfigure_2009879_3_15
@@ -156,6 +162,19 @@ If you want the role to set the RHEL release to a certain fixed minor release (a
sap_hana_preconfigure_set_minor_release
```
+### Minimum package check
+The following variable will make sure packages are installed at minimum required versions as defined in files `vars/*.yml`. Default is `yes`.
+```yaml
+sap_hana_preconfigure_min_package_check
+```
+
+### Perform a yum update
+If the following variable is set to `yes`, the role will run a `yum update` before performing configuration changes. Default is `no`. \
+*Note*: The outcome of a `yum update` depends on the managed node's configuration for sticky OS minor version, see the description of the release option in `man subscription-manager`. For SAP HANA installations, setting a certain minor version with `subscscription-manager release --set=X.Y` is a strict requirement.
+```yaml
+sap_hana_preconfigure_update
+```
+
### Add the repository for IBM service and productivity tools for POWER (ppc64le only)
In case you do *not* want to automatically add the repository for the IBM service and productivity tools, set the following variable to `no`. Default is `yes`, meaning that the role will download and install the package specified in variable sap_hana_preconfigure_ibm_power_repo_url (see below) and also run the command /opt/ibm/lop/configure to accept the license.
```yaml
@@ -183,12 +202,6 @@ By setting the variable to `no`, the role will not fail if a reboot is required
sap_hana_preconfigure_fail_if_reboot_required
```
-### Define SELinux state
-The following variable allows for defining the desired SELinux state. Default is `disabled`.
-```yaml
-sap_hana_preconfigure_selinux_state
-```
-
### Use tuned profile sap-hana
By default, the role will activate tuned profile `sap-hana` for configuring kernel parameters (where possible). If you do not want to use the tuned profile sap-hana,
set the following variable to `no`. In this case, the role will also modify GRUB_CMDLINE_LINUX, no matter how variable `sap_hana_preconfigure_modify_grub_cmdline_linux` (see below) is set.
@@ -227,7 +240,7 @@ into the variable sap_hana_preconfigure_kernel_parameters and add or change your
```yaml
sap_hana_preconfigure_kernel_parameters:
- { name: net.core.somaxconn, value: 4096 }
- - { name: net.ipv4.tcp_max_syn_backlog, value: 8192}
+ - { name: net.ipv4.tcp_max_syn_backlog, value: 8192 }
- { name: net.ipv4.tcp_timestamps, value: 1 }
- { name: net.ipv4.tcp_slow_start_after_idle, value: 0 }
```
diff --git a/defaults/main.yml b/defaults/main.yml
index 50d8e14..b63c14b 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -24,7 +24,6 @@
## examples for RHEL8:
#sap_hana_preconfigure_2777782_03: yes
#sap_hana_preconfigure_2777782_10: yes
-#sap_hana_preconfigure_2772999_09: yes
## both:
#sap_hana_preconfigure_2382421: yes
@@ -107,7 +106,8 @@ sap_hana_preconfigure_ppcle_mtu9000_if: ''
## defaults to all interfaces
sap_hana_preconfigure_ppcle_tso_if: "{{ ansible_interfaces| difference(['lo']) }}"
-sap_hana_preconfigure_selinux_state: "{{ __sap_hana_preconfigure_selinux_state }}"
+# SELinux is already configured in role sap-preconfigure:
+#sap_hana_preconfigure_selinux_state: "{{ __sap_hana_preconfigure_selinux_state }}"
sap_hana_preconfigure_use_tuned: yes
diff --git a/tasks/RedHat/assert-installation.yml b/tasks/RedHat/assert-installation.yml
index eda7d22..55346b9 100644
--- a/tasks/RedHat/assert-installation.yml
+++ b/tasks/RedHat/assert-installation.yml
@@ -169,7 +169,7 @@
args:
warn: false
changed_when: false
- ignore_errors: "{{ sap_hana_preconfigure_ignore_errors|d(false) }}"
+ ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}"
when: sap_hana_preconfigure_update
- name: Assert that there are no more possible package updates
diff --git a/tasks/sapnote/2292690.yml b/tasks/sapnote/2292690.yml
index 8b4c95c..3137f22 100644
--- a/tasks/sapnote/2292690.yml
+++ b/tasks/sapnote/2292690.yml
@@ -22,7 +22,7 @@
- import_tasks: 2292690/07-disable-ksm.yml
when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_07|d(false)
-# We can skip the following task as it is already part of role sap-preconfigure:
+# SELinux is already configured in role sap-preconfigure:
#- import_tasks: 2292690/08-disable-selinux.yml
# when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_08|d(false)
diff --git a/tasks/sapnote/2777782.yml b/tasks/sapnote/2777782.yml
index ec4677f..8c904bb 100644
--- a/tasks/sapnote/2777782.yml
+++ b/tasks/sapnote/2777782.yml
@@ -1,8 +1,9 @@
---
# tasks file for sap-hana-preconfigure configuration
-- import_tasks: 2777782/01-disable-selinux.yml
- when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_01|d(false)
+# SELinux is already configured in role sap-preconfigure:
+#- import_tasks: 2777782/01-disable-selinux.yml
+# when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_01|d(false)
- import_tasks: 2777782/02-configure-tuned.yml
when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_02|d(false)
diff --git a/tasks/sapnote/assert-2292690.yml b/tasks/sapnote/assert-2292690.yml
index 588f6c8..b9a5cf2 100644
--- a/tasks/sapnote/assert-2292690.yml
+++ b/tasks/sapnote/assert-2292690.yml
@@ -25,9 +25,9 @@
- import_tasks: 2292690/07-assert-ksm.yml
when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_07|d(false)
-# The following task is already part of role sap-preconfigure:
-- import_tasks: 2292690/08-assert-selinux.yml
- when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_08|d(false)
+# SELinux is already configured in role sap-preconfigure:
+#- import_tasks: 2292690/08-assert-selinux.yml
+# when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_08|d(false)
- import_tasks: 2292690/09-assert-etc-sudoers.yml
when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_09|d(false)
diff --git a/tasks/sapnote/assert-2777782.yml b/tasks/sapnote/assert-2777782.yml
index e226e00..995960a 100644
--- a/tasks/sapnote/assert-2777782.yml
+++ b/tasks/sapnote/assert-2777782.yml
@@ -4,9 +4,9 @@
- debug:
msg: "sapnote/assert-2777782.yml"
-# The following task is already part of role sap-preconfigure:
-- import_tasks: 2777782/01-assert-selinux.yml
- when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_01|d(false)
+# SELinux is already configured in role sap-preconfigure:
+#- import_tasks: 2777782/01-assert-selinux.yml
+# when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_01|d(false)
- import_tasks: 2777782/02-assert-tuned.yml
when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_02|d(false)
diff --git a/vars/main.yml b/vars/main.yml
index 183f4a1..490b0fc 100644
--- a/vars/main.yml
+++ b/vars/main.yml
@@ -7,7 +7,8 @@
# Default parameter file for SYSCTL settings according to SAP NOTE 2382421
__sap_hana_preconfigure_etc_sysctl_saphana_conf: /etc/sysctl.d/sap_hana.conf
-__sap_hana_preconfigure_selinux_state: disabled
+# SELinux is already configured in role sap-preconfigure:
+#__sap_hana_preconfigure_selinux_state: disabled
__sap_hana_preconfigure_run_grub2_mkconfig: yes

View File

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

View File

@ -0,0 +1,19 @@
diff -up sap-hana-preconfigure/README.md.me sap-hana-preconfigure/README.md
--- sap-hana-preconfigure/README.md.me 2021-03-22 14:08:21.960414814 +0100
+++ sap-hana-preconfigure/README.md 2021-03-22 14:10:28.220020075 +0100
@@ -216,13 +216,13 @@ In case you want the role to set or chec
sap_hana_preconfigure_use_netapp_settings_nfsv3
```
-### Add the repository for IBM service and productivity tools for POWER (ppc64le only)
+### Add the repository for IBM service and productivity tools (ppc64le only)
In case you do *not* want to automatically add the repository for the IBM service and productivity tools, set the following variable to `no`. Default is `yes`, meaning that the role will download and install the package specified in variable sap_hana_preconfigure_ibm_power_repo_url (see below) and also run the command /opt/ibm/lop/configure to accept the license.
```yaml
sap_hana_preconfigure_add_ibm_power_repo
```
-### URL for IBM service and productivity tools for POWER (ppc64le only)
+### URL for IBM service and productivity tools (ppc64le only)
The following variable is set to the location of package ibm-power-repo-lastest.noarch.rpm or a package with similar contents, as defined by variable __sap_hana_preconfigure_ibm_power_repo_url in vars/RedHat_7.yml and vars/RedHat_8.yml.
You can replace it by your own URL by setting this variable to a different URL.
```yaml

View File

@ -0,0 +1,57 @@
diff -up sap-netweaver-preconfigure/tasks/main.yml.me sap-netweaver-preconfigure/tasks/main.yml
--- sap-netweaver-preconfigure/tasks/main.yml.me 2021-07-16 20:47:31.917915614 +0200
+++ sap-netweaver-preconfigure/tasks/main.yml 2021-07-16 20:49:14.545505014 +0200
@@ -7,7 +7,7 @@
- name: Include os specific vars
include_vars: '{{ item }}'
with_first_found:
- - '{{ ansible_distibution }}_{{ ansible_distribution_version }}.yml'
+ - '{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml'
- '{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml'
- '{{ ansible_os_family }}.yml'
diff -up sap-netweaver-preconfigure/vars/RedHat_9.yml.me sap-netweaver-preconfigure/vars/RedHat_9.yml
--- sap-netweaver-preconfigure/vars/RedHat_9.yml.me 2021-07-16 20:47:58.990334885 +0200
+++ sap-netweaver-preconfigure/vars/RedHat_9.yml 2021-07-16 20:48:15.158585284 +0200
@@ -0,0 +1,41 @@
+---
+
+# vars file for sap-netweaver-preconfigure
+
+__sap_netweaver_preconfigure_sapnotes:
+ - "2526952"
+
+__sap_netweaver_preconfigure_packages:
+ - tuned-profiles-sap
+
+__sap_netweaver_preconfigure_min_swap_space_mb: '20480'
+
+__sap_netweaver_preconfigure_adobe_doc_services_packages:
+ - autoconf.noarch
+ - automake.noarch
+ - cyrus-sasl.x86_64
+ - expat.x86_64
+ - fontconfig.x86_64
+ - glibc-devel.i686
+ - keyutils-libs.x86_64
+ - krb5-libs.x86_64
+ - libcom_err.x86_64
+ - libidn2.x86_64
+ - libselinux.x86_64
+ - libssh2.x86_64
+ - libxcb.i686
+ - nspr.x86_64
+ - nss.x86_64
+ - nss-softokn.x86_64
+ - nss-softokn-freebl.x86_64
+ - nss-util.x86_64
+ - openldap.x86_64
+ - openssl.x86_64
+ - zlib.x86_64
+ - libstdc++.i686
+ - libX11.i686
+ - libXau.i686
+ - glibc.i686
+ - libstdc++.i686
+ - libgcc.i686
+ - libuuid.i686

View File

@ -1,24 +0,0 @@
commit 2bc922671e92c12d3954c249c51d4281e12d1274
Author: Bernd Finger <bfinger@redhat.com>
Date: Thu Mar 4 22:37:21 2021 +0100
solve issue #130
diff --git a/tasks/assert-installation.yml b/tasks/assert-installation.yml
index ae8c144..74a0378 100644
--- a/tasks/assert-installation.yml
+++ b/tasks/assert-installation.yml
@@ -16,10 +16,9 @@
- name: Assert that all required RHEL 7 package groups are installed
assert:
- that:
- - "'{{ line_item|replace(\'@\', \'\') }}' in yum_group_result.stdout_lines"
- fail_msg: "FAIL: Package group '{{ line_item|replace(\'@\', \'\') }}' is not installed!"
- success_msg: "PASS: Package group '{{ line_item|replace(\'@\', \'\') }}' is installed."
+ that: "'{{ line_item|replace(\"@\", \"\") }}' in yum_group_result.stdout_lines"
+ fail_msg: "FAIL: Package group '{{ line_item|replace(\"@\", \"\") }}' is not installed!"
+ success_msg: "PASS: Package group '{{ line_item|replace(\"@\", \"\") }}' is installed."
with_items:
- "{{ __sap_preconfigure_packagegroups }}"
loop_control:

View File

@ -1,49 +0,0 @@
commit 6169bd8d447ce60012f7fd8a3d664a1bae2b3c0a
Author: Bernd Finger <bfinger@redhat.com>
Date: Tue Feb 23 18:56:13 2021 +0100
fix issue #125
diff --git a/tasks/RedHat/generic/assert-etc-hosts.yml b/tasks/RedHat/generic/assert-etc-hosts.yml
index 3304d73..b8d8830 100644
--- a/tasks/RedHat/generic/assert-etc-hosts.yml
+++ b/tasks/RedHat/generic/assert-etc-hosts.yml
@@ -54,8 +54,10 @@
success_msg: "PASS: There is only one line containing '{{ sap_ip }}' in /etc/hosts."
ignore_errors: "{{ sap_preconfigure_assert_ignore_errors|d(false) }}"
-- name: Check for duplicate entries of {{ sap_hostname }}.{{ sap_domain }} in /etc/hosts
- command: awk 'BEGIN{a=0}/{{ sap_hostname }}.{{ sap_domain }}/{a++}END{print a}' /etc/hosts
+- name: Check for duplicate or missing entries of {{ sap_hostname }}.{{ sap_domain }} in /etc/hosts
+ command: awk '/^{{ sap_hostname }}.{{ sap_domain }} /||
+ / {{ sap_hostname }}.{{ sap_domain }} /||
+ / {{ sap_hostname }}.{{ sap_domain }}$/{a++}END{print a}' /etc/hosts
register: __shell_03_result
ignore_errors: yes
changed_when: no
@@ -67,8 +69,10 @@
success_msg: "PASS: There is only one line containing '{{ sap_hostname }}.{{ sap_domain }}' in /etc/hosts."
ignore_errors: "{{ sap_preconfigure_assert_ignore_errors|d(false) }}"
-- name: Check for duplicate entries of {{ sap_hostname }} in /etc/hosts
- command: awk 'BEGIN{a=0}/{{ sap_hostname }}/{a++}END{print a}' /etc/hosts
+- name: Check for duplicate or missing entries of {{ sap_hostname }} in /etc/hosts
+ command: awk '/^{{ sap_hostname }} /||
+ / {{ sap_hostname }} /||
+ / {{ sap_hostname }}$/{a++}END{print a}' /etc/hosts
register: __shell_04_result
ignore_errors: yes
changed_when: no
diff --git a/tasks/RedHat/generic/configure-etc-hosts.yml b/tasks/RedHat/generic/configure-etc-hosts.yml
index 2ae3a18..0a1ec59 100644
--- a/tasks/RedHat/generic/configure-etc-hosts.yml
+++ b/tasks/RedHat/generic/configure-etc-hosts.yml
@@ -97,7 +97,7 @@
- name: Check for duplicate or missing entries of hostname and fqdn in /etc/hosts
shell: |
- n=$(grep -w "{{ line_item }}" /etc/hosts | wc -l)
+ n=$(awk '/^{{ line_item }} /||/ {{ line_item }} /||/ {{ line_item }}$/{a++}END{print a}' /etc/hosts)
if [ $n -eq 1 ]; then
exit 0
else

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,29 @@
commit 69de334fecbce65506bbea15b1b9bcd643528352
Author: Bernd Finger <bfinger@redhat.com>
Date: Wed Aug 11 21:50:14 2021 +0200
Solve issue #149
diff --git a/tasks/installation.yml b/tasks/installation.yml
index 7dbab15..096c993 100644
--- a/tasks/installation.yml
+++ b/tasks/installation.yml
@@ -1,9 +1,15 @@
---
- name: Ensure required package groups are installed
- package:
- state: present
- name: "{{ sap_preconfigure_packagegroups }}"
+# 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.
+ command: yum install "{{ sap_preconfigure_packagegroups|join('')|quote }}" --nobest --exclude="kernel*" -y
+ args:
+ warn: false
+ register: __sap_preconfigure_register_yum_group_install
+
+- debug:
+ var: __sap_preconfigure_register_yum_group_install
- name: Ensure required packages are installed
package:

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

View File

@ -1,34 +1,148 @@
Name: rhel-system-roles-sap
%if 0%{?rhel} && ! 0%{?epel}
%bcond_with ansible
%else
%bcond_without ansible
%endif
%bcond_with collection_artifact
%if 0%{?fedora} || 0%{?rhel} >= 8
%bcond_without html
%else
# pandoc is not supported in rhel 7 and older,
# which is needed for converting .md to .html.
%bcond_with html
%endif
%global collection_namespace sap
%if 0%{?rhel}
%define package_name rhel-system-roles-sap
%global collection_name rhel
%else
%define package_name linux-system-roles-sap
%global collection_name linux
%endif
%global mainid ec364d2e0bd422b69f34871a1188114f368097a0
%global gitcommit_sap 9bed558b55cedc8939f6b3d4436436a6aaaf095c
%global gitcommit_sap_hana 9f22b540bc41e2d10fbc1250b36a7ef08129feb2
%global gitcommit_sap_netweaver 337ba5580ba862e1adac59dcda8a126cdf561225
%global rolename1 sap-preconfigure
%global rolename2 sap-hana-preconfigure
%global rolename3 sap-netweaver-preconfigure
%global src_owner linux-system-roles
Name: %{package_name}
Summary: System Roles to configure RHEL for running SAP NetWeaver- or SAP HANA-based products
Version: 3.0.1
Release: 4%{?dist}.alma
Version: 3.1.1
Release: 6%{?dist}.alma
License: GPLv3+
Url: https://github.com/berndfinger
Source0: https://github.com/berndfinger/sap-preconfigure/releases/download/3.0.1/sap-preconfigure.tar.gz
Source1: https://github.com/berndfinger/sap-hana-preconfigure/releases/download/3.0.1/sap-hana-preconfigure.tar.gz
Source2: https://github.com/berndfinger/sap-netweaver-preconfigure/releases/download/3.0.1/sap-netweaver-preconfigure.tar.gz
Source0: https://github.com/linux-system-roles/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz
Source1: https://github.com/berndfinger/sap-preconfigure/archive/%{gitcommit_sap}/sap-preconfigure-%{gitcommit_sap}.tar.gz
Source2: https://github.com/berndfinger/sap-hana-preconfigure/archive/%{gitcommit_sap_hana}/sap-hana-preconfigure-%{gitcommit_sap_hana}.tar.gz
Source3: https://github.com/berndfinger/sap-netweaver-preconfigure/archive/%{gitcommit_sap_netweaver}/sap-netweaver-preconfigure-%{gitcommit_sap_netweaver}.tar.gz
Source4: README.md
Source5: galaxy.yml
# patches 0-49 for sap-preconfigure
Patch0: sap-preconfigure-6169bd8d447ce60012f7fd8a3d664a1bae2b3c0a.patch
Patch1: sap-preconfigure-2bc922671e92c12d3954c249c51d4281e12d1274.patch
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-7ffd72dcbb8cda6e9b12d9d9f23a20866b143d02.patch
Patch51: sap-hana-preconfigure-3714dbb80889e65fb7152456fe262ab1fcc5e3e5.patch
Patch52: sap-hana-preconfigure-29003efa866e8f691076023ccf2eede2032173d6.patch
Patch53: sap-hana-preconfigure-4d55594e2e1cba77a095f146b7498e00949f9678.patch
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
BuildArch: noarch
Requires: uuidd
%if %{with html}
# Requirements for md2html.sh to build the documentation
%if 0%{?fedora} || 0%{?rhel} >= 9
BuildRequires: rubygem-kramdown-parser-gfm
%else
BuildRequires: pandoc
BuildRequires: asciidoc
BuildRequires: highlight
%endif
%endif
# Requirements for galaxy_transform.py
BuildRequires: python3
%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: python3dist(ruamel.yaml)
Requires: python3-jmespath
Requires: python3-netaddr
%else
BuildRequires: python3-ruamel-yaml
Requires: python-jmespath
Requires: python-netaddr
%endif
%if %{with ansible}
BuildRequires: ansible >= 2.9.10
%endif
%global collection_version %{version}
%if %{undefined __ansible_provides}
Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{collection_version}
%endif
# be compatible with the usual Fedora Provides:
Provides: ansible-collection-%{collection_namespace}-%{collection_name} = %{version}-%{release}
%{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/}
%if %{undefined ansible_collection_build}
%if %{without ansible}
# Empty command. We don't have ansible-galaxy.
%define ansible_collection_build() :
%else
%define ansible_collection_build() ansible-galaxy collection build
%endif
%endif
%if %{undefined ansible_collection_install}
%if %{without ansible}
# Simply copy everything instead of galaxy-installing the built artifact.
%define ansible_collection_install() mkdir -p %{buildroot}%{ansible_collection_files}; cp -a . %{buildroot}%{ansible_collection_files}/%{collection_name}/
%else
%define ansible_collection_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{version}.tar.gz
%endif
%endif
%description
Collection of Ansible roles which configures a RHEL system according
to applicable SAP notes so that any SAP software can be installed.
%if %{with collection_artifact}
%package collection-artifact
Summary: Collection artifact to import to Automation Hub / Ansible Galaxy
%description collection-artifact
Collection artifact for %{name}. This package contains %{collection_namespace}-%{collection_name}-%{version}.tar.gz
%endif
%prep
%setup -q -T -c -n %{name}-%{version} -a 0 -a 1 -a 2
%setup -q -a1 -a2 -a3 -n auto-maintenance-%{mainid}
# rename the source directories without gitcommit_sap
mv sap-preconfigure-%{gitcommit_sap} sap-preconfigure
mv sap-hana-preconfigure-%{gitcommit_sap_hana} sap-hana-preconfigure
mv sap-netweaver-preconfigure-%{gitcommit_sap_netweaver} sap-netweaver-preconfigure
# cp own galaxy.yml and rename the collection name correctly for Automation Hub and Galaxy
mkdir .collections
cp %{SOURCE5} galaxy.yml
sed -i -e 's|name: rhel|name: %{collection_name}|' galaxy.yml
pushd sap-preconfigure
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
popd
pushd sap-hana-preconfigure
%patch50 -p1
@ -36,25 +150,68 @@ pushd sap-hana-preconfigure
%patch52 -p1
%patch53 -p1
popd
pushd sap-netweaver-preconfigure
%patch100 -p1
popd
# remove all SLES stuff
rm -rf sap-hana-preconfigure/tasks/SLES
rm -rf sap-hana-preconfigure/tasks/SLES15
rm -rf sap-hana-preconfigure/tasks/sapnote/1275776 # SLES - sapconf, saptune, etc
rm -rf sap-hana-preconfigure/tasks/sapnote/1944799* # SLES - HANA install and config guidelines
rm -rf sap-hana-preconfigure/tasks/sapnote/2578899 # SLES 15 - installation
rm -rf sap-hana-preconfigure/tasks/sapnote/2684254 # SLES 15 - OS settings for HANA
rm -f sap-hana-preconfigure/vars/SLES_15.yml
# remove all RHEL 6 stuff
rm -f sap-hana-preconfigure/tasks/sapnote/2013638.yml # RHEL 6.5 - OS settings
rm -f sap-hana-preconfigure/tasks/sapnote/2136965.yml # RHEL 6.6 - OS settings
rm -f sap-hana-preconfigure/tasks/sapnote/2247020.yml # RHEL 6.7 - OS settings
rm -f sap-hana-preconfigure/vars/RedHat_6.5.yml
rm -f sap-hana-preconfigure/vars/RedHat_6.6.yml
rm -f sap-hana-preconfigure/vars/RedHat_6.7.yml
# remove git stuff
rm -rf *-preconfigure/.git*
# remove zero file
rm -f sap-hana-preconfigure/tasks/RedHat_6/recommendations.yml
# remove all SLES stuff and RHEL 6 stuff
rm -rf sap-hana-preconfigure/tasks/SLES/
rm -rf sap-hana-preconfigure/tasks/sapnote/1275776 # SLES - sapconf, saptune, etc
rm -rf sap-hana-preconfigure/tasks/sapnote/1944799 # SLES - HANA install and config guidelines
rm -f sap-hana-preconfigure/tasks/sapnote/1944799.yml
rm -f sap-hana-preconfigure/tasks/sapnote/2013638.yml # RHEL 6.5 - OS settings
rm -f sap-hana-preconfigure/tasks/sapnote/2136965.yml # RHEL 6.6 - OS settings
rm -f sap-hana-preconfigure/tasks/sapnote/2247020.yml # RHEL 6.7 - OS settings
rm -rf sap-hana-preconfigure/tasks/sapnote/2578899 # SLES 15 - installation
rm -rf sap-hana-preconfigure/tasks/sapnote/2684254 # SLES 15 - OS settings for HANA
rm -f sap-hana-preconfigure/vars/RedHat_6.5.yml
rm -f sap-hana-preconfigure/vars/RedHat_6.6.yml
rm -f sap-hana-preconfigure/vars/RedHat_6.7.yml
rm -f sap-hana-preconfigure/vars/SLES_15.yml
%build
sh md2html.sh \
sap-preconfigure/README.md \
sap-hana-preconfigure/README.md \
sap-netweaver-preconfigure/README.md
for role in %{rolename1} %{rolename2} %{rolename3} ; do
new_role="$(echo ${role/sap-/} | tr '-' '_')"
python3 lsr_role2collection.py --role "$role" \
--src-path "$role" \
--src-owner %{src_owner} \
--dest-path .collections \
--readme %{SOURCE4} \
--namespace %{collection_namespace} \
--collection %{collection_name} \
--new-role "$new_role" \
--extra-mapping "timesync:redhat.rhel_system_roles.timesync,storage:redhat.rhel_system_roles.storage,sap-preconfigure:sap.rhel.preconfigure,sap-hana-preconfigure:sap.rhel.hana_preconfigure,sap-netweaver-preconfigure:sap.rhel.netweaver_preconfigure"
done
rm -f .collections/ansible_collections/%{collection_namespace}/%{collection_name}/tests/sanity/ignore-2.9.txt
# Merge .sanity-ansible-ignore-2.9-ROLENAME.txt into tests/sanity/ignore-2.9.txt
for role in %{rolenames}; do
if [ -f .collections/ansible_collections/%{collection_namespace}/%{collection_name}/.sanity-ansible-ignore-2.9-"$role".txt ];
then
cat .collections/ansible_collections/%{collection_namespace}/%{collection_name}/.sanity-ansible-ignore-2.9-"$role".txt \
>> .collections/ansible_collections/%{collection_namespace}/%{collection_name}/tests/sanity/ignore-2.9.txt
rm -f .collections/ansible_collections/%{collection_namespace}/%{collection_name}/.sanity-ansible-ignore-*-"$role".txt
fi
done
# removing dot files/dirs
rm -rf .collections/ansible_collections/%{collection_namespace}/%{collection_name}/.[A-Za-z]*
cp -p galaxy.yml lsr_role2collection/.ansible-lint \
.collections/ansible_collections/%{collection_namespace}/%{collection_name}
# build collection file
cd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
%ansible_collection_build
%install
mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles \
@ -62,14 +219,27 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles \
$RPM_BUILD_ROOT%{_pkgdocdir}/sap-preconfigure \
$RPM_BUILD_ROOT%{_pkgdocdir}/sap-netweaver-preconfigure
# drop zero file
rm -f */.gitignore sap-hana-preconfigure/tasks/RedHat_6/recommendations.yml
cp -pR sap-hana-preconfigure sap-preconfigure sap-netweaver-preconfigure $RPM_BUILD_ROOT%{_datadir}/ansible/roles/
cp -p sap-hana-preconfigure/{README.md,LICENSE} $RPM_BUILD_ROOT%{_pkgdocdir}/sap-hana-preconfigure/
cp -p sap-preconfigure/{README.md,LICENSE} $RPM_BUILD_ROOT%{_pkgdocdir}/sap-preconfigure/
cp -p sap-netweaver-preconfigure/{README.md,LICENSE} $RPM_BUILD_ROOT%{_pkgdocdir}/sap-netweaver-preconfigure/
# install collection files
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
%ansible_collection_install
popd
# install collection_artifact
%if %{with collection_artifact}
# Copy collection artifact to /usr/share/ansible/collections/ for collection-artifact
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
if [ -f %{collection_namespace}-%{collection_name}-%{version}.tar.gz ]; then
mv %{collection_namespace}-%{collection_name}-%{version}.tar.gz \
$RPM_BUILD_ROOT%{_datadir}/ansible/collections/
fi
popd
%endif
%files
%dir %{_pkgdocdir}
%dir %{_pkgdocdir}/sap-preconfigure
@ -80,8 +250,36 @@ cp -p sap-netweaver-preconfigure/{README.md,LICENSE} $RPM_BUILD_ROOT%{_pkgdocdir
%doc %{_pkgdocdir}/*/README.md
%license %{_pkgdocdir}/*/LICENSE
%{_datadir}/ansible/roles/*
%{ansible_collection_files}
%if %{with collection_artifact}
%files collection-artifact
%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name}-%{version}.tar.gz
%endif
%changelog
* Wed Sep 08 2021 Than Ngo <than@redhat.com> - 3.1.1-6
- set min kernel version for RHEL 8.4 x86_64
- use grubby for setting tsx=on
- add tsx=on to the kernel command line unconditionally
* Wed Sep 01 2021 Than Ngo <than@redhat.com> - 3.1.1-5
- Related: #1928398, fix yum group install errors on RHEL 7
* Fri Aug 20 2021 Than Ngo <than@redhat.com> - 3.1.1-4
- Related: #1928398, fix #149, #177, #193, #194
* Mon Jul 12 2021 Than Ngo <than@redhat.com> - 3.1.1-3
- add missing __sap_preconfigure_envgroups for RHEL 7.x
- add __sap_hana_preconfigure_req_repos variables for RHEL 8.5 and later
Related: #1928398
* Thu Jul 01 2021 Than Ngo <than@redhat.com> - 3.1.1-2
- Related: #1928398, add missing changelogs
* Tue Jun 29 2021 Than Ngo <than@redhat.com> - 3.1.1-1
- Resolves: #1928398, rebase to 3.1.1 for Ansible Collections
* Fri Mar 05 2021 Than Ngo <than@redhat.com> - 3.0.1-4
- fixed issue #130 in sap-preconfigure
- fixed typos in README.md in sap_hana_preconfigure