Compare commits

...

No commits in common. "c8" and "c8s" have entirely different histories.
c8 ... c8s

14 changed files with 1024 additions and 427 deletions

6
.gitignore vendored
View File

@ -1,3 +1,3 @@
SOURCES/auto-maintenance-e2a233f5a0cb68363798bf014b16552cca681bd0.tar.gz
SOURCES/community.sap_install-f0deb287aaa0fb7d992b95a04b14e263b6690c23.tar.gz
SOURCES/prepare-redhat.sap_install-main.tar.bz2
SOURCES/sap-hana-preconfigure.tar.gz
SOURCES/sap-netweaver-preconfigure.tar.gz
SOURCES/sap-preconfigure.tar.gz

View File

@ -1,3 +1,3 @@
584f8d1681adf13cb7af256a7b38d94ca80dcab2 SOURCES/auto-maintenance-e2a233f5a0cb68363798bf014b16552cca681bd0.tar.gz
d991a279d5d4b5a991f229a29d20e772132af519 SOURCES/community.sap_install-f0deb287aaa0fb7d992b95a04b14e263b6690c23.tar.gz
017c84ab579375755b104b85d5eb77b26a117a80 SOURCES/prepare-redhat.sap_install-main.tar.bz2
9ecaedd62786d616eb51fc09893537ebd8ff7e4f SOURCES/sap-hana-preconfigure.tar.gz
435e268e5adf767c382df673b6ee4bac7ddc55a8 SOURCES/sap-netweaver-preconfigure.tar.gz
8d8de726e02ee97fe2346938c22d891ea31efa2d SOURCES/sap-preconfigure.tar.gz

View File

@ -1,90 +0,0 @@
diff -up community.sap_install/roles/sap_general_preconfigure/tests/run-sap_general_preconfigure-tests.py.me community.sap_install/roles/sap_general_preconfigure/tests/run-sap_general_preconfigure-tests.py
--- community.sap_install/roles/sap_general_preconfigure/tests/run-sap_general_preconfigure-tests.py.me 2022-07-12 16:23:48.262581739 +0200
+++ community.sap_install/roles/sap_general_preconfigure/tests/run-sap_general_preconfigure-tests.py 2022-07-12 16:36:43.620709628 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
"""
Tests for role sap_general_preconfigure
diff -up community.sap_install/roles/sap_hana_install/tests/install/run-sap_hana_install-install-tests.py.me community.sap_install/roles/sap_hana_install/tests/install/run-sap_hana_install-install-tests.py
--- community.sap_install/roles/sap_hana_install/tests/install/run-sap_hana_install-install-tests.py.me 2022-07-12 16:36:52.262900877 +0200
+++ community.sap_install/roles/sap_hana_install/tests/install/run-sap_hana_install-install-tests.py 2022-07-12 16:36:59.246055414 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import os
import sys
diff -up community.sap_install/roles/sap_hana_install/tests/sapcar/run-sap_hana_install-sapcar-tests.py.me community.sap_install/roles/sap_hana_install/tests/sapcar/run-sap_hana_install-sapcar-tests.py
--- community.sap_install/roles/sap_hana_install/tests/sapcar/run-sap_hana_install-sapcar-tests.py.me 2022-07-12 16:37:17.272454327 +0200
+++ community.sap_install/roles/sap_hana_install/tests/sapcar/run-sap_hana_install-sapcar-tests.py 2022-07-12 16:37:24.142606360 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import os
import sys
diff -up community.sap_install/roles/sap_hana_preconfigure/tests/run-sap_hana_preconfigure-tests.py.me community.sap_install/roles/sap_hana_preconfigure/tests/run-sap_hana_preconfigure-tests.py
--- community.sap_install/roles/sap_hana_preconfigure/tests/run-sap_hana_preconfigure-tests.py.me 2022-07-12 16:37:52.794240408 +0200
+++ community.sap_install/roles/sap_hana_preconfigure/tests/run-sap_hana_preconfigure-tests.py 2022-07-12 16:37:58.553367854 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
"""
Tests for role sap_hana_preconfigure
diff -up community.sap_install/roles/sap_netweaver_preconfigure/tests/run-sap_netweaver_preconfigure-tests.py.me community.sap_install/roles/sap_netweaver_preconfigure/tests/run-sap_netweaver_preconfigure-tests.py
--- community.sap_install/roles/sap_netweaver_preconfigure/tests/run-sap_netweaver_preconfigure-tests.py.me 2022-07-12 16:37:34.384833016 +0200
+++ community.sap_install/roles/sap_netweaver_preconfigure/tests/run-sap_netweaver_preconfigure-tests.py 2022-07-12 16:37:41.495990384 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
"""
Tests for role sap_netweaver_preconfigure
diff -up community.sap_install/tools/swpm2_parameters_inifile_generate.py.me community.sap_install/tools/swpm2_parameters_inifile_generate.py
--- community.sap_install/tools/swpm2_parameters_inifile_generate.py.me 2022-07-12 16:38:10.026621753 +0200
+++ community.sap_install/tools/swpm2_parameters_inifile_generate.py 2022-07-12 16:38:29.915061875 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff -up community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_general_preconfigure/tools/beautify-assert-output.sh.me community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_general_preconfigure/tools/beautify-assert-output.sh
--- community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_general_preconfigure/tools/beautify-assert-output.sh.me 2022-07-12 17:48:10.476508351 +0200
+++ community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_general_preconfigure/tools/beautify-assert-output.sh 2022-07-12 17:48:27.813896005 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/bash
# default font color: Light Cyan, which should be readable on both bright and dark background
__FONT_COLOR=36m
diff -up community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_hana_install/files/tmp/tail-f-hdblcm-install-trc.sh.me community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_hana_install/files/tmp/tail-f-hdblcm-install-trc.sh
--- community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_hana_install/files/tmp/tail-f-hdblcm-install-trc.sh.me 2022-07-12 17:48:35.527068474 +0200
+++ community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_hana_install/files/tmp/tail-f-hdblcm-install-trc.sh 2022-07-12 17:48:43.703251292 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/bash
while true; do
# in case hdblcm has not yet started, we assume that it is waiting for sapdsigner to complete:
diff -up community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_hana_preconfigure/tools/beautify-assert-output.sh.me community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_hana_preconfigure/tools/beautify-assert-output.sh
--- community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_hana_preconfigure/tools/beautify-assert-output.sh.me 2022-07-12 17:49:22.425117059 +0200
+++ community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_hana_preconfigure/tools/beautify-assert-output.sh 2022-07-12 17:49:30.241291825 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/bash
# default font color: Light Cyan, which should be readable on both bright and dark background
__FONT_COLOR=36m
diff -up community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_netweaver_preconfigure/tools/beautify-assert-output.sh.me community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_netweaver_preconfigure/tools/beautify-assert-output.sh
--- community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_netweaver_preconfigure/tools/beautify-assert-output.sh.me 2022-07-12 17:48:51.584427510 +0200
+++ community.sap_install-29b37456211c8bf825547f614652f24cf324860a/roles/sap_netweaver_preconfigure/tools/beautify-assert-output.sh 2022-07-12 17:49:00.678630847 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/bash
# default font color: Light Cyan, which should be readable on both bright and dark background
__FONT_COLOR=36m

View File

@ -0,0 +1,19 @@
commit 063273dd09715cfcf69bcf3c1f4347225028ba70
Author: Bernd Finger <bfinger@redhat.com>
Date: Mon Jun 22 15:09:17 2020 +0200
"@" needs to be prepended to sap_hana_preconfigure_db_group_name
diff --git a/tasks/sapnote/2772999.yml b/tasks/sapnote/2772999.yml
index 557ae32..538ff1a 100644
--- a/tasks/sapnote/2772999.yml
+++ b/tasks/sapnote/2772999.yml
@@ -21,7 +21,7 @@
- name: Set the hard and soft limit for the max number of open files per process (nproc) to unlimited for the database group
pam_limits:
dest: /etc/security/limits.d/99-sap.conf
- domain: "{{ sap_hana_preconfigure_db_group_name }} "
+ domain: "@{{ sap_hana_preconfigure_db_group_name }}"
limit_item: nproc
limit_type: "{{ line_item }}"
value: unlimited

View File

@ -0,0 +1,213 @@
commit a622092d5063c2fb0d7996775521a52549e3a65a
Author: Bernd Finger <bfinger@redhat.com>
Date: Mon Jun 22 22:35:59 2020 +0200
some improvements according to pull request 100 feedbacks
variables should be in vars files in the same order as they are used in tasks
diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml
index fcacce6..0a8e1c2 100644
--- a/tasks/RedHat/installation.yml
+++ b/tasks/RedHat/installation.yml
@@ -112,43 +112,20 @@
{% endfor %}
{{ ns.pkgs }}
-# - name: check if minimum release needs to be installed
-# shell: |
-# set -x
-# required_pkg={{ pkg | join('-') }}
-# newest=$(echo -e "$required_pkg\n$(rpm -q {{ pkg[0] }} )"| sed "s,\.el,.0.0.," | sort -V | tail -1)
-# if [ $newest == ${required_pkg/.el/.0.0.} ]; then
-# echo $newest
-# fi
-# loop: "{{ __sap_hana_preconfigure_min_pkgs }}"
-# loop_control:
-# loop_var: pkg
-# check_mode: no
-# register: sap_hana_preconfigure_register_minpkglist
-# changed_when: false
-
-# - name: Initialize an empty list for our strings
-# set_fact:
-# sap_hana_preconfigure_fact_minpkglist: []
-
-# - name: Create list of packages to be installed
-# set_fact:
-# sap_hana_preconfigure_fact_minpkglist: "{{ sap_hana_preconfigure_fact_minpkglist | difference(['']) + [ pkg.stdout ] }}"
-# loop: "{{ sap_hana_preconfigure_register_minpkglist.results }}"
-# loop_control:
-# loop_var: pkg
-
- debug: var=sap_hana_preconfigure_fact_minpkglist
+# yum:
- name: Install minimum packages if required
- yum:
+ package:
name: "{{ sap_hana_preconfigure_fact_minpkglist }}"
state: present
- when: not ( sap_hana_preconfigure_fact_minpkglist == [ "" ] )
+ when: sap_hana_preconfigure_fact_minpkglist | d([])
+# when: not ( sap_hana_preconfigure_fact_minpkglist == [ "" ] )
when:
- sap_hana_preconfigure_min_package_check|bool
- - not( (__sap_hana_preconfigure_min_pkgs is undefined) or (__sap_hana_preconfigure_min_pkgs is none) or (__sap_hana_preconfigure_min_pkgs | trim == '') )
+ - __sap_hana_preconfigure_min_pkgs | d([])
+# - not( (__sap_hana_preconfigure_min_pkgs is undefined) or (__sap_hana_preconfigure_min_pkgs is none) or (__sap_hana_preconfigure_min_pkgs | trim == '') )
- set_fact:
needs_restarting_command: "needs-restarting -r"
diff --git a/vars/RedHat_7.yml b/vars/RedHat_7.yml
index 8ac6939..3978317 100644
--- a/vars/RedHat_7.yml
+++ b/vars/RedHat_7.yml
@@ -16,33 +16,6 @@ __sap_hana_preconfigure_sapnotes:
- "2292690"
- "2382421"
-# As per https://www14.software.ibm.com/support/customercare/sas/f/lopdiags/home.html :
-__sap_hana_preconfigure_required_ppc64le:
- - librtas
- - src
- - rsct.core.utils
- - rsct.core
- - rsct.basic
- - rsct.opt.storagerm
- - devices.chrp.base.ServiceRM
- - DynamicRM
- - ncurses-libs
- - readline
- - sqlite
- - sg3_utils
- - libgcc
- - libstdc++
- - zlib
- - iprutils
- - lsvpd
- - libvpd
- - libservicelog
- - servicelog
- - powerpc-utils
- - powerpc-utils-python
- - ppc64-diag
- - IBMinvscout
-
# In SAP Note 2235581, certain minimal required packages for the different RHEL 7 minor releases are listed.
# The following will assign them properly to __sap_hana_preconfigure_min_pkgs.
# If variable __sap_hana_preconfigure_min_packages_VERSION is not defined,
@@ -123,6 +96,33 @@ __sap_hana_preconfigure_packages:
# libtool-ltdl: See https://answers.sap.com/questions/476177/hana-db-installation-ended-with-exit-code-127.html
# This is required since HANA 2 SPS 03, and so we always install it.
+# As per https://www14.software.ibm.com/support/customercare/sas/f/lopdiags/home.html :
+__sap_hana_preconfigure_required_ppc64le:
+ - librtas
+ - src
+ - rsct.core.utils
+ - rsct.core
+ - rsct.basic
+ - rsct.opt.storagerm
+ - devices.chrp.base.ServiceRM
+ - DynamicRM
+ - ncurses-libs
+ - readline
+ - sqlite
+ - sg3_utils
+ - libgcc
+ - libstdc++
+ - zlib
+ - iprutils
+ - lsvpd
+ - libvpd
+ - libservicelog
+ - servicelog
+ - powerpc-utils
+ - powerpc-utils-python
+ - ppc64-diag
+ - IBMinvscout
+
# Network related kernel parameters as set in SAP Note 2382421:
__sap_hana_preconfigure_kernel_parameters_default:
# The following two parameter should always be set:
diff --git a/vars/RedHat_8.yml b/vars/RedHat_8.yml
index 3975dad..94d862b 100644
--- a/vars/RedHat_8.yml
+++ b/vars/RedHat_8.yml
@@ -19,37 +19,6 @@ __sap_hana_preconfigure_sapnotes:
- "2382421"
# - "2235581" # no specific requirements for RHEL 8 yet
-# The packages for RHEL8 are almost the same as for RHEL7.
-# IBM publishes the packages as a repository here:
-# https://public.dhe.ibm.com/software/server/POWER/Linux/yum/OSS/RHEL/8/ppc64le/
-# To install the packages, you need to create an appropriate repofile
-# or clone this repository (e.g. with Satellite product)
-__sap_hana_preconfigure_required_ppc64le:
- - librtas
- - src
- - rsct.core.utils
- - rsct.core
- - rsct.basic
- - rsct.opt.storagerm
- - devices.chrp.base.ServiceRM
- - DynamicRM
- - ncurses-libs
- - readline
- - sqlite
- - sg3_utils
- - libgcc
- - libstdc++
- - zlib
- - iprutils
- - lsvpd
- - libvpd
- - libservicelog
- - servicelog
- - powerpc-utils
-# - powerpc-utils-python # this package is no longer available for RHEL8
- - ppc64-diag
- - IBMinvscout
-
# In SAP Note 2777782, certain minimal required packages for the different RHEL 8 minor releases are listed.
# The following will assign them properly to __sap_hana_preconfigure_min_pkgs.
# If variable __sap_hana_preconfigure_min_packages_VERSION_ARCH is not defined,
@@ -127,6 +96,37 @@ __sap_hana_preconfigure_packages:
# SAP NOTE 2777782:
- tuned-profiles-sap-hana
+# The packages for RHEL8 are almost the same as for RHEL7.
+# IBM publishes the packages as a repository here:
+# https://public.dhe.ibm.com/software/server/POWER/Linux/yum/OSS/RHEL/8/ppc64le/
+# To install the packages, you need to create an appropriate repofile
+# or clone this repository (e.g. with Satellite product)
+__sap_hana_preconfigure_required_ppc64le:
+ - librtas
+ - src
+ - rsct.core.utils
+ - rsct.core
+ - rsct.basic
+ - rsct.opt.storagerm
+ - devices.chrp.base.ServiceRM
+ - DynamicRM
+ - ncurses-libs
+ - readline
+ - sqlite
+ - sg3_utils
+ - libgcc
+ - libstdc++
+ - zlib
+ - iprutils
+ - lsvpd
+ - libvpd
+ - libservicelog
+ - servicelog
+ - powerpc-utils
+# - powerpc-utils-python # this package is no longer available for RHEL8
+ - ppc64-diag
+ - IBMinvscout
+
# Network related kernel parameters as set in SAP Note 2382421:
__sap_hana_preconfigure_kernel_parameters_default:
# The following two parameter should always be set:

View File

@ -0,0 +1,234 @@
commit ecb7c33e9a8eddb633189d332683309d398fd54f
Author: Bernd Finger <bfinger@redhat.com>
Date: Fri Jun 19 19:27:48 2020 +0200
- replaced yum package update by Jinja2
- added minimum required kernel versions for RHEL 8
diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml
index 7995d99..9ba248c 100644
--- a/tasks/RedHat/installation.yml
+++ b/tasks/RedHat/installation.yml
@@ -71,44 +71,71 @@
- name: Ensure minimum packages are installed
block:
- - name: check if minimum release needs to be installed
- shell: |
- set -x
- required_pkg={{ pkg | join('-') }}
-# newest=$(echo -e "$required_pkg\n$(rpm -q {{ pkg[0] }} )"| sort -V | tail -1)
- newest=$(echo -e "$required_pkg\n$(rpm -q {{ pkg[0] }} )"| awk '{gsub ("\\.el", ".0.0."); print}' | sort -V | tail -1)
-# if [ $newest == $required_pkg ]; then
- if [ $newest == ${required_pkg/.el/.0.0.} ]; then
- echo $newest
- fi
- loop: "{{ sap_hana_preconfigure_min_pkgs }}"
- loop_control:
- loop_var: pkg
- check_mode: no
- register: sap_hana_preconfigure_register_minpkglist
- changed_when: false
-
- - name: Initialize an empty list for our strings
- set_fact:
- sap_hana_preconfigure_fact_minpkglist: []
-
- - name: Create list of packages to be installed
- set_fact:
- sap_hana_preconfigure_fact_minpkglist: "{{ sap_hana_preconfigure_fact_minpkglist | difference(['']) + [ pkg.stdout ] }}"
- loop: "{{ sap_hana_preconfigure_register_minpkglist.results }}"
- loop_control:
- loop_var: pkg
- - debug: var=sap_hana_preconfigure_fact_minpkglist
-
- - name: Install minimum packages if required
- yum:
- name: "{{ sap_hana_preconfigure_fact_minpkglist }}"
- state: present
- when: not ( sap_hana_preconfigure_fact_minpkglist == [ "" ] )
+ - name: Gather package facts
+ package_facts:
+
+ - set_fact:
+ reqpkgs: "{{ __sap_hana_preconfigure_min_pkgs }}"
+
+ - debug:
+ var: reqpkgs
+
+ - set_fact:
+ sap_hana_preconfigure_fact_minpkglist: |-
+ {% set ns = namespace() %}
+ {% set ns.pkgs = [] %}
+ {% for reqpkg in reqpkgs %}
+ {% if not reqpkg[0] in ansible_facts.packages %}
+ {% set _ = ns.pkgs.append(reqpkg | join('-')) %}
+ {% else %}
+ {% set pkg = ansible_facts.packages[reqpkg[0]][-1] %}
+ {% set verrel = pkg.version ~ '-' ~ pkg.release %}
+ {% if reqpkg[1].replace (".el", ".0.0.") is version(verrel.replace (".el", ".0.0."), '>', strict=false) %}
+ {% set _ = ns.pkgs.append(reqpkg | join('-')) %}
+ {% else %}
+ {% set _ = "pkg already installed with same or later version" %}
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+ {{ ns.pkgs }}
+
+# - name: check if minimum release needs to be installed
+# shell: |
+# set -x
+# required_pkg={{ pkg | join('-') }}
+# newest=$(echo -e "$required_pkg\n$(rpm -q {{ pkg[0] }} )"| sed "s,\.el,.0.0.," | sort -V | tail -1)
+# if [ $newest == ${required_pkg/.el/.0.0.} ]; then
+# echo $newest
+# fi
+# loop: "{{ __sap_hana_preconfigure_min_pkgs }}"
+# loop_control:
+# loop_var: pkg
+# check_mode: no
+# register: sap_hana_preconfigure_register_minpkglist
+# changed_when: false
+
+# - name: Initialize an empty list for our strings
+# set_fact:
+# sap_hana_preconfigure_fact_minpkglist: []
+
+# - name: Create list of packages to be installed
+# set_fact:
+# sap_hana_preconfigure_fact_minpkglist: "{{ sap_hana_preconfigure_fact_minpkglist | difference(['']) + [ pkg.stdout ] }}"
+# loop: "{{ sap_hana_preconfigure_register_minpkglist.results }}"
+# loop_control:
+# loop_var: pkg
+
+ - debug: var=sap_hana_preconfigure_fact_minpkglist
+
+ - name: Install minimum packages if required
+ yum:
+ name: "{{ sap_hana_preconfigure_fact_minpkglist }}"
+ state: present
+ when: not ( sap_hana_preconfigure_fact_minpkglist == [ "" ] )
when:
- sap_hana_preconfigure_min_package_check|bool
- - not( (sap_hana_preconfigure_min_pkgs is undefined) or (sap_hana_preconfigure_min_pkgs is none) or (sap_hana_preconfigure_min_pkgs | trim == '') )
+ - not( (__sap_hana_preconfigure_min_pkgs is undefined) or (__sap_hana_preconfigure_min_pkgs is none) or (__sap_hana_preconfigure_min_pkgs | trim == '') )
- set_fact:
needs_restarting_command: "needs-restarting -r"
diff --git a/vars/RedHat_7.yml b/vars/RedHat_7.yml
index 30c6d38..8ac6939 100644
--- a/vars/RedHat_7.yml
+++ b/vars/RedHat_7.yml
@@ -44,40 +44,40 @@ __sap_hana_preconfigure_required_ppc64le:
- IBMinvscout
# In SAP Note 2235581, certain minimal required packages for the different RHEL 7 minor releases are listed.
-# The following will assign them properly to __sap_hana_preconfigure_min_packages.
-# If variable __sap_hana_preconfigure_min_packages_VERSION is not defined, __sap_hana_preconfigure_min_packages will be undefined as well.
+# The following will assign them properly to __sap_hana_preconfigure_min_pkgs.
+# If variable __sap_hana_preconfigure_min_packages_VERSION is not defined,
+# variable __sap_hana_preconfigure_min_pkgs will be undefined as well.
-__sap_hana_preconfigure_min_packages_7.2:
+__sap_hana_preconfigure_min_packages_7_2:
- [ 'kernel' , '3.10.0-327.62.4.el7' ]
- [ 'systemd' , '219-19.el7_2.4' ]
-__sap_hana_preconfigure_min_packages_7.3:
+__sap_hana_preconfigure_min_packages_7_3:
- [ 'kernel' , '3.10.0-514.36.5.el7' ]
- [ 'glibc' , '2.17-157.el7_3.5' ]
- [ 'tuned-profiles-sap-hana' , '2.7.1-3.el7_3.3' ]
-__sap_hana_preconfigure_min_packages_7.4:
+__sap_hana_preconfigure_min_packages_7_4:
- [ 'kernel' , '3.10.0-693.11.6.el7' ]
- [ 'tuned-profiles-sap-hana' , '2.8.0-5.el7_4.2' ]
# SAP note 2812427:
-__sap_hana_preconfigure_min_packages_7.5:
+__sap_hana_preconfigure_min_packages_7_5:
- [ 'kernel' , '3.10.0-862.41.1.el7' ]
# SAP note 2812427:
-__sap_hana_preconfigure_min_packages_7.6:
+__sap_hana_preconfigure_min_packages_7_6:
- [ 'kernel' , '3.10.0-957.27.4.el7' ]
# SAP note 2812427:
-__sap_hana_preconfigure_min_packages_7.7:
+__sap_hana_preconfigure_min_packages_7_7:
- [ 'kernel' , '3.10.0-1062.1.1.el7' ]
-# Empty definitions for upcoming RHEL 7 minor releases:
-__sap_hana_preconfigure_min_packages_7.8:
+__sap_hana_preconfigure_min_packages_7_8:
-__sap_hana_preconfigure_min_packages_7.9:
+__sap_hana_preconfigure_min_packages_7_9:
-__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars','__sap_hana_preconfigure_min_packages_' + ansible_distribution_version|string ) }}"
+__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars','__sap_hana_preconfigure_min_packages_' + ansible_distribution_version|string|replace (\".\", \"_\") ) }}"
__sap_hana_preconfigure_packages:
# SAP note 2009879:
diff --git a/vars/RedHat_8.yml b/vars/RedHat_8.yml
index 1ea7a88..3975dad 100644
--- a/vars/RedHat_8.yml
+++ b/vars/RedHat_8.yml
@@ -50,8 +50,52 @@ __sap_hana_preconfigure_required_ppc64le:
- ppc64-diag
- IBMinvscout
-# Minimum required package levels for RHEL 8:
-__sap_hana_preconfigure_min_packages_8:
+# In SAP Note 2777782, certain minimal required packages for the different RHEL 8 minor releases are listed.
+# The following will assign them properly to __sap_hana_preconfigure_min_pkgs.
+# If variable __sap_hana_preconfigure_min_packages_VERSION_ARCH is not defined,
+# variable __sap_hana_preconfigure_min_pkgs will be undefined as well.
+
+# Minimum required package levels for RHEL 8.0:
+__sap_hana_preconfigure_min_packages_8_0_x86_64:
+
+__sap_hana_preconfigure_min_packages_8_0_ppc64le:
+ - [ 'kernel' , '4.18.0-80.15.1.el8_0' ]
+
+__sap_hana_preconfigure_min_packages_8_1_x86_64:
+ - [ 'kernel' , '4.18.0-147.5.1.el8_1' ]
+
+__sap_hana_preconfigure_min_packages_8_1_ppc64le:
+ - [ 'kernel' , '4.18.0-147.5.1.el8_1' ]
+
+__sap_hana_preconfigure_min_packages_8_2_x86_64:
+
+__sap_hana_preconfigure_min_packages_8_2_ppc64le:
+
+__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:
+
+__sap_hana_preconfigure_min_packages_8_4_ppc64le:
+
+__sap_hana_preconfigure_min_packages_8_5_x86_64:
+
+__sap_hana_preconfigure_min_packages_8_5_ppc64le:
+
+__sap_hana_preconfigure_min_packages_8_6_x86_64:
+
+__sap_hana_preconfigure_min_packages_8_6_ppc64le:
+
+__sap_hana_preconfigure_min_packages_8_7_x86_64:
+
+__sap_hana_preconfigure_min_packages_8_7_ppc64le:
+
+__sap_hana_preconfigure_min_packages_8_8_x86_64:
+
+__sap_hana_preconfigure_min_packages_8_8_ppc64le:
+
+__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars','__sap_hana_preconfigure_min_packages_' + ansible_distribution_version|string|replace (\".\", \"_\") + '_' + ansible_architecture) }}"
__sap_hana_preconfigure_packages:
# SAP NOTE 2772999:

View File

@ -0,0 +1,85 @@
commit c11288a8354bf14f665e2ec92ff6b49f6828edfc
Author: Bernd Finger <bfinger@redhat.com>
Date: Fri Jun 19 17:00:51 2020 +0200
- fixed minimum package version comparison when package name contains ".el" (upstream issue #95)
- no longer install package groups in this role (upstream issue #96)
diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml
index 09e9c5f..7995d99 100644
--- a/tasks/RedHat/installation.yml
+++ b/tasks/RedHat/installation.yml
@@ -22,10 +22,6 @@
when: sap_hana_preconfigure_enable_sap_hana_repos
-#- name: Ensure that the RHEL minor relase is fixed
-# rhsm_release:
-# release: "{{ ansible_distribution_version }}"
-
- name: Detect if the minor RHEL release is set
shell: subscription-manager release --show | awk '{print $NF}'
register: subscription_manager_release_result
@@ -39,11 +35,6 @@
- sap_hana_preconfigure_set_minor_release
- subscription_manager_release_result.stdout != ansible_distribution_version
-- name: Ensure required package groups are installed
- package:
- state: present
- name: "{{ __sap_hana_preconfigure_packagegroups }}"
-
- name: Ensure required packages are installed
package:
state: present
@@ -84,8 +75,10 @@
shell: |
set -x
required_pkg={{ pkg | join('-') }}
- newest=$(echo -e "$required_pkg\n$(rpm -q {{ pkg[0] }} )"| sort -V | tail -1)
- if [ $newest == $required_pkg ]; then
+# newest=$(echo -e "$required_pkg\n$(rpm -q {{ pkg[0] }} )"| sort -V | tail -1)
+ newest=$(echo -e "$required_pkg\n$(rpm -q {{ pkg[0] }} )"| awk '{gsub ("\\.el", ".0.0."); print}' | sort -V | tail -1)
+# if [ $newest == $required_pkg ]; then
+ if [ $newest == ${required_pkg/.el/.0.0.} ]; then
echo $newest
fi
loop: "{{ sap_hana_preconfigure_min_pkgs }}"
diff --git a/vars/RedHat_7.yml b/vars/RedHat_7.yml
index 9afd8ee..30c6d38 100644
--- a/vars/RedHat_7.yml
+++ b/vars/RedHat_7.yml
@@ -123,19 +123,6 @@ __sap_hana_preconfigure_packages:
# libtool-ltdl: See https://answers.sap.com/questions/476177/hana-db-installation-ended-with-exit-code-127.html
# This is required since HANA 2 SPS 03, and so we always install it.
-__sap_hana_preconfigure_packagegroups_x86_64:
- - "@base"
- - "@large-systems"
- - "@network-file-system-client"
- - "@performance"
- - "@compat-libraries"
-
-__sap_hana_preconfigure_packagegroups_ppc64le:
- - "@base"
- - "@compat-libraries"
-
-__sap_hana_preconfigure_packagegroups: "{{ lookup('vars','__sap_hana_preconfigure_packagegroups_' + ansible_architecture|string ) }}"
-
# Network related kernel parameters as set in SAP Note 2382421:
__sap_hana_preconfigure_kernel_parameters_default:
# The following two parameter should always be set:
diff --git a/vars/RedHat_8.yml b/vars/RedHat_8.yml
index e3c5767..1ea7a88 100644
--- a/vars/RedHat_8.yml
+++ b/vars/RedHat_8.yml
@@ -83,9 +83,6 @@ __sap_hana_preconfigure_packages:
# SAP NOTE 2777782:
- tuned-profiles-sap-hana
-__sap_hana_preconfigure_packagegroups:
- - "@base"
-
# Network related kernel parameters as set in SAP Note 2382421:
__sap_hana_preconfigure_kernel_parameters_default:
# The following two parameter should always be set:

View File

@ -0,0 +1,37 @@
commit d64615413b0bd7741bd6d8e06e5676be36a24c41
Author: Bernd Finger <bfinger@redhat.com>
Date: Fri Jun 19 20:10:41 2020 +0200
Show also the install status of the IBM tools
diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml
index 9ba248c..fcacce6 100644
--- a/tasks/RedHat/installation.yml
+++ b/tasks/RedHat/installation.yml
@@ -47,6 +47,7 @@
register: result
ignore_errors: True
changed_when: false
+
- debug:
var: result.results
@@ -69,6 +70,18 @@
name: "{{ __sap_hana_preconfigure_required_ppc64le }}"
when: ansible_architecture == "ppc64le"
+- name: Get status of installed IBM Tools
+ yum:
+ name: "{{ __sap_hana_preconfigure_required_ppc64le }}"
+ register: ibm_result
+ ignore_errors: True
+ changed_when: false
+ when: ansible_architecture == "ppc64le"
+
+- debug:
+ var: ibm_result.results
+ when: ansible_architecture == "ppc64le"
+
- name: Ensure minimum packages are installed
block:
- name: Gather package facts

View File

@ -0,0 +1,82 @@
diff --git a/README.md b/README.md
index 61caab5..efb60f1 100644
--- a/README.md
+++ b/README.md
@@ -89,6 +89,7 @@ sap_hana_preconfigure_2292690_[01...07,09,10], example: sap_hana_preconfigure_22
sap_hana_preconfigure_2009879_3_9
sap_hana_preconfigure_2009879_3_13
sap_hana_preconfigure_2009879_3_14_[1...4]
+sap_hana_preconfigure_2009879_3_15
sap_hana_preconfigure_2382421
```
diff --git a/tasks/RedHat/configuration.yml b/tasks/RedHat/configuration.yml
index 0216a99..f0bcbd4 100644
--- a/tasks/RedHat/configuration.yml
+++ b/tasks/RedHat/configuration.yml
@@ -8,6 +8,11 @@
debug:
var: __sap_hana_preconfigure_sapnotes | difference([''])
+# We want to disable firewalld, so we need to check if firewalld is installed
+- name: Gather facts about installed packages
+ package_facts:
+ manager: auto
+
- name: include configuration actions for required sapnotes
include_tasks: "sapnote/{{ item }}.yml"
with_items: "{{ __sap_hana_preconfigure_sapnotes | difference(['']) }}"
diff --git a/tasks/RedHat/generic/configure-epb.yml b/tasks/RedHat/generic/configure-epb.yml
index 71d8b91..f74ec7f 100644
--- a/tasks/RedHat/generic/configure-epb.yml
+++ b/tasks/RedHat/generic/configure-epb.yml
@@ -21,7 +21,7 @@
file:
path: /etc/init.d/boot.local
state: touch
- mode: 0644
+ mode: 0755
- name: Configure EPB at boot time
lineinfile:
diff --git a/tasks/RedHat/generic/disable-firewall.yml b/tasks/RedHat/generic/disable-firewall.yml
index 151d045..1bc6596 100644
--- a/tasks/RedHat/generic/disable-firewall.yml
+++ b/tasks/RedHat/generic/disable-firewall.yml
@@ -1,16 +1,14 @@
---
-- name: Gathering service facts
- service_facts:
- register: services_state
+
+- debug:
+ msg: "imported RedHat/generic/configure-firewall.yml"
- name: Stop and disable service firewalld
systemd:
name: firewalld
state: stopped
enabled: no
- when: services_state.ansible_facts.services["firewalld.service"].state is defined
-
-- debug: var=services_state.ansible_facts.services["firewalld.service"].state
+ when: "'firewalld' in ansible_facts.packages"
- name: Get status of firewalld
command: bash -lc "systemctl status firewalld"
diff --git a/tasks/sapnote/2009879_7.yml b/tasks/sapnote/2009879_7.yml
index 793b921..c86b364 100644
--- a/tasks/sapnote/2009879_7.yml
+++ b/tasks/sapnote/2009879_7.yml
@@ -96,10 +96,7 @@
### NYI: Set proper firewall rules if SID/instance number is known
###
- include_tasks: ../RedHat/generic/disable-firewall.yml
-# - name: 3.15 Ensure firewall is disabled when instance ID unknown
-# service: name=firewalld state=stopped enabled=no
-# ignore_errors: True
-
+ when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2009879_3_15|d(false)
### Firewall Calculation for SID=xx
##################################################################

View File

@ -0,0 +1,125 @@
commit db645e39a38070ac0b3fe9f2f447d60e6eedac4a
Author: Bernd Finger <bfinger@redhat.com>
Date: Fri Jun 19 19:25:34 2020 +0200
fix Comparing installed versions of a package with the required version is not reliable
diff --git a/tasks/installation.yml b/tasks/installation.yml
index 8ad40b9..b8788bc 100644
--- a/tasks/installation.yml
+++ b/tasks/installation.yml
@@ -1,10 +1,10 @@
---
# tasks file for sap-preconfigure: installation
-- name: Ensure required package groups are installed
- package:
- state: present
- name: "{{ __sap_preconfigure_packagegroups }}"
+# - name: Ensure required package groups are installed
+# package:
+# state: present
+# name: "{{ __sap_preconfigure_packagegroups }}"
- name: Ensure required packages are installed
package:
@@ -14,38 +14,67 @@
- name: Ensure minimum packages are installed
block:
- - name: check if minimum release needs to be installed
- shell: |
- set -x
- required_pkg={{ pkg | join('-') }}
- newest=$(echo -e "$required_pkg\n$(rpm -q {{ pkg[0] }} )"| sort -V | tail -1)
- if [ $newest == $required_pkg ]; then
- echo $newest
- fi
- loop: "{{ __sap_preconfigure_min_pkgs }}"
- loop_control:
- loop_var: pkg
- check_mode: no
- register: __sap_preconfigure_register_minpkglist
- changed_when: false
-
- - name: Initialize an empty list for our strings
- set_fact:
- __sap_preconfigure_fact_minpkglist: []
-
- - name: Create list of packages to be installed
- set_fact:
- __sap_preconfigure_fact_minpkglist: "{{ __sap_preconfigure_fact_minpkglist | difference(['']) + [ pkg.stdout ] }}"
- loop: "{{ __sap_preconfigure_register_minpkglist.results }}"
- loop_control:
- loop_var: pkg
- - debug: var=__sap_preconfigure_fact_minpkglist
-
- - name: Install minimum packages if required
- package:
- name: "{{ __sap_preconfigure_fact_minpkglist }}"
- state: present
- when: not ( __sap_preconfigure_fact_minpkglist == [ "" ] )
+ - name: Gather package facts
+ package_facts:
+
+ - set_fact:
+ reqpkgs: "{{ __sap_preconfigure_min_pkgs }}"
+
+ - debug:
+ var: reqpkgs
+
+ - set_fact:
+ sap_preconfigure_fact_minpkglist: |-
+ {% set ns = namespace() %}
+ {% set ns.pkgs = [] %}
+ {% for reqpkg in reqpkgs %}
+ {% if not reqpkg[0] in ansible_facts.packages %}
+ {% set _ = ns.pkgs.append(reqpkg | join('-')) %}
+ {% else %}
+ {% set pkg = ansible_facts.packages[reqpkg[0]][-1] %}
+ {% set verrel = pkg.version ~ '-' ~ pkg.release %}
+ {% if reqpkg[1].replace (".el", ".0.0.") is version(verrel.replace (".el", ".0.0."), '>', strict=false) %}
+ {% set _ = ns.pkgs.append(reqpkg | join('-')) %}
+ {% else %}
+ {% set _ = "pkg already installed with same or later version" %}
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+ {{ ns.pkgs }}
+
+# - name: check if minimum release needs to be installed
+# shell: |
+# set -x
+# required_pkg={{ pkg | join('-') }}
+# newest=$(echo -e "$required_pkg\n$(rpm -q {{ pkg[0] }} )"| sort -V | tail -1)
+# if [ $newest == $required_pkg ]; then
+# echo $newest
+# fi
+# loop: "{{ __sap_preconfigure_min_pkgs }}"
+# loop_control:
+# loop_var: pkg
+# check_mode: no
+# register: __sap_preconfigure_register_minpkglist
+# changed_when: false
+
+# - name: Initialize an empty list for our strings
+# set_fact:
+# __sap_preconfigure_fact_minpkglist: []
+
+# - name: Create list of packages to be installed
+# set_fact:
+# __sap_preconfigure_fact_minpkglist: "{{ __sap_preconfigure_fact_minpkglist | difference(['']) + [ pkg.stdout ] }}"
+# loop: "{{ __sap_preconfigure_register_minpkglist.results }}"
+# loop_control:
+# loop_var: pkg
+
+ - debug: var=sap_preconfigure_fact_minpkglist
+
+ - name: Install minimum packages if required
+ yum:
+ name: "{{ sap_preconfigure_fact_minpkglist }}"
+ state: present
+ when: not ( sap_preconfigure_fact_minpkglist == [ "" ] )
when:
- sap_preconfigure_min_package_check|bool

View File

@ -0,0 +1,82 @@
commit b056297b1e54662773d9b63850fdae34d2606fa1
Author: Bernd Finger <bfinger@redhat.com>
Date: Fri Jun 19 19:50:21 2020 +0200
compat-sap-c++-9 not available in RHEL 8 on s390x
diff --git a/vars/RedHat_8.1.yml b/vars/RedHat_8.1.yml
index 46ec8d6..8871e5d 100644
--- a/vars/RedHat_8.1.yml
+++ b/vars/RedHat_8.1.yml
@@ -16,7 +16,7 @@ __sap_preconfigure_packagegroups_s390x:
__sap_preconfigure_packagegroups: "{{ lookup('vars','__sap_preconfigure_packagegroups_' + ansible_architecture|string ) }}"
-__sap_preconfigure_packages:
+__sap_preconfigure_packages_x86_64:
- uuidd
- libnsl
- tcsh
@@ -25,6 +25,25 @@ __sap_preconfigure_packages:
- bind-utils
- compat-sap-c++-9
+__sap_preconfigure_packages_ppc64le:
+ - uuidd
+ - libnsl
+ - tcsh
+ - psmisc
+ - nfs-utils
+ - bind-utils
+ - compat-sap-c++-9
+
+__sap_preconfigure_packages_s390x:
+ - uuidd
+ - libnsl
+ - tcsh
+ - psmisc
+ - nfs-utils
+ - bind-utils
+
+__sap_preconfigure_packages: "{{ lookup('vars','__sap_preconfigure_packages_' + ansible_architecture|string ) }}"
+
__sap_preconfigure_min_pkgs:
- [ 'setup' , '2.12.2-2.el8_1.1' ]
diff --git a/vars/RedHat_8.yml b/vars/RedHat_8.yml
index 95c8ab2..4058b28 100644
--- a/vars/RedHat_8.yml
+++ b/vars/RedHat_8.yml
@@ -16,7 +16,7 @@ __sap_preconfigure_packagegroups_s390x:
__sap_preconfigure_packagegroups: "{{ lookup('vars','__sap_preconfigure_packagegroups_' + ansible_architecture|string ) }}"
-__sap_preconfigure_packages:
+__sap_preconfigure_packages_x86_64:
- uuidd
- libnsl
- tcsh
@@ -25,4 +25,23 @@ __sap_preconfigure_packages:
- bind-utils
- compat-sap-c++-9
+__sap_preconfigure_packages_ppc64le:
+ - uuidd
+ - libnsl
+ - tcsh
+ - psmisc
+ - nfs-utils
+ - bind-utils
+ - compat-sap-c++-9
+
+__sap_preconfigure_packages_s390x:
+ - uuidd
+ - libnsl
+ - tcsh
+ - psmisc
+ - nfs-utils
+ - bind-utils
+
+__sap_preconfigure_packages: "{{ lookup('vars','__sap_preconfigure_packages_' + ansible_architecture|string ) }}"
+
...

View File

@ -0,0 +1,41 @@
commit 6be65f40569044307bbf41038b766ff571a08025
Author: Bernd Finger <bfinger@redhat.com>
Date: Mon Jun 22 15:01:22 2020 +0200
"@" needs to be prepended to sap_preconfigure_db_group_name
diff --git a/tasks/sapnote/2002167/05-process-resource-limits.yml b/tasks/sapnote/2002167/05-process-resource-limits.yml
index 4e0b4a2..a116cbf 100644
--- a/tasks/sapnote/2002167/05-process-resource-limits.yml
+++ b/tasks/sapnote/2002167/05-process-resource-limits.yml
@@ -21,7 +21,7 @@
- name: Set the hard and soft limit for the max number of open files per process (nofile) to 32800 for the database group
pam_limits:
dest: /etc/security/limits.d/99-sap.conf
- domain: "{{ sap_preconfigure_db_group_name }} "
+ domain: "@{{ sap_preconfigure_db_group_name }}"
limit_item: nofile
limit_type: "{{ line_item }}"
value: "32800"
@@ -44,7 +44,7 @@
- name: Set the soft limit for the max number of processes per user (nproc) to unlimited for the database group
pam_limits:
dest: /etc/security/limits.d/99-sap.conf
- domain: "{{ sap_preconfigure_db_group_name }} "
+ domain: "@{{ sap_preconfigure_db_group_name }}"
limit_item: nproc
limit_type: soft
value: unlimited
diff --git a/tasks/sapnote/2772999/09-configure-process-resource-limits.yml b/tasks/sapnote/2772999/09-configure-process-resource-limits.yml
index e7d51f6..7247f77 100644
--- a/tasks/sapnote/2772999/09-configure-process-resource-limits.yml
+++ b/tasks/sapnote/2772999/09-configure-process-resource-limits.yml
@@ -21,7 +21,7 @@
- name: Set the hard and soft limit for the max number of open files per process (nofile) to 65536 for the database group
pam_limits:
dest: /etc/security/limits.d/99-sap.conf
- domain: "{{ sap_preconfigure_db_group_name }} "
+ domain: "@{{ sap_preconfigure_db_group_name }}"
limit_item: nofile
limit_type: "{{ line_item }}"
value: "65536"

View File

@ -0,0 +1,34 @@
commit 70cd0f9f8b0f7de3e48c1af041a0d63443445052
Author: Bernd Finger <bfinger@redhat.com>
Date: Thu Jun 25 18:26:30 2020 +0200
use strings instead of int in sysctl module
diff --git a/tasks/sapnote/2002167/04-linux-kernel-parameters.yml b/tasks/sapnote/2002167/04-linux-kernel-parameters.yml
index e5625fb..560edde 100644
--- a/tasks/sapnote/2002167/04-linux-kernel-parameters.yml
+++ b/tasks/sapnote/2002167/04-linux-kernel-parameters.yml
@@ -14,8 +14,8 @@
sysctl_set: yes
reload: yes
with_items:
- - { name: kernel.sem, value: "1250 256000 100 1024" }
- - { name: vm.max_map_count, value: 2000000 }
+ - { name: kernel.sem, value: '1250 256000 100 1024' }
+ - { name: vm.max_map_count, value: '2000000' }
loop_control:
loop_var: line_item
diff --git a/tasks/sapnote/2772999/08-configure-linux-kernel-parameters.yml b/tasks/sapnote/2772999/08-configure-linux-kernel-parameters.yml
index 6c53b0a..2b7d50b 100644
--- a/tasks/sapnote/2772999/08-configure-linux-kernel-parameters.yml
+++ b/tasks/sapnote/2772999/08-configure-linux-kernel-parameters.yml
@@ -9,7 +9,7 @@
sysctl:
sysctl_file: /etc/sysctl.d/sap.conf
name: vm.max_map_count
- value: 2147483647
+ value: '2147483647'
state: present
sysctl_set: yes
reload: yes

View File

@ -1,365 +1,100 @@
%if 0%{?rhel} && ! 0%{?epel}
%bcond_with ansible
%else
%bcond_without ansible
%endif
# avoiding version conflict, set version 2.0.0 for rhel8
%define upstream_vesion 2020-06-08
%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_name sap_install
%if 0%{?rhel}
%define package_name rhel-system-roles-sap
%global collection_namespace redhat
%else
%define package_name linux-system-roles-sap
%global collection_namespace community
%endif
# collection_version has to be increased by every rebuild
# otherwise, it cannot be uploaded to Automation Hub and Galaxy
# due to version conflict
%define collection_version 1.2.1
%global mainid e2a233f5a0cb68363798bf014b16552cca681bd0
%global commit_id_sap_install f0deb287aaa0fb7d992b95a04b14e263b6690c23
%global rolename1 sap_general_preconfigure
%global rolename2 sap_hana_preconfigure
%global rolename3 sap_netweaver_preconfigure
%global rolename4 sap_hana_install
%global rolename5 sap_ha_pacemaker_cluster
%global rolename6 sap_ha_set_netweaver
%global rolename7 sap_hostagent
%global rolename8 sap_install_media_detect
%global rolename9 sap_storage
%global rolename10 sap_swpm
%global rolename11 sap_ha_install_hana_hsr
%global src_owner linux-system-roles
%global github_repo_sap_install community.sap_install
%global rolename_rhel %{rolename1} %{rolename2} %{rolename3} %{rolename4} %{rolename5} %{rolename10} %{rolename11}
%global rolename_community %{rolename_rhel} %{rolename1} %{rolename6} %{rolename7} %{rolename8} %{rolename9}
%if 0%{?fedora}
%global rolenames %{rolename_community}
%else
%global rolenames %{rolename_rhel}
%endif
Name: %{package_name}
Name: rhel-system-roles-sap
Summary: System Roles to configure RHEL for running SAP NetWeaver- or SAP HANA-based products
Version: 3.4.0
Version: 2.0.0
Release: 3%{?dist}
License: GPLv3+
Url: https://github.com/berndfinger/community.sap_install
Source0: https://github.com/linux-system-roles/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz
Source1: https://github.com/berndfinger/%{github_repo_sap_install}/archive/%{commit_id_sap_install}/%{github_repo_sap_install}-%{commit_id_sap_install}.tar.gz
# files/README.md, files/roles/sap_swpm/README.md from https://gitlab.cee.redhat.com/sap-linuxlab/prepare-redhat.sap_install
Source2: prepare-redhat.sap_install-main.tar.bz2
Patch1: community.sap_install-shebang.patch
Url: https://github.com/berndfinger
Source0: https://github.com/berndfinger/sap-preconfigure/releases/download/2.0.0/sap-preconfigure.tar.gz
Source1: https://github.com/berndfinger/sap-hana-preconfigure/releases/download/2.0.0/sap-hana-preconfigure.tar.gz
Source2: https://github.com/berndfinger/sap-netweaver-preconfigure/releases/download/2.0.0/sap-netweaver-preconfigure.tar.gz
# git diff 2cbfd65fcc4988db4e9bc86bbf738217fe75bf49, fix 3 issues
# - firewalld installation state detection not working
# - File /etc/init.d/boot.local should have permissions of 0755 (configure-epb.yml)
# - ask disable-firewall.yml in 2009879_7.yml also needs single step execution support
Patch0: sap-hana-preconfigure-2.0.0.patch
# for fixes for #78, #79, #81, #82, #94-#97, #99, #101-#102
Patch1: sap-hana-preconfigure-#95-#96-c11288a8354bf14f665e2ec92ff6b49f6828edfc.patch
Patch2: sap-hana-preconfigure-#94-#97-ecb7c33e9a8eddb633189d332683309d398fd54f.patch
Patch3: sap-hana-preconfigure-#99-d64615413b0bd7741bd6d8e06e5676be36a24c41.patch
Patch4: sap-hana-preconfigure-#101-063273dd09715cfcf69bcf3c1f4347225028ba70.patch
Patch5: sap-hana-preconfigure-#102-a622092d5063c2fb0d7996775521a52549e3a65a.patch
Patch6: sap-preconfigure-#78-db645e39a38070ac0b3fe9f2f447d60e6eedac4a.patch
Patch7: sap-preconfigure-#79-b056297b1e54662773d9b63850fdae34d2606fa1.patch
Patch8: sap-preconfigure-#81-6be65f40569044307bbf41038b766ff571a08025.patch
Patch9: sap-preconfigure-#82-70cd0f9f8b0f7de3e48c1af041a0d63443445052.patch
BuildArch: noarch
%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-core >= 2.9.10
%endif
%if %{undefined __ansible_provides}
Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{version}
%endif
# be compatible with the usual Fedora Provides:
Provides: ansible-collection-%{collection_namespace}-%{collection_name} = %{version}-%{release}
%if 0%{?fedora} || 0%{?rhel} >= 8
%{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/}
%else
%if %{?ansible_collection_files:0}%{!?ansible_collection_files:1}
%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/
%endif
%endif
%if %{without ansible}
%define ansible_collection_build_install() tar -cf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz .; mkdir -p %{buildroot}%{ansible_collection_files}%{collection_name}; (cd %{buildroot}%{ansible_collection_files}%{collection_name}; tar -xf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz)
%else
%define ansible_collection_build_install() ansible-galaxy collection build; ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz
%endif
Requires: uuidd
%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}-%{collection_version}.tar.gz
%endif
%prep
%setup -q -a1 -a2 -n auto-maintenance-%{mainid}
# add correct version and namespace for Automation Hub and Galaxy
cp %{github_repo_sap_install}-%{commit_id_sap_install}/galaxy.yml .
sed -i -e "s|^namespace: .*|namespace: %{collection_namespace}|" galaxy.yml
sed -i -e "s|^version: .*|version: %{collection_version}|" galaxy.yml
# update README.md and roles/sap_swpm/README.md
cp prepare-redhat.sap_install-main/README.md %{github_repo_sap_install}-%{commit_id_sap_install}/
cp prepare-redhat.sap_install-main/files/roles/sap_swpm/README.md %{github_repo_sap_install}-%{commit_id_sap_install}/roles/sap_swpm/README.md
pushd %{github_repo_sap_install}-%{commit_id_sap_install}/
# workaround for md2html error
sed -i -e "s|for POWER ||g" roles/sap_hana_preconfigure/README.md
%setup -q -T -c -n %{name}-%{version} -a 0 -a 1 -a 2
pushd sap-hana-preconfigure
%patch0 -p1
%patch1 -p1
# modify collection-requirements.yml, fedora.linux_system_roles -> redhat.rhel_system_roles
for r in %{rolenames} ; do
yml=roles/${r}/meta/collection-requirements.yml
[ -f ${yml} ] && sed -i "s,fedora.linux_system_roles,redhat.rhel_system_roles," ${yml}
done
# modify defaults/main.yml, fedora.linux_system_roles -> redhat.rhel_system_roles
for r in %{rolenames} ; do
yml=roles/${r}/defaults/main.yml
[ -f ${yml} ] && sed -i "s,system_roles_collection: 'fedora.linux_system_roles',system_roles_collection: 'redhat.rhel_system_roles'," ${yml}
done
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
popd
pushd sap-preconfigure
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
popd
# remove zero file and symlinks
find . -type f -size 0 -delete
find . -type l -delete
# 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
pushd %{github_repo_sap_install}-%{commit_id_sap_install}/roles/
# remove all SLES stuff and RHEL 6 stuff
rm -rf */tasks/SLES/
rm -f */vars/SLES_15.yml
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
popd
# 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
%build
%if %{with html}
readmes=""
for role in %{rolenames}; do
readmes="${readmes} %{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role/README.md"
done
sh md2html.sh $readmes %{github_repo_sap_install}-%{commit_id_sap_install}/README.md
%endif
# create dest-path
mkdir .collections
for role in %{rolenames} ; do
LANG=en_US.utf-8 LC_ALL=en_US.utf-8 python3 lsr_role2collection.py --role "$role" \
--src-path %{github_repo_sap_install}-%{commit_id_sap_install}/roles/"$role" \
--src-owner %{src_owner} \
--dest-path .collections \
--namespace %{collection_namespace} \
--collection %{collection_name} \
--new-role "$new_role"
done
cp -p galaxy.yml .collections/ansible_collections/%{collection_namespace}/%{collection_name}
%install
mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles \
$RPM_BUILD_ROOT%{_pkgdocdir}
$RPM_BUILD_ROOT%{_pkgdocdir}/sap-hana-preconfigure \
$RPM_BUILD_ROOT%{_pkgdocdir}/sap-preconfigure \
$RPM_BUILD_ROOT%{_pkgdocdir}/sap-netweaver-preconfigure
# create file selection for documents
echo "%dir %{_pkgdocdir}" > files_section.txt
cp %{github_repo_sap_install}-%{commit_id_sap_install}/README.md $RPM_BUILD_ROOT%{_pkgdocdir}/
%if %{with html}
cp %{github_repo_sap_install}-%{commit_id_sap_install}/README.html $RPM_BUILD_ROOT%{_pkgdocdir}/
%endif
echo "%{_pkgdocdir}/README.*" >> files_section.txt
# drop zero file
rm -f */.gitignore sap-hana-preconfigure/tasks/RedHat_6/recommendations.yml
for role in %{rolenames} ; do
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/$role
cp -pR %{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role $RPM_BUILD_ROOT%{_datadir}/ansible/roles/
install -m 644 %{github_repo_sap_install}-%{commit_id_sap_install}/LICENSE \
%{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role/README.md \
$RPM_BUILD_ROOT%{_pkgdocdir}/$role/
%if %{with html}
install -m 644 %{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role/README.html \
$RPM_BUILD_ROOT%{_pkgdocdir}/$role/
%endif
echo "%dir %{_pkgdocdir}/$role" >> files_section.txt
done
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_build_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}/
mv %{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz $RPM_BUILD_ROOT%{_datadir}/ansible/collections/
popd
%endif
%files -f files_section.txt
%files
%dir %{_pkgdocdir}
%dir %{_pkgdocdir}/sap-preconfigure
%dir %{_pkgdocdir}/sap-hana-preconfigure
%dir %{_pkgdocdir}/sap-netweaver-preconfigure
%dir %{_datadir}/ansible
%dir %{_datadir}/ansible/roles
%doc %{_pkgdocdir}/*/README.md
%if %{with html}
%{_pkgdocdir}/*/README.html
%endif
%license %{_pkgdocdir}/*/LICENSE
%{_datadir}/ansible/roles/*
%{ansible_collection_files}
%if %{with collection_artifact}
%files collection-artifact
%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz
%endif
%changelog
* Mon Jan 30 2023 Than Ngo <than@redhat.com> - 3.4.0-3
- Related: #2155876, rebase sap roles to version 1.2.1
* Thu Jan 19 2023 Than Ngo <than@redhat.com> - 3.4.0-2
- Related: #2155876, compat-sap-c++-10 is not available for RHEL 8.2 and earlier on hardware platform s390x
* Wed Jan 11 2023 Than Ngo <than@redhat.com> - 3.4.0-1
- Resolves: #2155876, rebase sap roles to version 1.2.0
* Tue Nov 22 2022 Than Ngo <than@redhat.com> - 3.3.0-4
- Resolves: #2142957, drop deprecated paramater for Ansible 2.14
* Fri Jul 15 2022 Than Ngo <than@redhat.com> - 3.3.0-3
- update galaxy.yml and README.md and url
Related: #2103633
* Tue Jul 12 2022 Than Ngo <than@redhat.com> - 3.3.0-2
- make the role Ansible 2.13 compliant
- get rid of all the new ansible-lint 6.3.0 errors for preconfigure and sap_hana_install roles
Resolves: #2103633
* Mon Jul 04 2022 Than Ngo <than@redhat.com> - 3.3.0-1
- Resolves: #2103633, include roles for setting up a two-node SAP HANA pacemaker cluster
* Thu Jun 09 2022 Than Ngo <than@redhat.com> - 3.2.0-3
- sap_hana_preconfigure: Add vars for RHEL 9.1 managed nodes
- sap_general_preconfigure: fix variable inclusion for RHEL minor releases
Related: #2063050
* Wed Jun 08 2022 Than Ngo <than@redhat.com> - 3.2.0-2
- sap_general_preconfigure: do not attempt to enable HANA repos for s390x
- sap_hana_preconfigure: using wrong variable name
- sap_hana_preconfigure: Fix issue sap-linuxlab#154
Related: #2063050
* Mon Mar 21 2022 Than Ngo <than@redhat.com> - 3.2.0-1
- Resolves: #2063050, rebase to new upstream org sap-linuxlab
* Fri Dec 03 2021 Than Ngo <than@redhat.com> - 3.1.1-10
- Related: #2016858, increase release to avoid update conflict
* Fri Dec 03 2021 Than Ngo <than@redhat.com> - 3.1.1-8
- Related: #2016858, rebase
* Tue Nov 16 2021 Than Ngo <than@redhat.com> - 3.1.1-7
- Resolves: #2016858, ansible-lint cleanup
* 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
- added detailed explanations for sap_hana_preconfigure_kernel_parameters_ppc64le in README.md
- fixed issue #170 in sap_hana_preconfigure
Related: #1891642
* Wed Feb 24 2021 Than Ngo <than@redhat.com> - 3.0.1-3
- Related: #1891642, fixed issue #125 in sap-preconfigure and #163 and #164 in sap-hana-preconfigure
* Thu Feb 18 2021 Than Ngo <than@redhat.com> - 3.0.1-2
- Related: #1891642, update sap-hana-preconfigure 3.0.1 and fixed Urls
* Thu Feb 18 2021 Than Ngo <than@redhat.com> - 3.0.1-1
- Related: #1891642, rebase to 3.0.1
* Mon Feb 15 2021 Than Ngo <than@redhat.com> - 3.0.0-2
- Related: #1891642, more fixes #145, #148, #149, #150 #147
* Thu Jan 28 2021 Than Ngo <than@redhat.com> - 3.0.0-1
- Resolves: #1891638, bug fixes
- Resolves: #1891642, new features
* Mon Sep 21 2020 Than Ngo <than@redhat.com> - 2.0.0-7
- Related: #1867027, fix #119
* Thu Aug 20 2020 Than Ngo <than@redhat.com> - 2.0.0-6
- Related: #1867027, fix #92
* Fri Aug 07 2020 Than Ngo <than@redhat.com> - 2.0.0-5
- Resolves: #1867027, more fixes for #89, #109, #110, #111, #112, #113, #114, #116
* Tue Jul 21 2020 Than Ngo <than@redhat.com> - 2.0.0-4
- Related: #1844190, more fixes for #84, #85, #86, #88, #98, #104, #105, #107
* Fri Jul 03 2020 Than Ngo <than@redhat.com> - 2.0.0-3
- Related: #1844190, drop 1944799.yml