From 2d13abd49050abf52c1bab59a31237b85ac721e7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 3 Nov 2020 06:56:06 -0500 Subject: [PATCH] import rhel-system-roles-sap-2.0.0-7.el8 --- .gitignore | 4 +- .rhel-system-roles-sap.metadata | 4 +- ...rhel-system-roles-sap-0.7.2-rhel-7.8.patch | 14 - ...73dd09715cfcf69bcf3c1f4347225028ba70.patch | 19 + ...092d5063c2fb0d7996775521a52549e3a65a.patch | 213 ++++++++++ ...f9b667a8a7dec17caa70c5df929b921691a6.patch | 54 +++ ...7c964e2c95b37c68299e6077bc3f987faffb.patch | 99 +++++ ...2367321b47c3fb5d52e50f5ea220c548fab5.patch | 105 +++++ ...fb58325bf1c370ea3e0d76e291eb9485acf1.patch | 116 ++++++ ...1339a1a79c9e47f8023534e0a3db429dbf20.patch | 47 +++ ...52ada59c5e2919be3f7cf89927ac7bfd510d.patch | 30 ++ ...52ada59c5e2919be3f7cf89927ac7bfd510d.patch | 19 + ...c5470eae0769a6ceee201621aab0518bb6f3.patch | 50 +++ ...979fa05e938165c95a134bbdcc37a33f4eea.patch | 370 ++++++++++++++++++ ...988bf105a325db12965d240bbe1462b72c78.patch | 61 +++ ...940d0230c0fb2957426952c5308e08919c06.patch | 18 + ...c33e9a8eddb633189d332683309d398fd54f.patch | 234 +++++++++++ ...88a8354bf14f665e2ec92ff6b49f6828edfc.patch | 85 ++++ ...7012022f38534ae5a5803062639446c9fa81.patch | 41 ++ ...15413b0bd7741bd6d8e06e5676be36a24c41.patch | 37 ++ SOURCES/sap-hana-preconfigure-2.0.0.patch | 82 ++++ ...8c2890aa80c4562d002cc557945bdf9c5e7e.patch | 32 -- ...9f539263e1a2fd9222d6c52c55c7cb337130.patch | 115 ------ ...b58a0d2a60bb0e222b3dac5190c8ea171cf3.patch | 34 -- ...5e39a38070ac0b3fe9f2f447d60e6eedac4a.patch | 125 ++++++ ...297b1e54662773d9b63850fdae34d2606fa1.patch | 82 ++++ ...5f40569044307bbf41038b766ff571a08025.patch | 41 ++ ...0f9f8b0f7de3e48c1af041a0d63443445052.patch | 34 ++ ...2082ae0784f88eab8f9d0f764c3981b9cf6d.patch | 42 ++ ...afb7487687369d3597e6f9e21895da702094.patch | 43 ++ ...870eaac2efee2e131babacebc5337a15b3e3.patch | 110 ++++++ ...b96fbd6a7360d62413734bc652ed4c5e2771.patch | 41 ++ ...93eaddfafd08132017058b0b330108d2bd2c.patch | 53 +++ ...d07c66286edbee756ed3504649975d333306.patch | 41 ++ SPECS/rhel-system-roles-sap.spec | 133 +++++-- 35 files changed, 2409 insertions(+), 219 deletions(-) delete mode 100644 SOURCES/rhel-system-roles-sap-0.7.2-rhel-7.8.patch create mode 100644 SOURCES/sap-hana-preconfigure-#101-063273dd09715cfcf69bcf3c1f4347225028ba70.patch create mode 100644 SOURCES/sap-hana-preconfigure-#102-a622092d5063c2fb0d7996775521a52549e3a65a.patch create mode 100644 SOURCES/sap-hana-preconfigure-#104-#105-6d65f9b667a8a7dec17caa70c5df929b921691a6.patch create mode 100644 SOURCES/sap-hana-preconfigure-#107-6f8d7c964e2c95b37c68299e6077bc3f987faffb.patch create mode 100644 SOURCES/sap-hana-preconfigure-#109-#110-89202367321b47c3fb5d52e50f5ea220c548fab5.patch create mode 100644 SOURCES/sap-hana-preconfigure-#111-part1-03affb58325bf1c370ea3e0d76e291eb9485acf1.patch create mode 100644 SOURCES/sap-hana-preconfigure-#111-part2-6edb1339a1a79c9e47f8023534e0a3db429dbf20.patch create mode 100644 SOURCES/sap-hana-preconfigure-#112-part1-d26152ada59c5e2919be3f7cf89927ac7bfd510d.patch create mode 100644 SOURCES/sap-hana-preconfigure-#112-part2-d26152ada59c5e2919be3f7cf89927ac7bfd510d.patch create mode 100644 SOURCES/sap-hana-preconfigure-#113-1442c5470eae0769a6ceee201621aab0518bb6f3.patch create mode 100644 SOURCES/sap-hana-preconfigure-#114-f011979fa05e938165c95a134bbdcc37a33f4eea.patch create mode 100644 SOURCES/sap-hana-preconfigure-#116-752f988bf105a325db12965d240bbe1462b72c78.patch create mode 100644 SOURCES/sap-hana-preconfigure-#119-75a1940d0230c0fb2957426952c5308e08919c06.patch create mode 100644 SOURCES/sap-hana-preconfigure-#94-#97-ecb7c33e9a8eddb633189d332683309d398fd54f.patch create mode 100644 SOURCES/sap-hana-preconfigure-#95-#96-c11288a8354bf14f665e2ec92ff6b49f6828edfc.patch create mode 100644 SOURCES/sap-hana-preconfigure-#98-6a417012022f38534ae5a5803062639446c9fa81.patch create mode 100644 SOURCES/sap-hana-preconfigure-#99-d64615413b0bd7741bd6d8e06e5676be36a24c41.patch create mode 100644 SOURCES/sap-hana-preconfigure-2.0.0.patch delete mode 100644 SOURCES/sap-hana-preconfigure-38a18c2890aa80c4562d002cc557945bdf9c5e7e.patch delete mode 100644 SOURCES/sap-preconfig-b10e9f539263e1a2fd9222d6c52c55c7cb337130.patch delete mode 100644 SOURCES/sap-preconfig-baa3b58a0d2a60bb0e222b3dac5190c8ea171cf3.patch create mode 100644 SOURCES/sap-preconfigure-#78-db645e39a38070ac0b3fe9f2f447d60e6eedac4a.patch create mode 100644 SOURCES/sap-preconfigure-#79-b056297b1e54662773d9b63850fdae34d2606fa1.patch create mode 100644 SOURCES/sap-preconfigure-#81-6be65f40569044307bbf41038b766ff571a08025.patch create mode 100644 SOURCES/sap-preconfigure-#82-70cd0f9f8b0f7de3e48c1af041a0d63443445052.patch create mode 100644 SOURCES/sap-preconfigure-#84-77e02082ae0784f88eab8f9d0f764c3981b9cf6d.patch create mode 100644 SOURCES/sap-preconfigure-#85-#86-840cafb7487687369d3597e6f9e21895da702094.patch create mode 100644 SOURCES/sap-preconfigure-#85-110d870eaac2efee2e131babacebc5337a15b3e3.patch create mode 100644 SOURCES/sap-preconfigure-#88-7595b96fbd6a7360d62413734bc652ed4c5e2771.patch create mode 100644 SOURCES/sap-preconfigure-#89-3f3c93eaddfafd08132017058b0b330108d2bd2c.patch create mode 100644 SOURCES/sap-preconfigure-#92-db1ed07c66286edbee756ed3504649975d333306.patch diff --git a/.gitignore b/.gitignore index 1974274..210d948 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -SOURCES/rhel-system-roles-sap-2019-09-30_18-11-12.tar.gz +SOURCES/sap-hana-preconfigure.tar.gz +SOURCES/sap-netweaver-preconfigure.tar.gz +SOURCES/sap-preconfigure.tar.gz diff --git a/.rhel-system-roles-sap.metadata b/.rhel-system-roles-sap.metadata index de9a4a4..98dfde8 100644 --- a/.rhel-system-roles-sap.metadata +++ b/.rhel-system-roles-sap.metadata @@ -1 +1,3 @@ -71a7dd706b059d82346b9ec876bbacc946974d70 SOURCES/rhel-system-roles-sap-2019-09-30_18-11-12.tar.gz +9ecaedd62786d616eb51fc09893537ebd8ff7e4f SOURCES/sap-hana-preconfigure.tar.gz +435e268e5adf767c382df673b6ee4bac7ddc55a8 SOURCES/sap-netweaver-preconfigure.tar.gz +8d8de726e02ee97fe2346938c22d891ea31efa2d SOURCES/sap-preconfigure.tar.gz diff --git a/SOURCES/rhel-system-roles-sap-0.7.2-rhel-7.8.patch b/SOURCES/rhel-system-roles-sap-0.7.2-rhel-7.8.patch deleted file mode 100644 index ab6224d..0000000 --- a/SOURCES/rhel-system-roles-sap-0.7.2-rhel-7.8.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up rhel-system-roles-sap-0.7.2/sap-hana-preconfigure/vars/RedHat_7.yml.me rhel-system-roles-sap-0.7.2/sap-hana-preconfigure/vars/RedHat_7.yml ---- rhel-system-roles-sap-0.7.2/sap-hana-preconfigure/vars/RedHat_7.yml.me 2019-10-15 16:26:41.311466458 +0200 -+++ rhel-system-roles-sap-0.7.2/sap-hana-preconfigure/vars/RedHat_7.yml 2019-10-15 18:48:35.470383628 +0200 -@@ -71,6 +71,10 @@ sap_hana_preconfigure_min_packages_7.6: - sap_hana_preconfigure_min_packages_7.7: - - [ 'kernel' , '3.10.0-1062.1.1.el7' ] - -+## Double check with SAP NOTE 2235581 -+sap_hana_preconfigure_min_packages_7.8: -+ - [ 'kernel' , '3.10.0-1101.el7' ] -+ - sap_hana_preconfigure_min_pkgs: "{{ lookup('vars','sap_hana_preconfigure_min_packages_' + ansible_distribution_version|string ) }}" - - sap_hana_preconfigure_packages: diff --git a/SOURCES/sap-hana-preconfigure-#101-063273dd09715cfcf69bcf3c1f4347225028ba70.patch b/SOURCES/sap-hana-preconfigure-#101-063273dd09715cfcf69bcf3c1f4347225028ba70.patch new file mode 100644 index 0000000..a5310f8 --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#101-063273dd09715cfcf69bcf3c1f4347225028ba70.patch @@ -0,0 +1,19 @@ +commit 063273dd09715cfcf69bcf3c1f4347225028ba70 +Author: Bernd Finger +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 diff --git a/SOURCES/sap-hana-preconfigure-#102-a622092d5063c2fb0d7996775521a52549e3a65a.patch b/SOURCES/sap-hana-preconfigure-#102-a622092d5063c2fb0d7996775521a52549e3a65a.patch new file mode 100644 index 0000000..44bbe9e --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#102-a622092d5063c2fb0d7996775521a52549e3a65a.patch @@ -0,0 +1,213 @@ +commit a622092d5063c2fb0d7996775521a52549e3a65a +Author: Bernd Finger +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: diff --git a/SOURCES/sap-hana-preconfigure-#104-#105-6d65f9b667a8a7dec17caa70c5df929b921691a6.patch b/SOURCES/sap-hana-preconfigure-#104-#105-6d65f9b667a8a7dec17caa70c5df929b921691a6.patch new file mode 100644 index 0000000..aba15c1 --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#104-#105-6d65f9b667a8a7dec17caa70c5df929b921691a6.patch @@ -0,0 +1,54 @@ +commit 6d65f9b667a8a7dec17caa70c5df929b921691a6 +Author: Bernd Finger +Date: Thu Jul 16 11:59:24 2020 +0200 + + solve issues #104, #105 + +diff --git a/tasks/RedHat/generic/disable-coredumps.yml b/tasks/RedHat/generic/disable-coredumps.yml +index cefdb68..640a60c 100644 +--- a/tasks/RedHat/generic/disable-coredumps.yml ++++ b/tasks/RedHat/generic/disable-coredumps.yml +@@ -9,7 +9,7 @@ + domain: "*" + limit_item: core + limit_type: "{{ line_item }}" +- value: 0 ++ value: '0' + with_items: + - hard + - soft +diff --git a/tasks/sapnote/2055470.yml b/tasks/sapnote/2055470.yml +index 893420a..aa7da75 100644 +--- a/tasks/sapnote/2055470.yml ++++ b/tasks/sapnote/2055470.yml +@@ -22,7 +22,7 @@ + changed_when: sapnote_2055470_mtusize.rc == 0 + failed_when: sapnote_2055470_mtusize.rc > 0 and sapnote_2055470_mtusize.rc != 90 + with_items: "{{ sap_hana_preconfigure_ppcle_mtu9000_if }}" +- when: not( (sap_hana_preconfigure_ppcle_mtu9000_if) or ( sap_hana_preconfigure_ppcle_mtu9000_if is none) or (sap_hana_preconfigure_ppcle_mtu9000_if | trim == '') ) ++ when: not( (sap_hana_preconfigure_ppcle_mtu9000_if is undefined) or (sap_hana_preconfigure_ppcle_mtu9000_if is none) or (sap_hana_preconfigure_ppcle_mtu9000_if | trim == '') ) + loop_control: + loop_var: line_item + +@@ -33,7 +33,7 @@ + line: ETHTOOL_OPTIONS_tso='-K iface tso on' + path: /etc/sysconfig/network-scripts/ifcfg-{{ line_item }} + with_items: "{{ sap_hana_preconfigure_ppcle_tso_if }}" +- when: not( (sap_hana_preconfigure_ppcle_tso_if) or ( sap_hana_preconfigure_ppcle_tso_if is none) or (sap_hana_preconfigure_ppcle_tso_if | trim == '') ) ++ when: not( (sap_hana_preconfigure_ppcle_tso_if is undefined) or (sap_hana_preconfigure_ppcle_tso_if is none) or (sap_hana_preconfigure_ppcle_tso_if | trim == '') ) + loop_control: + loop_var: line_item + +diff --git a/tasks/sapnote/2777782/10-increase-pidmax.yml b/tasks/sapnote/2777782/10-increase-pidmax.yml +index fe210d4..40860cb 100644 +--- a/tasks/sapnote/2777782/10-increase-pidmax.yml ++++ b/tasks/sapnote/2777782/10-increase-pidmax.yml +@@ -7,7 +7,7 @@ + sysctl: + sysctl_file: /etc/sysctl.d/sap.conf + name: kernel.pid_max +- value: 4194304 ++ value: '4194304' + state: present + sysctl_set: yes + reload: yes diff --git a/SOURCES/sap-hana-preconfigure-#107-6f8d7c964e2c95b37c68299e6077bc3f987faffb.patch b/SOURCES/sap-hana-preconfigure-#107-6f8d7c964e2c95b37c68299e6077bc3f987faffb.patch new file mode 100644 index 0000000..027ebc9 --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#107-6f8d7c964e2c95b37c68299e6077bc3f987faffb.patch @@ -0,0 +1,99 @@ +commit 6f8d7c964e2c95b37c68299e6077bc3f987faffb +Author: root +Date: Tue Jul 21 18:08:57 2020 +0200 + + solve issue #107 - Regenerate grub2 conf handler cannot be found when using Ansible 2.9.10 + +diff --git a/handlers/main.yml b/handlers/main.yml +index 3f59170..543d238 100644 +--- a/handlers/main.yml ++++ b/handlers/main.yml +@@ -1,8 +1,49 @@ + --- + +-- name: "Regenerate grub2 conf handler" +- import_tasks: tasks/RedHat/generic/regenerate-grub2-conf.yml +- when: sap_hana_preconfigure_run_grub2_mkconfig|d(true) ++- name: "Check if server is booted in BIOS or UEFI mode" ++ stat: ++ path: /sys/firmware/efi ++ get_checksum: no ++ register: efi_exists ++ listen: "Regenerate grub2 conf handler" ++ when: ++ - sap_hana_preconfigure_run_grub2_mkconfig|d(true) ++ ++- debug: ++ var: efi_exists.stat.exists ++ listen: "Regenerate grub2 conf handler" ++ when: ++ - sap_hana_preconfigure_run_grub2_mkconfig|d(true) ++ ++- name: "Run grub-mkconfig (BIOS mode)" ++ command: grub2-mkconfig -o /boot/grub2/grub.cfg ++ register: command_result ++ listen: "Regenerate grub2 conf handler" ++ when: ++ - not efi_exists.stat.exists ++ - sap_hana_preconfigure_run_grub2_mkconfig|d(true) ++ ++- debug: ++ var: command_result.stdout_lines, command_result.stderr_lines ++ listen: "Regenerate grub2 conf handler" ++ when: ++ - not efi_exists.stat.exists ++ - sap_hana_preconfigure_run_grub2_mkconfig|d(true) ++ ++- name: "Run grub-mkconfig (UEFI mode)" ++ command: grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg ++ register: command_result ++ listen: "Regenerate grub2 conf handler" ++ when: ++ - efi_exists.stat.exists ++ - sap_hana_preconfigure_run_grub2_mkconfig|d(true) ++ ++- debug: ++ var: command_result.stdout_lines, command_result.stderr_lines ++ listen: "Regenerate grub2 conf handler" ++ when: ++ - efi_exists.stat.exists ++ - sap_hana_preconfigure_run_grub2_mkconfig|d(true) + + - name: "Reboot handler" + fail: +diff --git a/tasks/RedHat/generic/regenerate-grub2-conf.yml b/tasks/RedHat/generic/regenerate-grub2-conf.yml +deleted file mode 100644 +index f369a66..0000000 +--- a/tasks/RedHat/generic/regenerate-grub2-conf.yml ++++ /dev/null +@@ -1,30 +0,0 @@ +---- +-# tasks file for sap-hana-preconfigure/handlers/main.yml: +- +-- debug: +- msg: "Regerate grub2 config" +- +-- name: "Check if server is booted in BIOS or UEFI mode" +- stat: +- path: /sys/firmware/efi +- get_checksum: no +- register: efi_exists +-- debug: +- var: efi_exists.stat.exists +- +-- name: "Run grub-mkconfig (BIOS mode)" +- command: grub2-mkconfig -o /boot/grub2/grub.cfg +- register: command_result +- when: +- - not efi_exists.stat.exists +-- debug: +- var: command_result.stdout_lines, command_result.stderr_lines +- +-- name: "Run grub-mkconfig (UEFI mode)" +- command: grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg +- register: command_result +- when: +- - efi_exists.stat.exists +-- debug: +- var: command_result.stdout_lines, command_result.stderr_lines +- diff --git a/SOURCES/sap-hana-preconfigure-#109-#110-89202367321b47c3fb5d52e50f5ea220c548fab5.patch b/SOURCES/sap-hana-preconfigure-#109-#110-89202367321b47c3fb5d52e50f5ea220c548fab5.patch new file mode 100644 index 0000000..617eab8 --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#109-#110-89202367321b47c3fb5d52e50f5ea220c548fab5.patch @@ -0,0 +1,105 @@ +commit 89202367321b47c3fb5d52e50f5ea220c548fab5 +Author: Bernd Finger +Date: Mon Jul 27 18:51:02 2020 +0200 + + 109: Support for RHEL 7.7 + 110: Minimum kernel versions from SAP note 2812427 need to be moved to sap-preconfigure + +diff --git a/vars/RedHat_7.yml b/vars/RedHat_7.yml +index 3978317..e843eb3 100644 +--- a/vars/RedHat_7.yml ++++ b/vars/RedHat_7.yml +@@ -21,36 +21,60 @@ __sap_hana_preconfigure_sapnotes: + # 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_x86_64: + - [ '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_2_ppc64le: ++ - [ 'kernel' , '3.10.0-327.62.4.el7' ] ++ - [ 'systemd' , '219-19.el7_2.4' ] ++ ++__sap_hana_preconfigure_min_packages_7_3_x86_64: ++ - [ '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_3_ppc64le: + - [ '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: ++# Attention: SAP note 2812427 requires more recent package kernel-3.10.0-693.58.1, covered by role sap-preconfigure ++__sap_hana_preconfigure_min_packages_7_4_x86_64: ++ - [ 'kernel' , '3.10.0-693.11.6.el7' ] ++ - [ 'tuned-profiles-sap-hana' , '2.8.0-5.el7_4.2' ] ++ ++__sap_hana_preconfigure_min_packages_7_4_ppc64le: + - [ '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: +- - [ 'kernel' , '3.10.0-862.41.1.el7' ] ++__sap_hana_preconfigure_min_packages_7_5_x86_64: ++ ++__sap_hana_preconfigure_min_packages_7_5_ppc64le: ++ ++# Attention: SAP note 2812427 requires more recent package kernel-3.10.0-957.35.1, covered by role sap-preconfigure ++__sap_hana_preconfigure_min_packages_7_6_x86_64: ++ - [ 'kernel' , '3.10.0-957.1.3.el7' ] ++ ++__sap_hana_preconfigure_min_packages_7_6_ppc64le: ++ - [ 'kernel' , '3.10.0-957.1.3.el7' ] ++ ++# SAP note 2292690: ++__sap_hana_preconfigure_min_packages_7_7_x86_64: ++ - [ 'kernel' , '3.10.0-1062.21.1.el7' ] ++ ++__sap_hana_preconfigure_min_packages_7_7_ppc64le: ++ - [ 'kernel' , '3.10.0-1062.26.1.el7' ] + +-# SAP note 2812427: +-__sap_hana_preconfigure_min_packages_7_6: +- - [ 'kernel' , '3.10.0-957.27.4.el7' ] ++__sap_hana_preconfigure_min_packages_7_8_x86_64: + +-# SAP note 2812427: +-__sap_hana_preconfigure_min_packages_7_7: +- - [ 'kernel' , '3.10.0-1062.1.1.el7' ] ++__sap_hana_preconfigure_min_packages_7_8_ppc64le: + +-__sap_hana_preconfigure_min_packages_7_8: ++__sap_hana_preconfigure_min_packages_7_9_x86_64: + +-__sap_hana_preconfigure_min_packages_7_9: ++__sap_hana_preconfigure_min_packages_7_9_ppc64le: + +-__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars','__sap_hana_preconfigure_min_packages_' + ansible_distribution_version|string|replace (\".\", \"_\") ) }}" ++__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars','__sap_hana_preconfigure_min_packages_' + ansible_distribution_version|string|replace (\".\", \"_\") + '_' + ansible_architecture|string) }}" + + __sap_hana_preconfigure_packages: + # SAP note 2009879: +diff --git a/vars/RedHat_8.yml b/vars/RedHat_8.yml +index 94d862b..0f6cdf8 100644 +--- a/vars/RedHat_8.yml ++++ b/vars/RedHat_8.yml +@@ -25,11 +25,13 @@ __sap_hana_preconfigure_sapnotes: + # variable __sap_hana_preconfigure_min_pkgs will be undefined as well. + + # Minimum required package levels for RHEL 8.0: ++# Attention: SAP note 2812427 requires more recent package kernel-4.18.0-80.15.1.el8_0 also for x86_64, covered by role sap-preconfigure + __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' ] + ++# Minimum required package levels for RHEL 8.1: + __sap_hana_preconfigure_min_packages_8_1_x86_64: + - [ 'kernel' , '4.18.0-147.5.1.el8_1' ] + diff --git a/SOURCES/sap-hana-preconfigure-#111-part1-03affb58325bf1c370ea3e0d76e291eb9485acf1.patch b/SOURCES/sap-hana-preconfigure-#111-part1-03affb58325bf1c370ea3e0d76e291eb9485acf1.patch new file mode 100644 index 0000000..bd12c71 --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#111-part1-03affb58325bf1c370ea3e0d76e291eb9485acf1.patch @@ -0,0 +1,116 @@ +commit 03affb58325bf1c370ea3e0d76e291eb9485acf1 +Author: Bernd Finger +Date: Mon Jul 27 20:10:03 2020 +0200 + + 111 - Add support for IBM service and productivity tools for Power + +diff --git a/README.md b/README.md +index efb60f1..37ecdbe 100644 +--- a/README.md ++++ b/README.md +@@ -114,6 +114,13 @@ If you want the role to set the RHEL release to a certain fixed minor release (a + sap_hana_preconfigure_set_minor_release + ``` + ++### URL for IBM service and productivity tools for POWER (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 ++sap_hana_preconfigure_ibm_power_repo_url ++``` ++ + ### How to behave if reboot is required + The following variable will ensure that the role will fail if a reboot is required, if undefined or set to `yes`, which is also the default. Rebooting the managed node can be done in the playbook which is calling this role. By setting the variable to `no`, the role will not fail if a reboot is required. + ```yaml +diff --git a/defaults/main.yml b/defaults/main.yml +index 4929e66..c008330 100644 +--- a/defaults/main.yml ++++ b/defaults/main.yml +@@ -73,6 +73,9 @@ sap_hana_preconfigure_update: no + + sap_hana_preconfigure_kernel_parameters: "{{ __sap_hana_preconfigure_kernel_parameters_default }}" + ++# sap_hana_preconfigure_ibm_power_repo_url: "{{ __sap_hana_preconfigure_ibm_power_repo_url }}" ++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' ++ + #### The following parameters are for PPC LE only + ## add a list of interfaces where MTU size will be set to 9000 + ## defaults to empty +diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml +index 502e94f..ec6e546 100644 +--- a/tasks/RedHat/installation.yml ++++ b/tasks/RedHat/installation.yml +@@ -59,28 +59,37 @@ + + ### If this task fails, you need to enable the IBM PowerTools repository + ### see https://www14.software.ibm.com/support/customercare/sas/f/lopdiags/home.html for details +-## +-### # yum -y install http://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-latest.noarch.rpm +-### # /opt/ibm/lop/configure +-### # yum -y install ibm-power-managed-rhel7 +-### +-- name: Install IBM Tools ++ ++- name: Install the ibm-power-repo package ++ yum: ++ name: "{{ sap_hana_preconfigure_ibm_power_repo_url }}" ++ state: present ++ when: ansible_architecture == "ppc64le" ++ ++- name: Accept the license for the IBM tools ++ shell: | ++ MORE=+1000 /opt/ibm/lop/configure <<-EOF ++ y ++ EOF ++ when: ansible_architecture == "ppc64le" ++ ++- name: Install IBM tools + package: + state: latest + name: "{{ __sap_hana_preconfigure_required_ppc64le }}" +- when: ansible_architecture == "ppc64le" ++ when: ansible_architecture == "ppc64le" + +-- name: Get status of installed IBM Tools ++- 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" ++ when: ansible_architecture == "ppc64le" + + - debug: + var: ibm_result.results +- when: ansible_architecture == "ppc64le" ++ when: ansible_architecture == "ppc64le" + + - name: Ensure minimum packages are installed + block: +diff --git a/vars/RedHat_7.yml b/vars/RedHat_7.yml +index e843eb3..632e469 100644 +--- a/vars/RedHat_7.yml ++++ b/vars/RedHat_7.yml +@@ -120,6 +120,8 @@ __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_ibm_power_repo_url: 'http://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-lastest.noarch.rpm' ++ + # As per https://www14.software.ibm.com/support/customercare/sas/f/lopdiags/home.html : + __sap_hana_preconfigure_required_ppc64le: + - librtas +diff --git a/vars/RedHat_8.yml b/vars/RedHat_8.yml +index 0f6cdf8..8fbfa89 100644 +--- a/vars/RedHat_8.yml ++++ b/vars/RedHat_8.yml +@@ -103,6 +103,8 @@ __sap_hana_preconfigure_packages: + # 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_ibm_power_repo_url: 'http://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-lastest.noarch.rpm' ++ + __sap_hana_preconfigure_required_ppc64le: + - librtas + - src diff --git a/SOURCES/sap-hana-preconfigure-#111-part2-6edb1339a1a79c9e47f8023534e0a3db429dbf20.patch b/SOURCES/sap-hana-preconfigure-#111-part2-6edb1339a1a79c9e47f8023534e0a3db429dbf20.patch new file mode 100644 index 0000000..2df6611 --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#111-part2-6edb1339a1a79c9e47f8023534e0a3db429dbf20.patch @@ -0,0 +1,47 @@ +commit 6edb1339a1a79c9e47f8023534e0a3db429dbf20 +Author: Bernd Finger +Date: Tue Jul 28 14:37:08 2020 +0200 + + typo in repo name for IBM Power tools + +diff --git a/defaults/main.yml b/defaults/main.yml +index c008330..8d0d1d7 100644 +--- a/defaults/main.yml ++++ b/defaults/main.yml +@@ -73,8 +73,8 @@ sap_hana_preconfigure_update: no + + sap_hana_preconfigure_kernel_parameters: "{{ __sap_hana_preconfigure_kernel_parameters_default }}" + +-# sap_hana_preconfigure_ibm_power_repo_url: "{{ __sap_hana_preconfigure_ibm_power_repo_url }}" +-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' ++# 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' ++sap_hana_preconfigure_ibm_power_repo_url: "{{ __sap_hana_preconfigure_ibm_power_repo_url }}" + + #### The following parameters are for PPC LE only + ## add a list of interfaces where MTU size will be set to 9000 +diff --git a/vars/RedHat_7.yml b/vars/RedHat_7.yml +index 632e469..dd5d2dc 100644 +--- a/vars/RedHat_7.yml ++++ b/vars/RedHat_7.yml +@@ -120,7 +120,7 @@ __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_ibm_power_repo_url: 'http://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-lastest.noarch.rpm' ++__sap_hana_preconfigure_ibm_power_repo_url: 'http://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-latest.noarch.rpm' + + # As per https://www14.software.ibm.com/support/customercare/sas/f/lopdiags/home.html : + __sap_hana_preconfigure_required_ppc64le: +diff --git a/vars/RedHat_8.yml b/vars/RedHat_8.yml +index 8fbfa89..7697ac1 100644 +--- a/vars/RedHat_8.yml ++++ b/vars/RedHat_8.yml +@@ -103,7 +103,7 @@ __sap_hana_preconfigure_packages: + # 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_ibm_power_repo_url: 'http://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-lastest.noarch.rpm' ++__sap_hana_preconfigure_ibm_power_repo_url: 'http://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-latest.noarch.rpm' + + __sap_hana_preconfigure_required_ppc64le: + - librtas diff --git a/SOURCES/sap-hana-preconfigure-#112-part1-d26152ada59c5e2919be3f7cf89927ac7bfd510d.patch b/SOURCES/sap-hana-preconfigure-#112-part1-d26152ada59c5e2919be3f7cf89927ac7bfd510d.patch new file mode 100644 index 0000000..e387f3c --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#112-part1-d26152ada59c5e2919be3f7cf89927ac7bfd510d.patch @@ -0,0 +1,30 @@ +commit d26152ada59c5e2919be3f7cf89927ac7bfd510d +Author: Bernd Finger +Date: Thu Jul 30 19:12:22 2020 +0200 + + issue 112: include module is/will be deprecated and is causing ansible-lint to fail + +diff --git a/tasks/RedHat/configuration.yml b/tasks/RedHat/configuration.yml +index f0bcbd4..04bb486 100644 +--- a/tasks/RedHat/configuration.yml ++++ b/tasks/RedHat/configuration.yml +@@ -17,6 +17,6 @@ + include_tasks: "sapnote/{{ item }}.yml" + with_items: "{{ __sap_hana_preconfigure_sapnotes | difference(['']) }}" + +-- include: "{{ './' + ansible_distribution + '_' + ansible_distribution_major_version + '/recommendations.yml' }}" ++- include_tasks: "{{ './' + ansible_distribution + '_' + ansible_distribution_major_version + '/recommendations.yml' }}" + + ... +diff --git a/tasks/SLES/configuration.yml b/tasks/SLES/configuration.yml +index a7c49e6..b0b4503 100644 +--- a/tasks/SLES/configuration.yml ++++ b/tasks/SLES/configuration.yml +@@ -12,6 +12,6 @@ + include_tasks: "sapnotes/{{ item }}/configuration.yml" + with_items: "{{ __sap_hana_preconfigure_sapnotes | difference(['']) }}" + +-- include: "{{ './' + ansible_distribution + ansible_distribution_major_version + '/recommendations.yml' }}" ++- include_tasks: "{{ './' + ansible_distribution + ansible_distribution_major_version + '/recommendations.yml' }}" + + ... diff --git a/SOURCES/sap-hana-preconfigure-#112-part2-d26152ada59c5e2919be3f7cf89927ac7bfd510d.patch b/SOURCES/sap-hana-preconfigure-#112-part2-d26152ada59c5e2919be3f7cf89927ac7bfd510d.patch new file mode 100644 index 0000000..1424d0e --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#112-part2-d26152ada59c5e2919be3f7cf89927ac7bfd510d.patch @@ -0,0 +1,19 @@ +commit 896c956aab61a0ab94ca1e36c9d8693b4b6c2a5a +Author: Bernd Finger +Date: Thu Jul 30 19:15:21 2020 +0200 + + The note about manually configuring access to the IBM power tools can be removed. + +diff --git a/README.md b/README.md +index 37ecdbe..eeb71dc 100644 +--- a/README.md ++++ b/README.md +@@ -58,8 +58,6 @@ Note + ---- + For finding out which SAP notes will be used by this role, please check the contents of variable `__sap_hana_preconfigure_sapnotes` in files `vars/*.yml` (choose the file which matches your OS distribution and version). + +-Before running this role on a RHEL on ppc64le system, make sure that you have access to the required IBM repos/packages as mentioned in the comments to variable `__sap_hana_preconfigure_required_ppc64le`, see files `vars/*.yml`. +- + Do not run this role against an SAP HANA or other production system. The role will enforce a certain configuration on the managed node(s), which might not be intended. + + Role Variables diff --git a/SOURCES/sap-hana-preconfigure-#113-1442c5470eae0769a6ceee201621aab0518bb6f3.patch b/SOURCES/sap-hana-preconfigure-#113-1442c5470eae0769a6ceee201621aab0518bb6f3.patch new file mode 100644 index 0000000..a07e74d --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#113-1442c5470eae0769a6ceee201621aab0518bb6f3.patch @@ -0,0 +1,50 @@ +commit 1442c5470eae0769a6ceee201621aab0518bb6f3 +Author: Bernd Finger +Date: Sat Aug 1 01:12:16 2020 +0200 + + 113: ansible-line failing + +diff --git a/tasks/sapnote/2013638.yml b/tasks/sapnote/2013638.yml +index 5e23009..53340c6 100644 +--- a/tasks/sapnote/2013638.yml ++++ b/tasks/sapnote/2013638.yml +@@ -1,8 +1,7 @@ + --- + # OS RELEASE: RHEL 6.5 +- +- +-fail: +- msg: "RHEL 6.5 is out of maintenance\nPlease upgrade to RHEL 6.7 at least" ++# ++- fail: ++ msg: "RHEL 6.5 is out of maintenance.\nPlease upgrade to RHEL 6.7 at least" + + ... +diff --git a/tasks/sapnote/2136965.yml b/tasks/sapnote/2136965.yml +index a0e3f89..8041f2b 100644 +--- a/tasks/sapnote/2136965.yml ++++ b/tasks/sapnote/2136965.yml +@@ -4,7 +4,7 @@ + # https://launchpad.support.sap.com/#/notes/2136965 + + +-fail: +- msg: "RHEL 6.6 is out of maintenance\nPlease upgrade to RHEL 6.7 at least" ++- fail: ++ msg: "RHEL 6.6 is out of maintenance\nPlease upgrade to RHEL 6.7 at least" + + ... +diff --git a/tasks/sapnote/2247020.yml b/tasks/sapnote/2247020.yml +index 445de24..81d9c60 100644 +--- a/tasks/sapnote/2247020.yml ++++ b/tasks/sapnote/2247020.yml +@@ -1,7 +1,7 @@ + --- + # OS RELEASE: RHEL 6.7 + +-fail: +- msg: "RHEL 6.7 is not implemented yet" ++- fail: ++ msg: "RHEL 6.7 is not implemented yet" + + ... diff --git a/SOURCES/sap-hana-preconfigure-#114-f011979fa05e938165c95a134bbdcc37a33f4eea.patch b/SOURCES/sap-hana-preconfigure-#114-f011979fa05e938165c95a134bbdcc37a33f4eea.patch new file mode 100644 index 0000000..239077b --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#114-f011979fa05e938165c95a134bbdcc37a33f4eea.patch @@ -0,0 +1,370 @@ +commit f011979fa05e938165c95a134bbdcc37a33f4eea +Author: Bernd Finger +Date: Sat Aug 1 01:28:00 2020 +0200 + + 114: remove all trailing whitespaces + +diff --git a/handlers/main.yml b/handlers/main.yml +index 543d238..b3dbdec 100644 +--- a/handlers/main.yml ++++ b/handlers/main.yml +@@ -19,7 +19,7 @@ + command: grub2-mkconfig -o /boot/grub2/grub.cfg + register: command_result + listen: "Regenerate grub2 conf handler" +- when: ++ when: + - not efi_exists.stat.exists + - sap_hana_preconfigure_run_grub2_mkconfig|d(true) + +diff --git a/tasks/RedHat/configuration.yml b/tasks/RedHat/configuration.yml +index 04bb486..0d77b5d 100644 +--- a/tasks/RedHat/configuration.yml ++++ b/tasks/RedHat/configuration.yml +@@ -5,7 +5,7 @@ + # verbosity: "{{ debuglevel }}" + # + - name: list of required SAP Notes +- debug: ++ debug: + var: __sap_hana_preconfigure_sapnotes | difference(['']) + + # We want to disable firewalld, so we need to check if firewalld is installed +@@ -13,10 +13,10 @@ + package_facts: + manager: auto + +-- name: include configuration actions for required sapnotes ++- name: include configuration actions for required sapnotes + include_tasks: "sapnote/{{ item }}.yml" + with_items: "{{ __sap_hana_preconfigure_sapnotes | difference(['']) }}" +- ++ + - include_tasks: "{{ './' + ansible_distribution + '_' + ansible_distribution_major_version + '/recommendations.yml' }}" + + ... +diff --git a/tasks/RedHat/generic/configure-tuned.yml b/tasks/RedHat/generic/configure-tuned.yml +index ce66b31..50b8752 100644 +--- a/tasks/RedHat/generic/configure-tuned.yml ++++ b/tasks/RedHat/generic/configure-tuned.yml +@@ -22,7 +22,7 @@ + block: + - name: Switch to tuned profile sap-hana if not currently active + command: /usr/sbin/tuned-adm profile sap-hana +- ++ + - name: Show active tuned profile + command: bash -lc "/usr/sbin/tuned-adm active | grep ":" | cut -d ":" -f 2 | awk '{$1=$1;print}'" + register: new_profile +@@ -67,7 +67,7 @@ + block: + - name: Switch to tuned profiles sap-hana sap-hana-ppc64le if not currently active + command: /usr/sbin/tuned-adm profile sap-hana sap-hana-ppc64le +- ++ + - name: Show active tuned profile + command: bash -lc "/usr/sbin/tuned-adm active | grep ":" | cut -d ":" -f 2 | awk '{$1=$1;print}'" + register: new_profile_ppc64le +diff --git a/tasks/RedHat/generic/disable-coredumps.yml b/tasks/RedHat/generic/disable-coredumps.yml +index 640a60c..a40a4c5 100644 +--- a/tasks/RedHat/generic/disable-coredumps.yml ++++ b/tasks/RedHat/generic/disable-coredumps.yml +@@ -4,11 +4,11 @@ + msg: "imported RedHat/generic/disable-coredumps.yml" + + - name: disable core file creation for all users +- pam_limits: ++ pam_limits: + dest: /etc/security/limits.d/99-sap.conf +- domain: "*" +- limit_item: core +- limit_type: "{{ line_item }}" ++ domain: "*" ++ limit_item: core ++ limit_type: "{{ line_item }}" + value: '0' + with_items: + - hard +diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml +index ec6e546..9bd3dfa 100644 +--- a/tasks/RedHat/installation.yml ++++ b/tasks/RedHat/installation.yml +@@ -21,7 +21,7 @@ + state: present + + when: sap_hana_preconfigure_enable_sap_hana_repos +- ++ + - name: Detect if the minor RHEL release is set + shell: subscription-manager release --show | awk '{print $NF}' + register: subscription_manager_release_result +@@ -131,7 +131,7 @@ + when: sap_hana_preconfigure_fact_minpkglist | d([]) + # when: not ( sap_hana_preconfigure_fact_minpkglist == [ "" ] ) + +- when: ++ when: + - sap_hana_preconfigure_min_package_check|bool + - __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 == '') ) +diff --git a/tasks/RedHat_7/recommendations.yml b/tasks/RedHat_7/recommendations.yml +index 80a8eb0..fefa213 100644 +--- a/tasks/RedHat_7/recommendations.yml ++++ b/tasks/RedHat_7/recommendations.yml +@@ -3,11 +3,11 @@ + ## This creates the SAP Users in case you define them in your playbook + ## This has been done for providers who want to create the SAP users before handing + ## over the image to clients +-- name: ensure sapadm group and sapadm user is created ++- name: ensure sapadm group and sapadm user is created + block: +- - name: ensure sapdm user exists +- group: +- name: sapsys ++ - name: ensure sapdm user exists ++ group: ++ name: sapsys + gid: "{{ sap_sapsys_gid }}" + - name: ensure sapadm user exists + user: +@@ -19,7 +19,7 @@ + - sap_sapsys_gid is defined + - sap_sapadm_uid is defined + - sap_sapadm_pw_clear is defined +- ++ + ### Disable tempfile handling, otherwise things are gone after reboot + # already in sap-preconfigure, sapnote/2002167/06-additional-notes-for-installing-sap-systems.yml + # - name: disable temp file handling for SAP applications +diff --git a/tasks/RedHat_8/recommendations.yml b/tasks/RedHat_8/recommendations.yml +index f3ba349..382eda1 100644 +--- a/tasks/RedHat_8/recommendations.yml ++++ b/tasks/RedHat_8/recommendations.yml +@@ -3,11 +3,11 @@ + ## Most of this is described in SAP Note 2009879 + + ## TODO: Next task should be moved to sap-deploy, or sap-hostagent install ! +-- name: ensure sapsys group and sapadm user are created ++- name: ensure sapsys group and sapadm user are created + block: +- - name: ensure sapsys group exists +- group: +- name: sapsys ++ - name: ensure sapsys group exists ++ group: ++ name: sapsys + gid: "{{ sap_sapsys_gid }}" + - name: ensure sapadm user exists + user: +@@ -20,7 +20,6 @@ + - sap_sapsys_gid is defined + - sap_sapadm_uid is defined + - sap_sapadm_pw_clear is defined +- + + ### Firewall Settings can only be done if SAP instance ID is known, + ### otherwise disable firewall +diff --git a/tasks/SLES/configuration.yml b/tasks/SLES/configuration.yml +index b0b4503..f665c73 100644 +--- a/tasks/SLES/configuration.yml ++++ b/tasks/SLES/configuration.yml +@@ -5,13 +5,13 @@ + # verbosity: "{{ debuglevel }}" + # + - name: list of required SAP Notes +- debug: ++ debug: + var: __sap_hana_preconfigure_sapnotes | difference(['']) + +-- name: include configuration actions for required sapnotes ++- name: include configuration actions for required sapnotes + include_tasks: "sapnotes/{{ item }}/configuration.yml" + with_items: "{{ __sap_hana_preconfigure_sapnotes | difference(['']) }}" +- ++ + - include_tasks: "{{ './' + ansible_distribution + ansible_distribution_major_version + '/recommendations.yml' }}" + + ... +diff --git a/tasks/SLES/installation.yml b/tasks/SLES/installation.yml +index d9b3472..fab2b34 100644 +--- a/tasks/SLES/installation.yml ++++ b/tasks/SLES/installation.yml +@@ -5,11 +5,11 @@ + # verbosity: "{{ debuglevel }}" + # + - name: list of required SAP Notes +- debug: ++ debug: + var: __sap_hana_preconfigure_sapnotes | difference(['']) + +-- name: include configuration actions for required sapnotes ++- name: include configuration actions for required sapnotes + include_tasks: "tasks/sapnote/{{ item }}/installation.yml" + with_items: "{{ __sap_hana_preconfigure_sapnotes | difference(['']) }}" +- ++ + ... +diff --git a/tasks/SLES15/recommendations.yml b/tasks/SLES15/recommendations.yml +index 71fcd3b..821bb46 100644 +--- a/tasks/SLES15/recommendations.yml ++++ b/tasks/SLES15/recommendations.yml +@@ -1,12 +1,11 @@ + --- + +- + ## TODO: Next task should be moved to sap-deploy, or sap-hostagent install ! +-- name: ensure sapadm group and sapadm user is created ++- name: ensure sapadm group and sapadm user is created + block: +- - name: ensure sapadm user exists +- group: +- name: sapsys ++ - name: ensure sapadm user exists ++ group: ++ name: sapsys + gid: "{{ sap_sapsys_gid }}" + - name: ensure sapadm user exists + user: +@@ -18,6 +17,5 @@ + - sap_sapsys_gid is defined + - sap_sapadm_uid is defined + - sap_sapadm_pw_clear is defined +- + + ... +diff --git a/tasks/sapnote/1275776/configuration.yml b/tasks/sapnote/1275776/configuration.yml +index 88e55f7..15d869c 100644 +--- a/tasks/sapnote/1275776/configuration.yml ++++ b/tasks/sapnote/1275776/configuration.yml +@@ -14,7 +14,7 @@ + + - name: "1275776 - Configuration saptune sap note 1275776" + command: "saptune note apply 1275776" +- ++ + - name: "1275776 - Configuration saptune sap note 1984787" + command: "saptune note apply 1984787" + +diff --git a/tasks/sapnote/1944799/installation.yml b/tasks/sapnote/1944799/installation.yml +index 385d727..9260ede 100644 +--- a/tasks/sapnote/1944799/installation.yml ++++ b/tasks/sapnote/1944799/installation.yml +@@ -25,10 +25,9 @@ + - name: "1944799 - PDF 8.1 Package List Packages" + zypper: + name: "{{ packages }}" +- type: package ++ type: package + vars: + packages: + - libssh2-1 + - libopenssl1_0_0 + ... +- +diff --git a/tasks/sapnote/2009879_7.yml b/tasks/sapnote/2009879_7.yml +index c86b364..89dc1a5 100644 +--- a/tasks/sapnote/2009879_7.yml ++++ b/tasks/sapnote/2009879_7.yml +@@ -25,7 +25,7 @@ + with_items: + - { src: 'libssl.so.1.0.1e', dest: 'libssl.so.1.0.1' } + - { src: 'libcrypto.so.1.0.1e', dest: 'libcrypto.so.1.0.1' } +- when: ++ when: + ( ansible_distribution_version == '7.2' ) + loop_control: + loop_var: line_item +@@ -35,7 +35,7 @@ + with_items: + - { src: 'libssl.so.10', dest: 'libssl.so.1.0.1' } + - { src: 'libcrypto.so.10', dest: 'libcrypto.so.1.0.1' } +- when: ++ when: + ( ansible_distribution_version != '7.2' ) + loop_control: + loop_var: line_item +diff --git a/tasks/sapnote/2055470.yml b/tasks/sapnote/2055470.yml +index aa7da75..b958e52 100644 +--- a/tasks/sapnote/2055470.yml ++++ b/tasks/sapnote/2055470.yml +@@ -36,7 +36,7 @@ + when: not( (sap_hana_preconfigure_ppcle_tso_if is undefined) or (sap_hana_preconfigure_ppcle_tso_if is none) or (sap_hana_preconfigure_ppcle_tso_if | trim == '') ) + loop_control: + loop_var: line_item +- ++ + - name: add largesend parameter + sysctl: + sysctl_file: /etc/sysctl.d/ibm_largesend.conf +diff --git a/tasks/sapnote/2382421.yml b/tasks/sapnote/2382421.yml +index 794e728..3847edc 100644 +--- a/tasks/sapnote/2382421.yml ++++ b/tasks/sapnote/2382421.yml +@@ -3,10 +3,10 @@ + # SAP Note: 2382421 - Optimizing the Network Configuration on HANA- and OS-Level + # + - name: setting kernel tunables as in SAP NOTE 2382421 +- sysctl: ++ sysctl: + sysctl_file: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" + name: "{{ line_item.name }}" +- value: "{{ line_item.value }}" ++ value: "{{ line_item.value }}" + state: present + sysctl_set: yes + reload: yes +diff --git a/tasks/sapnote/2578899/configuration.yml b/tasks/sapnote/2578899/configuration.yml +index e554a2d..9f221cb 100644 +--- a/tasks/sapnote/2578899/configuration.yml ++++ b/tasks/sapnote/2578899/configuration.yml +@@ -1,6 +1,6 @@ + --- + +-- name: 2588899 - I/O scheduler ++- name: 2588899 - I/O scheduler + lineinfile: + path: /etc/default/grub + backup: yes +diff --git a/tasks/sapnote/2578899/installation.yml b/tasks/sapnote/2578899/installation.yml +index 28d798e..0c41def 100644 +--- a/tasks/sapnote/2578899/installation.yml ++++ b/tasks/sapnote/2578899/installation.yml +@@ -10,7 +10,7 @@ + - libopenssl1_0_0 + + +-- name: 2578899 - sysstat - monitoring data ++- name: 2578899 - sysstat - monitoring data + package: + name: "sysstat" + +diff --git a/tasks/sapnote/2684254/configuration.yml b/tasks/sapnote/2684254/configuration.yml +index 53fd4d9..f7b9411 100644 +--- a/tasks/sapnote/2684254/configuration.yml ++++ b/tasks/sapnote/2684254/configuration.yml +@@ -1,10 +1,10 @@ + --- +-- name: 2684254 - Increase UserTasksMax ++- name: 2684254 - Increase UserTasksMax + copy: + dest: "/etc/systemd/logind.conf.d/sap.conf" + content: | + [Login] +- UserTasksMax=infinity ++ UserTasksMax=infinity + #- name: Turn off auto-numa balancing + # sysctl: + # sysctl_file: /etc/sysctl.d/sap_hana.conf +diff --git a/tasks/sapnote/2684254/installation.yml b/tasks/sapnote/2684254/installation.yml +index f24fb54..d669d01 100644 +--- a/tasks/sapnote/2684254/installation.yml ++++ b/tasks/sapnote/2684254/installation.yml +@@ -8,7 +8,7 @@ + package: + name: "{{ packages }}" + vars: +- packages: ++ packages: + - libopenssl1_0_0 + - libssh2-1 + diff --git a/SOURCES/sap-hana-preconfigure-#116-752f988bf105a325db12965d240bbe1462b72c78.patch b/SOURCES/sap-hana-preconfigure-#116-752f988bf105a325db12965d240bbe1462b72c78.patch new file mode 100644 index 0000000..0401b99 --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#116-752f988bf105a325db12965d240bbe1462b72c78.patch @@ -0,0 +1,61 @@ +commit 752f988bf105a325db12965d240bbe1462b72c78 +Author: Bernd Finger +Date: Tue Aug 4 17:12:44 2020 +0200 + + issue 116: add an option for not adding the repo for IBM service and productivity tools for POWER + +diff --git a/README.md b/README.md +index eeb71dc..e921f16 100644 +--- a/README.md ++++ b/README.md +@@ -112,6 +112,12 @@ If you want the role to set the RHEL release to a certain fixed minor release (a + sap_hana_preconfigure_set_minor_release + ``` + ++### 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 ++sap_hana_preconfigure_add_ibm_power_repo ++``` ++ + ### URL for IBM service and productivity tools for POWER (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. +diff --git a/defaults/main.yml b/defaults/main.yml +index 8d0d1d7..7a5d862 100644 +--- a/defaults/main.yml ++++ b/defaults/main.yml +@@ -73,6 +73,8 @@ sap_hana_preconfigure_update: no + + sap_hana_preconfigure_kernel_parameters: "{{ __sap_hana_preconfigure_kernel_parameters_default }}" + ++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' + sap_hana_preconfigure_ibm_power_repo_url: "{{ __sap_hana_preconfigure_ibm_power_repo_url }}" + +diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml +index 9bd3dfa..7796420 100644 +--- a/tasks/RedHat/installation.yml ++++ b/tasks/RedHat/installation.yml +@@ -64,14 +64,18 @@ + yum: + name: "{{ sap_hana_preconfigure_ibm_power_repo_url }}" + state: present +- when: ansible_architecture == "ppc64le" ++ when: ++ - 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 +- when: ansible_architecture == "ppc64le" ++ when: ++ - ansible_architecture == "ppc64le" ++ - sap_hana_preconfigure_add_ibm_power_repo|d(true) + + - name: Install IBM tools + package: diff --git a/SOURCES/sap-hana-preconfigure-#119-75a1940d0230c0fb2957426952c5308e08919c06.patch b/SOURCES/sap-hana-preconfigure-#119-75a1940d0230c0fb2957426952c5308e08919c06.patch new file mode 100644 index 0000000..3528ead --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#119-75a1940d0230c0fb2957426952c5308e08919c06.patch @@ -0,0 +1,18 @@ +commit 75a1940d0230c0fb2957426952c5308e08919c06 +Author: Bernd Finger +Date: Mon Sep 21 10:32:34 2020 +0200 + + solve issue #119 + +diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml +index 7796420..491c8ab 100644 +--- a/tasks/RedHat/installation.yml ++++ b/tasks/RedHat/installation.yml +@@ -64,6 +64,7 @@ + yum: + name: "{{ sap_hana_preconfigure_ibm_power_repo_url }}" + state: present ++ disable_gpg_check: True + when: + - ansible_architecture == "ppc64le" + - sap_hana_preconfigure_add_ibm_power_repo|d(true) diff --git a/SOURCES/sap-hana-preconfigure-#94-#97-ecb7c33e9a8eddb633189d332683309d398fd54f.patch b/SOURCES/sap-hana-preconfigure-#94-#97-ecb7c33e9a8eddb633189d332683309d398fd54f.patch new file mode 100644 index 0000000..8ce4131 --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#94-#97-ecb7c33e9a8eddb633189d332683309d398fd54f.patch @@ -0,0 +1,234 @@ +commit ecb7c33e9a8eddb633189d332683309d398fd54f +Author: Bernd Finger +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: diff --git a/SOURCES/sap-hana-preconfigure-#95-#96-c11288a8354bf14f665e2ec92ff6b49f6828edfc.patch b/SOURCES/sap-hana-preconfigure-#95-#96-c11288a8354bf14f665e2ec92ff6b49f6828edfc.patch new file mode 100644 index 0000000..f228ea4 --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#95-#96-c11288a8354bf14f665e2ec92ff6b49f6828edfc.patch @@ -0,0 +1,85 @@ +commit c11288a8354bf14f665e2ec92ff6b49f6828edfc +Author: Bernd Finger +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: diff --git a/SOURCES/sap-hana-preconfigure-#98-6a417012022f38534ae5a5803062639446c9fa81.patch b/SOURCES/sap-hana-preconfigure-#98-6a417012022f38534ae5a5803062639446c9fa81.patch new file mode 100644 index 0000000..3ca77b4 --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#98-6a417012022f38534ae5a5803062639446c9fa81.patch @@ -0,0 +1,41 @@ +commit 6a417012022f38534ae5a5803062639446c9fa81 +Author: Bernd Finger +Date: Thu Jul 16 19:26:58 2020 +0200 + + solve issue #98 (basic reboot requirement detection for RHEL 8.0) + +diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml +index 0a8e1c2..502e94f 100644 +--- a/tasks/RedHat/installation.yml ++++ b/tasks/RedHat/installation.yml +@@ -138,9 +138,19 @@ + when: + - ansible_os_family == 'RedHat' + - ansible_distribution_major_version == '8' ++ - ansible_distribution_version != '8.0' ++ ++- set_fact: ++ needs_restarting_command: "_IKRNL=$(rpm -q --last kernel | awk 'NR==1{sub(/kernel-/,\"\"); print $1}'); _CKRNL=$(uname -r); if [ ${_IKRNL} != ${_CKRNL} ]; then exit 1; else exit 0; fi" ++ when: ++ - ansible_os_family == 'RedHat' ++ - ansible_distribution_version == '8.0' ++ ++- debug: ++ var: needs_restarting_command + + - name: Check if system needs to be restarted +- command: "{{ needs_restarting_command }}" ++ shell: "{{ needs_restarting_command }}" + register: needs_restarting_result + ignore_errors: true + changed_when: false +@@ -148,6 +158,9 @@ + warn: false + check_mode: false + ++- debug: ++ var: needs_restarting_result ++ + - name: Call Reboot handler if necessary + command: /bin/true + notify: "Reboot handler" diff --git a/SOURCES/sap-hana-preconfigure-#99-d64615413b0bd7741bd6d8e06e5676be36a24c41.patch b/SOURCES/sap-hana-preconfigure-#99-d64615413b0bd7741bd6d8e06e5676be36a24c41.patch new file mode 100644 index 0000000..3cf41d5 --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-#99-d64615413b0bd7741bd6d8e06e5676be36a24c41.patch @@ -0,0 +1,37 @@ +commit d64615413b0bd7741bd6d8e06e5676be36a24c41 +Author: Bernd Finger +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 diff --git a/SOURCES/sap-hana-preconfigure-2.0.0.patch b/SOURCES/sap-hana-preconfigure-2.0.0.patch new file mode 100644 index 0000000..1949f5e --- /dev/null +++ b/SOURCES/sap-hana-preconfigure-2.0.0.patch @@ -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 + ################################################################## diff --git a/SOURCES/sap-hana-preconfigure-38a18c2890aa80c4562d002cc557945bdf9c5e7e.patch b/SOURCES/sap-hana-preconfigure-38a18c2890aa80c4562d002cc557945bdf9c5e7e.patch deleted file mode 100644 index 96b70c7..0000000 --- a/SOURCES/sap-hana-preconfigure-38a18c2890aa80c4562d002cc557945bdf9c5e7e.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit 38a18c2890aa80c4562d002cc557945bdf9c5e7e -Author: Bernd Finger -Date: Tue Oct 1 18:00:59 2019 +0200 - - added "LC_ALL=C " before commands for which the outputs are to be evaluated - -diff --git a/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml b/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml -index 3cef670..274c7ea 100644 ---- a/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml -+++ b/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml -@@ -7,7 +7,7 @@ - # in included tuned profile throughput-performance - - block: - - name: Check if system is able to set CPU Governor for performance -- command: bash -lc "cpupower frequency-info -g | awk '/available cpufreq governors/{print $(NF-1), $NF}'" -+ command: bash -lc "LC_ALL=C cpupower frequency-info -g | awk '/available cpufreq governors/{print $(NF-1), $NF}'" - check_mode: no - register: command_check_result - ignore_errors: true -diff --git a/tasks/RedHat/generic/configure-epb.yml b/tasks/RedHat/generic/configure-epb.yml -index adf5891..71d8b91 100644 ---- a/tasks/RedHat/generic/configure-epb.yml -+++ b/tasks/RedHat/generic/configure-epb.yml -@@ -7,7 +7,7 @@ - # in included tuned profile throughput-performance - - block: - - name: Check if system supports Intel's performance bias setting -- command: bash -lc "cpupower info | head -1 | awk '{print $2, $3, $4}'" -+ command: bash -lc "LC_ALL=C cpupower info | head -1 | awk '{print $2, $3, $4}'" - check_mode: no - register: command_check_result - ignore_errors: true diff --git a/SOURCES/sap-preconfig-b10e9f539263e1a2fd9222d6c52c55c7cb337130.patch b/SOURCES/sap-preconfig-b10e9f539263e1a2fd9222d6c52c55c7cb337130.patch deleted file mode 100644 index a8796aa..0000000 --- a/SOURCES/sap-preconfig-b10e9f539263e1a2fd9222d6c52c55c7cb337130.patch +++ /dev/null @@ -1,115 +0,0 @@ -commit b10e9f539263e1a2fd9222d6c52c55c7cb337130 -Author: Bernd Finger -Date: Wed Oct 2 22:54:14 2019 +0200 - - - convert variables to bool when comparing in when: statements - - always use ansible_hostname + ansible_domain instead of ansible_fqdn - -diff --git a/tasks/sapnote/2002167/03-setting-the-hostname.yml b/tasks/sapnote/2002167/03-setting-the-hostname.yml -index f4e57f8..21de429 100644 ---- a/tasks/sapnote/2002167/03-setting-the-hostname.yml -+++ b/tasks/sapnote/2002167/03-setting-the-hostname.yml -@@ -19,40 +19,40 @@ - failed_when: change_hostname.rc >= 2 - - - name: Check if ipv4 address, FQDN, and hostname are in /etc/hosts -- command: bash -lc "awk 'BEGIN{a=0}/{{ ansible_default_ipv4.address }}/&&/{{ ansible_fqdn }}/&&/{{ ansible_hostname }}/{a++}END{print a}' /etc/hosts" -+ command: bash -lc "awk 'BEGIN{a=0}/{{ ansible_default_ipv4.address }}/&&/{{ ansible_hostname }}.{{ ansible_domain }}/&&/{{ ansible_hostname }}/{a++}END{print a}' /etc/hosts" - register: command_result - changed_when: no - - debug: - var: command_result.stdout_lines, command_result.stderr_lines - when: -- - not sap_preconfigure_modify_etc_hosts -+ - not sap_preconfigure_modify_etc_hosts | bool - - - debug: - msg: - - "Expected:" -- - "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }}" -+ - "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}.{{ ansible_domain }} {{ ansible_hostname }}" - when: - - command_result.stdout != "1" -- - not sap_preconfigure_modify_etc_hosts -+ - not sap_preconfigure_modify_etc_hosts | bool - - - fail: - msg: - - "Server's ipv4 address, FQDN, or hostname are not in /etc/hosts!" - when: - - command_result.stdout != "1" -- - not sap_preconfigure_modify_etc_hosts -+ - not sap_preconfigure_modify_etc_hosts | bool - - - name: Make sure server's IP address is in /etc/hosts - lineinfile: - path: /etc/hosts - regexp: '^{{ ansible_default_ipv4.address }}' - insertbefore: '^127.0.0.1' --# line: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }} " -- line: "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}.{{ ansible_domain }} {{ ansible_hostname }} " -+# line: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }}" -+ line: "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}.{{ ansible_domain }} {{ ansible_hostname }}" - state: present - when: -- - sap_preconfigure_modify_etc_hosts -+ - sap_preconfigure_modify_etc_hosts | bool - - debug: -- msg: "System {{ ansible_hostname }}, {{ ansible_fqdn }} has ipv4 address {{ ansible_default_ipv4.address }}" -+ msg: "System {{ ansible_hostname }}, {{ ansible_hostname }}.{{ ansible_domain }} has ipv4 address {{ ansible_default_ipv4.address }}" - - ... -diff --git a/tasks/sapnote/2772999/03-configure-hostname.yml b/tasks/sapnote/2772999/03-configure-hostname.yml -index f89ca68..3de61a5 100644 ---- a/tasks/sapnote/2772999/03-configure-hostname.yml -+++ b/tasks/sapnote/2772999/03-configure-hostname.yml -@@ -19,40 +19,40 @@ - failed_when: change_hostname.rc >= 2 - - - name: Check if ipv4 address, FQDN, and hostname are in /etc/hosts -- command: bash -lc "awk 'BEGIN{a=0}/{{ ansible_default_ipv4.address }}/&&/{{ ansible_fqdn }}/&&/{{ ansible_hostname }}/{a++}END{print a}' /etc/hosts" -+ command: bash -lc "awk 'BEGIN{a=0}/{{ ansible_default_ipv4.address }}/&&/{{ ansible_hostname }}.{{ ansible_domain }}/&&/{{ ansible_hostname }}/{a++}END{print a}' /etc/hosts" - register: command_result - changed_when: no - - debug: - var: command_result.stdout_lines, command_result.stderr_lines - when: -- - not sap_preconfigure_modify_etc_hosts -+ - not sap_preconfigure_modify_etc_hosts | bool - - - debug: - msg: - - "Expected:" -- - "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }}" -+ - "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}.{{ ansible_domain }} {{ ansible_hostname }}" - when: - - command_result.stdout != "1" -- - not sap_preconfigure_modify_etc_hosts -+ - not sap_preconfigure_modify_etc_hosts | bool - - - fail: - msg: - - "Server's ipv4 address, FQDN, or hostname are not in /etc/hosts!" - when: - - command_result.stdout != "1" -- - not sap_preconfigure_modify_etc_hosts -+ - not sap_preconfigure_modify_etc_hosts | bool - - - name: Make sure server's IP address is in /etc/hosts - lineinfile: - path: /etc/hosts - regexp: '^{{ ansible_default_ipv4.address }}' - insertbefore: '^127.0.0.1' --# line: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }} " -- line: "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}.{{ ansible_domain }} {{ ansible_hostname }} " -+# line: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }}" -+ line: "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}.{{ ansible_domain }} {{ ansible_hostname }}" - state: present - when: -- - sap_preconfigure_modify_etc_hosts -+ - sap_preconfigure_modify_etc_hosts | bool - - debug: -- msg: "System {{ ansible_hostname }}, {{ ansible_fqdn }} has ipv4 address {{ ansible_default_ipv4.address }}" -+ msg: "System {{ ansible_hostname }}, {{ ansible_hostname }}.{{ ansible_domain }} has ipv4 address {{ ansible_default_ipv4.address }}" - - ... diff --git a/SOURCES/sap-preconfig-baa3b58a0d2a60bb0e222b3dac5190c8ea171cf3.patch b/SOURCES/sap-preconfig-baa3b58a0d2a60bb0e222b3dac5190c8ea171cf3.patch deleted file mode 100644 index 0770eac..0000000 --- a/SOURCES/sap-preconfig-baa3b58a0d2a60bb0e222b3dac5190c8ea171cf3.patch +++ /dev/null @@ -1,34 +0,0 @@ -commit baa3b58a0d2a60bb0e222b3dac5190c8ea171cf3 -Author: Bernd Finger -Date: Tue Oct 1 18:40:03 2019 +0200 - - use {{ ansible_hostname }}.{{ ansible_domain }} instead of {{ ansible_fqdn }} - -diff --git a/tasks/sapnote/2002167/03-setting-the-hostname.yml b/tasks/sapnote/2002167/03-setting-the-hostname.yml -index e95fb74..f4e57f8 100644 ---- a/tasks/sapnote/2002167/03-setting-the-hostname.yml -+++ b/tasks/sapnote/2002167/03-setting-the-hostname.yml -@@ -47,7 +47,8 @@ - path: /etc/hosts - regexp: '^{{ ansible_default_ipv4.address }}' - insertbefore: '^127.0.0.1' -- line: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }} " -+# line: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }} " -+ line: "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}.{{ ansible_domain }} {{ ansible_hostname }} " - state: present - when: - - sap_preconfigure_modify_etc_hosts -diff --git a/tasks/sapnote/2772999/03-configure-hostname.yml b/tasks/sapnote/2772999/03-configure-hostname.yml -index 258c9f5..f89ca68 100644 ---- a/tasks/sapnote/2772999/03-configure-hostname.yml -+++ b/tasks/sapnote/2772999/03-configure-hostname.yml -@@ -47,7 +47,8 @@ - path: /etc/hosts - regexp: '^{{ ansible_default_ipv4.address }}' - insertbefore: '^127.0.0.1' -- line: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }} " -+# line: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }} " -+ line: "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}.{{ ansible_domain }} {{ ansible_hostname }} " - state: present - when: - - sap_preconfigure_modify_etc_hosts diff --git a/SOURCES/sap-preconfigure-#78-db645e39a38070ac0b3fe9f2f447d60e6eedac4a.patch b/SOURCES/sap-preconfigure-#78-db645e39a38070ac0b3fe9f2f447d60e6eedac4a.patch new file mode 100644 index 0000000..8877164 --- /dev/null +++ b/SOURCES/sap-preconfigure-#78-db645e39a38070ac0b3fe9f2f447d60e6eedac4a.patch @@ -0,0 +1,125 @@ +commit db645e39a38070ac0b3fe9f2f447d60e6eedac4a +Author: Bernd Finger +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 diff --git a/SOURCES/sap-preconfigure-#79-b056297b1e54662773d9b63850fdae34d2606fa1.patch b/SOURCES/sap-preconfigure-#79-b056297b1e54662773d9b63850fdae34d2606fa1.patch new file mode 100644 index 0000000..78c234b --- /dev/null +++ b/SOURCES/sap-preconfigure-#79-b056297b1e54662773d9b63850fdae34d2606fa1.patch @@ -0,0 +1,82 @@ +commit b056297b1e54662773d9b63850fdae34d2606fa1 +Author: Bernd Finger +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 ) }}" ++ + ... diff --git a/SOURCES/sap-preconfigure-#81-6be65f40569044307bbf41038b766ff571a08025.patch b/SOURCES/sap-preconfigure-#81-6be65f40569044307bbf41038b766ff571a08025.patch new file mode 100644 index 0000000..f1ec990 --- /dev/null +++ b/SOURCES/sap-preconfigure-#81-6be65f40569044307bbf41038b766ff571a08025.patch @@ -0,0 +1,41 @@ +commit 6be65f40569044307bbf41038b766ff571a08025 +Author: Bernd Finger +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" diff --git a/SOURCES/sap-preconfigure-#82-70cd0f9f8b0f7de3e48c1af041a0d63443445052.patch b/SOURCES/sap-preconfigure-#82-70cd0f9f8b0f7de3e48c1af041a0d63443445052.patch new file mode 100644 index 0000000..52caa1b --- /dev/null +++ b/SOURCES/sap-preconfigure-#82-70cd0f9f8b0f7de3e48c1af041a0d63443445052.patch @@ -0,0 +1,34 @@ +commit 70cd0f9f8b0f7de3e48c1af041a0d63443445052 +Author: Bernd Finger +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 diff --git a/SOURCES/sap-preconfigure-#84-77e02082ae0784f88eab8f9d0f764c3981b9cf6d.patch b/SOURCES/sap-preconfigure-#84-77e02082ae0784f88eab8f9d0f764c3981b9cf6d.patch new file mode 100644 index 0000000..6ed839f --- /dev/null +++ b/SOURCES/sap-preconfigure-#84-77e02082ae0784f88eab8f9d0f764c3981b9cf6d.patch @@ -0,0 +1,42 @@ +commit 77e02082ae0784f88eab8f9d0f764c3981b9cf6d +Author: Bernd Finger +Date: Wed Jul 15 12:19:16 2020 +0200 + + solve issue #84: Do not fail if there is more than one line with identical IP adresses + +diff --git a/tasks/RedHat/generic/configure-etc-hosts.yml b/tasks/RedHat/generic/configure-etc-hosts.yml +index 35ffd8b..304bb36 100644 +--- a/tasks/RedHat/generic/configure-etc-hosts.yml ++++ b/tasks/RedHat/generic/configure-etc-hosts.yml +@@ -18,7 +18,6 @@ + }' /etc/hosts + register: sap_base_settings_register_hostname_aliases + changed_when: false +- check_mode: false + + - name: Print hostname aliases + debug: +@@ -30,7 +29,6 @@ + command: bash -lc "awk 'BEGIN{a=0}/{{ sap_ip }}/&&/{{ sap_hostname }}.{{ sap_domain }}/&&/{{ sap_hostname }}/{a++}END{print a}' /etc/hosts" + register: command_result + changed_when: false +- check_mode: false + - debug: + var: command_result.stdout_lines, command_result.stderr_lines + - debug: +@@ -64,6 +62,7 @@ + when: + - sap_preconfigure_modify_etc_hosts | bool + ++# We will allow more than one line containing sap_ip: + - name: Check for duplicate entries of {{ sap_ip }} in /etc/hosts + shell: | + n=$(grep "^{{ sap_ip }}\s" /etc/hosts | wc -l) +@@ -74,6 +73,7 @@ + exit 1 + fi + changed_when: false ++ ignore_errors: yes + when: not ansible_check_mode + + - name: Check for duplicate entries of hostname and fqdn in /etc/hosts diff --git a/SOURCES/sap-preconfigure-#85-#86-840cafb7487687369d3597e6f9e21895da702094.patch b/SOURCES/sap-preconfigure-#85-#86-840cafb7487687369d3597e6f9e21895da702094.patch new file mode 100644 index 0000000..e75271a --- /dev/null +++ b/SOURCES/sap-preconfigure-#85-#86-840cafb7487687369d3597e6f9e21895da702094.patch @@ -0,0 +1,43 @@ +commit 840cafb7487687369d3597e6f9e21895da702094 +Author: Bernd Finger +Date: Wed Jul 15 14:21:27 2020 +0200 + + solve issues #85, #86 + +diff --git a/tasks/RedHat/generic/configure-etc-hosts.yml b/tasks/RedHat/generic/configure-etc-hosts.yml +index 304bb36..18872d1 100644 +--- a/tasks/RedHat/generic/configure-etc-hosts.yml ++++ b/tasks/RedHat/generic/configure-etc-hosts.yml +@@ -16,7 +16,7 @@ + if (( $i != "{{ sap_hostname }}" ) && ( $i != "{{ sap_hostname }}.{{ sap_domain }}" )) { printf $i" " } + } + }' /etc/hosts +- register: sap_base_settings_register_hostname_aliases ++ register: sap_hostname_aliases + changed_when: false + + - name: Print hostname aliases +@@ -54,12 +54,22 @@ + msg: + - "System {{ sap_hostname }}, {{ sap_hostname }}.{{ sap_domain }} has ipv4 address {{ sap_ip }}." + ++- debug: ++ msg: ++ - "Hostname alias(es) found: {{ sap_hostname_aliases.stdout }}. So /etc/hosts will not be modified." ++ when: ++ - sap_hostname_aliases.stdout != '' ++ - sap_preconfigure_modify_etc_hosts | bool ++ ++# We only modify /etc/hosts if there is no hostname alias defined: + - name: Ensure that the entry in /etc/hosts is correct + lineinfile: + path: /etc/hosts + regexp: '^{{ sap_ip }}\s' +- line: "{{ sap_ip }} {{ sap_hostname }}.{{ sap_domain }} {{ sap_hostname }} {{ sap_base_settings_register_hostname_aliases.stdout }}" ++ line: "{{ sap_ip }} {{ sap_hostname }}.{{ sap_domain }} {{ sap_hostname }}" ++ backup: yes + when: ++ - sap_hostname_aliases.stdout == '' + - sap_preconfigure_modify_etc_hosts | bool + + # We will allow more than one line containing sap_ip: diff --git a/SOURCES/sap-preconfigure-#85-110d870eaac2efee2e131babacebc5337a15b3e3.patch b/SOURCES/sap-preconfigure-#85-110d870eaac2efee2e131babacebc5337a15b3e3.patch new file mode 100644 index 0000000..f2531e6 --- /dev/null +++ b/SOURCES/sap-preconfigure-#85-110d870eaac2efee2e131babacebc5337a15b3e3.patch @@ -0,0 +1,110 @@ +commit 110d870eaac2efee2e131babacebc5337a15b3e3 +Author: Bernd Finger +Date: Thu Jul 16 11:56:22 2020 +0200 + + do not modify /etc/hosts if there is more than one line containing sap_ip + +diff --git a/tasks/RedHat/generic/check-dns-name-resolution.yml b/tasks/RedHat/generic/check-dns-name-resolution.yml +index 9450b60..b7b915d 100644 +--- a/tasks/RedHat/generic/check-dns-name-resolution.yml ++++ b/tasks/RedHat/generic/check-dns-name-resolution.yml +@@ -9,11 +9,12 @@ + - "sap_domain = {{ sap_domain }}" + - "sap_ip = {{ sap_ip }}" + +-- name: Verify that the DNS domain is set +- assert: +- that: +- not( (sap_domain is undefined) or (sap_domain is none) or (sap_domain | trim == '') ) +- msg: "You need to define the variable 'sap_domain' in defaults/main.yml." ++# moved to configure-etc-hosts.yml: ++#- name: Verify that the DNS domain is set ++# assert: ++# that: ++# not( (sap_domain is undefined) or (sap_domain is none) or (sap_domain | trim == '') ) ++# msg: "You need to define the variable 'sap_domain' in defaults/main.yml." + + ### DNS is not that necessary and as such the errors are ignored + ### for production it is strongly recommended to have proper DNS setup +diff --git a/tasks/RedHat/generic/configure-etc-hosts.yml b/tasks/RedHat/generic/configure-etc-hosts.yml +index 18872d1..488fba7 100644 +--- a/tasks/RedHat/generic/configure-etc-hosts.yml ++++ b/tasks/RedHat/generic/configure-etc-hosts.yml +@@ -13,7 +13,7 @@ + shell: | + awk '( $1 == "{{ sap_ip }}" ) { + for (i=2; i<=NF; ++i) { +- if (( $i != "{{ sap_hostname }}" ) && ( $i != "{{ sap_hostname }}.{{ sap_domain }}" )) { printf $i" " } ++ if (( $i != "{{ sap_hostname }}" ) && ( $i != "{{ sap_hostname }}.{{ sap_domain }}" )) { printf " "$i } + } + }' /etc/hosts + register: sap_hostname_aliases +@@ -54,39 +54,48 @@ + msg: + - "System {{ sap_hostname }}, {{ sap_hostname }}.{{ sap_domain }} has ipv4 address {{ sap_ip }}." + ++# We allow more than one line containing sap_ip: ++- name: Check for duplicate entries of {{ sap_ip }} in /etc/hosts ++ shell: | ++ n=$(grep "^{{ sap_ip }}\s" /etc/hosts | wc -l) ++ if [ $n -gt 1 ]; then ++ echo "Duplicate IP entry in /etc/hosts!" ++ exit 1 ++ else ++ exit 0 ++ fi ++ register: shell_result ++ changed_when: false ++ ignore_errors: yes ++ when: not ansible_check_mode ++ ++- name: Verify that variable sap_domain is set ++ assert: ++ that: ++ not( (sap_domain is undefined) or (sap_domain is none) or (sap_domain | trim == '') ) ++ msg: "Variable 'sap_domain' is undefined or empty. Please define it in defaults/main.yml or via --extra-vars!" ++ + - debug: + msg: +- - "Hostname alias(es) found: {{ sap_hostname_aliases.stdout }}. So /etc/hosts will not be modified." ++ - "More than one line containing {{ sap_ip }}. File /etc/hosts will not be modified." + when: +- - sap_hostname_aliases.stdout != '' ++ - not ansible_check_mode ++ - shell_result.stdout == 'Duplicate IP entry in /etc/hosts!' + - sap_preconfigure_modify_etc_hosts | bool + +-# We only modify /etc/hosts if there is no hostname alias defined: + - name: Ensure that the entry in /etc/hosts is correct + lineinfile: + path: /etc/hosts + regexp: '^{{ sap_ip }}\s' +- line: "{{ sap_ip }} {{ sap_hostname }}.{{ sap_domain }} {{ sap_hostname }}" ++ line: "{{ sap_ip }} {{ sap_hostname }}.{{ sap_domain }} {{ sap_hostname }}{{sap_hostname_aliases.stdout }}" + backup: yes + when: +- - sap_hostname_aliases.stdout == '' ++ - not ansible_check_mode ++ - sap_domain != '' ++ - shell_result.stdout != 'Duplicate IP entry in /etc/hosts!' + - sap_preconfigure_modify_etc_hosts | bool + +-# We will allow more than one line containing sap_ip: +-- name: Check for duplicate entries of {{ sap_ip }} in /etc/hosts +- shell: | +- n=$(grep "^{{ sap_ip }}\s" /etc/hosts | wc -l) +- if [ $n -eq 1 ]; then +- exit 0 +- else +- echo "Duplicate IP entry in /etc/hosts!" +- exit 1 +- fi +- changed_when: false +- ignore_errors: yes +- when: not ansible_check_mode +- +-- name: Check for duplicate entries of hostname and fqdn in /etc/hosts ++- name: Check for duplicate or missing entries of hostname and fqdn in /etc/hosts + shell: | + n=$(grep -w "{{ line_item }}" /etc/hosts | wc -l) + if [ $n -eq 1 ]; then diff --git a/SOURCES/sap-preconfigure-#88-7595b96fbd6a7360d62413734bc652ed4c5e2771.patch b/SOURCES/sap-preconfigure-#88-7595b96fbd6a7360d62413734bc652ed4c5e2771.patch new file mode 100644 index 0000000..0e4a7d1 --- /dev/null +++ b/SOURCES/sap-preconfigure-#88-7595b96fbd6a7360d62413734bc652ed4c5e2771.patch @@ -0,0 +1,41 @@ +commit 7595b96fbd6a7360d62413734bc652ed4c5e2771 +Author: Bernd Finger +Date: Thu Jul 16 19:18:43 2020 +0200 + + solve issue #88 (reboot requirement detection for RHEL 8.0) + +diff --git a/tasks/installation.yml b/tasks/installation.yml +index 40076e5..11d80ed 100644 +--- a/tasks/installation.yml ++++ b/tasks/installation.yml +@@ -72,9 +72,19 @@ + when: + - ansible_os_family == 'RedHat' + - ansible_distribution_major_version == '8' ++ - ansible_distribution_version != '8.0' ++ ++- set_fact: ++ needs_restarting_command: "_IKRNL=$(rpm -q --last kernel | awk 'NR==1{sub(/kernel-/,\"\"); print $1}'); _CKRNL=$(uname -r); if [ ${_IKRNL} != ${_CKRNL} ]; then exit 1; else exit 0; fi" ++ when: ++ - ansible_os_family == 'RedHat' ++ - ansible_distribution_version == '8.0' ++ ++- debug: ++ var: needs_restarting_command + + - name: Check if system needs to be restarted +- command: "{{ needs_restarting_command }}" ++ shell: "{{ needs_restarting_command }}" + register: needs_restarting_result + ignore_errors: true + changed_when: false +@@ -82,6 +92,9 @@ + warn: false + check_mode: false + ++- debug: ++ var: needs_restarting_result ++ + - name: Call Reboot handler if necessary + command: /bin/true + notify: "Reboot handler" diff --git a/SOURCES/sap-preconfigure-#89-3f3c93eaddfafd08132017058b0b330108d2bd2c.patch b/SOURCES/sap-preconfigure-#89-3f3c93eaddfafd08132017058b0b330108d2bd2c.patch new file mode 100644 index 0000000..9355493 --- /dev/null +++ b/SOURCES/sap-preconfigure-#89-3f3c93eaddfafd08132017058b0b330108d2bd2c.patch @@ -0,0 +1,53 @@ +commit 3f3c93eaddfafd08132017058b0b330108d2bd2c +Author: Bernd Finger +Date: Tue Jul 28 15:26:57 2020 +0200 + + 89 - Minimum kernel versions from SAP note 2812427 need to be moved to sap-preconfigure + +diff --git a/vars/RedHat_7.yml b/vars/RedHat_7.yml +index 8209443..1e5c661 100644 +--- a/vars/RedHat_7.yml ++++ b/vars/RedHat_7.yml +@@ -36,4 +36,28 @@ __sap_preconfigure_packages: + - compat-sap-c++-7 + - compat-sap-c++-9 + ++__sap_preconfigure_min_packages_7_2: ++ ++__sap_preconfigure_min_packages_7_3: ++ ++# SAP note 2812427: ++__sap_preconfigure_min_packages_7_4: ++ - [ 'kernel' , '3.10.0-693.58.1.el7' ] ++ ++# SAP note 2812427: ++__sap_preconfigure_min_packages_7_5: ++ - [ 'kernel' , '3.10.0-862.43.1.el7' ] ++ ++# SAP note 2812427: ++__sap_preconfigure_min_packages_7_6: ++ - [ 'kernel' , '3.10.0-957.35.1.el7' ] ++ ++__sap_preconfigure_min_packages_7_7: ++ ++__sap_preconfigure_min_packages_7_8: ++ ++__sap_preconfigure_min_packages_7_9: ++ ++__sap_preconfigure_min_pkgs: "{{ lookup('vars','__sap_preconfigure_min_packages_' + ansible_distribution_version|string|replace (\".\", \"_\")) }}" ++ + ... +diff --git a/vars/RedHat_8.0.yml b/vars/RedHat_8.0.yml +index f95a098..356d398 100644 +--- a/vars/RedHat_8.0.yml ++++ b/vars/RedHat_8.0.yml +@@ -24,7 +24,9 @@ __sap_preconfigure_packages: + - nfs-utils + - bind-utils + ++# SAP notes 2772999 (setup) and 2812427 (kernel): + __sap_preconfigure_min_pkgs: + - [ 'setup' , '2.12.2-2.el8_0.1' ] ++ - [ 'kernel' , '4.18.0-80.15.1.el8_0' ] + + ... diff --git a/SOURCES/sap-preconfigure-#92-db1ed07c66286edbee756ed3504649975d333306.patch b/SOURCES/sap-preconfigure-#92-db1ed07c66286edbee756ed3504649975d333306.patch new file mode 100644 index 0000000..d38d714 --- /dev/null +++ b/SOURCES/sap-preconfigure-#92-db1ed07c66286edbee756ed3504649975d333306.patch @@ -0,0 +1,41 @@ +commit db1ed07c66286edbee756ed3504649975d333306 +Author: Bernd Finger +Date: Wed Aug 19 10:30:21 2020 +0200 + + issue #92: changed nofile from 32800 to 65536 as per recent changes to SAP note 2002167 + +diff --git a/tasks/sapnote/2002167/05-process-resource-limits.yml b/tasks/sapnote/2002167/05-process-resource-limits.yml +index a116cbf..324dd9b 100644 +--- a/tasks/sapnote/2002167/05-process-resource-limits.yml ++++ b/tasks/sapnote/2002167/05-process-resource-limits.yml +@@ -5,26 +5,26 @@ + - debug: + msg: "SAP note 2002167 Step 5: Process Resource Limits" + +-- name: Set the hard and soft limit for the max number of open files per process (nofile) to 32800 for group sapsys ++- name: Set the hard and soft limit for the max number of open files per process (nofile) to 65536 for group sapsys + pam_limits: + dest: /etc/security/limits.d/99-sap.conf + domain: "@sapsys" + limit_item: nofile + limit_type: "{{ line_item }}" +- value: "32800" ++ value: "65536" + with_items: + - hard + - soft + loop_control: + loop_var: line_item + +-- name: Set the hard and soft limit for the max number of open files per process (nofile) to 32800 for the database group ++- 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 }}" + limit_item: nofile + limit_type: "{{ line_item }}" +- value: "32800" ++ value: "65536" + with_items: + - hard + - soft diff --git a/SPECS/rhel-system-roles-sap.spec b/SPECS/rhel-system-roles-sap.spec index aae1b1a..cc924e4 100644 --- a/SPECS/rhel-system-roles-sap.spec +++ b/SPECS/rhel-system-roles-sap.spec @@ -1,26 +1,50 @@ -# avoiding version conflict, set version 1.1.1 for rhel8 -%define upstream_vesion 2019-09-30_18-11-12 +# avoiding version conflict, set version 2.0.0 for rhel8 +%define upstream_vesion 2020-06-08 Name: rhel-system-roles-sap -Summary: System Role prepares a RHEL system for running SAP software for SAP HANA -Version: 1.1.1 -Release: 1%{?dist} +Summary: System Roles to configure RHEL for running SAP NetWeaver- or SAP HANA-based products +Version: 2.0.0 +Release: 7%{?dist} License: GPLv3+ Url: https://github.com/berndfinger -Source0: https://than.fedorapeople.org/rhel/%{name}-%{upstream_vesion}.tar.gz +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 +# fixes for sap-hana-preconfigure +Patch0: sap-hana-preconfigure-2.0.0.patch +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-hana-preconfigure-#104-#105-6d65f9b667a8a7dec17caa70c5df929b921691a6.patch +Patch7: sap-hana-preconfigure-#98-6a417012022f38534ae5a5803062639446c9fa81.patch +Patch8: sap-hana-preconfigure-#107-6f8d7c964e2c95b37c68299e6077bc3f987faffb.patch +Patch9: sap-hana-preconfigure-#109-#110-89202367321b47c3fb5d52e50f5ea220c548fab5.patch +Patch10: sap-hana-preconfigure-#111-part1-03affb58325bf1c370ea3e0d76e291eb9485acf1.patch +Patch11: sap-hana-preconfigure-#111-part2-6edb1339a1a79c9e47f8023534e0a3db429dbf20.patch +Patch12: sap-hana-preconfigure-#112-part1-d26152ada59c5e2919be3f7cf89927ac7bfd510d.patch +Patch13: sap-hana-preconfigure-#112-part2-d26152ada59c5e2919be3f7cf89927ac7bfd510d.patch +Patch14: sap-hana-preconfigure-#113-1442c5470eae0769a6ceee201621aab0518bb6f3.patch +Patch15: sap-hana-preconfigure-#114-f011979fa05e938165c95a134bbdcc37a33f4eea.patch +Patch16: sap-hana-preconfigure-#116-752f988bf105a325db12965d240bbe1462b72c78.patch +Patch17: sap-hana-preconfigure-#119-75a1940d0230c0fb2957426952c5308e08919c06.patch -# set sap_hana_preconfigure_min_packages_7.8 for rhel-7.8 -Patch0: rhel-system-roles-sap-0.7.2-rhel-7.8.patch - -# use {{ ansible_hostname }}.{{ ansible_domain }} instead of {{ ansible_fqdn }} -Patch1: sap-preconfig-baa3b58a0d2a60bb0e222b3dac5190c8ea171cf3.patch - -# convert variables to bool when comparing in when: statements -# always use ansible_hostname + ansible_domain instead of ansible_fqdn -Patch2: sap-preconfig-b10e9f539263e1a2fd9222d6c52c55c7cb337130.patch - -# set LC_ALL=C -Patch3: sap-hana-preconfigure-38a18c2890aa80c4562d002cc557945bdf9c5e7e.patch +# fixes for sap-preconfigure +Patch100: sap-preconfigure-#78-db645e39a38070ac0b3fe9f2f447d60e6eedac4a.patch +Patch101: sap-preconfigure-#79-b056297b1e54662773d9b63850fdae34d2606fa1.patch +Patch102: sap-preconfigure-#81-6be65f40569044307bbf41038b766ff571a08025.patch +Patch103: sap-preconfigure-#82-70cd0f9f8b0f7de3e48c1af041a0d63443445052.patch +Patch104: sap-preconfigure-#84-77e02082ae0784f88eab8f9d0f764c3981b9cf6d.patch +Patch105: sap-preconfigure-#85-#86-840cafb7487687369d3597e6f9e21895da702094.patch +Patch106: sap-preconfigure-#85-110d870eaac2efee2e131babacebc5337a15b3e3.patch +Patch107: sap-preconfigure-#88-7595b96fbd6a7360d62413734bc652ed4c5e2771.patch +Patch108: sap-preconfigure-#89-3f3c93eaddfafd08132017058b0b330108d2bd2c.patch +Patch109: sap-preconfigure-#92-db1ed07c66286edbee756ed3504649975d333306.patch BuildArch: noarch Requires: uuidd @@ -30,15 +54,56 @@ Collection of Ansible roles which configures a RHEL system according to applicable SAP notes so that any SAP software can be installed. %prep -%setup -q -T -c -n %{name}-%{version} -a 0 +%setup -q -T -c -n %{name}-%{version} -a 0 -a 1 -a 2 +pushd sap-hana-preconfigure %patch0 -p1 -pushd sap-preconfigure %patch1 -p1 %patch2 -p1 -popd -pushd sap-hana-preconfigure %patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 popd +pushd sap-preconfigure +%patch100 -p1 +%patch101 -p1 +%patch102 -p1 +%patch103 -p1 +%patch104 -p1 +%patch105 -p1 +%patch106 -p1 +%patch107 -p1 +%patch108 -p1 +%patch109 -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 %build @@ -68,6 +133,30 @@ cp -p sap-netweaver-preconfigure/{README.md,LICENSE} $RPM_BUILD_ROOT%{_pkgdocdir %{_datadir}/ansible/roles/* %changelog +* Mon Sep 21 2020 Than Ngo - 2.0.0-7 +- Related: #1867027, fix #119 + +* Thu Aug 20 2020 Than Ngo - 2.0.0-6 +- Related: #1867027, fix #92 + +* Fri Aug 07 2020 Than Ngo - 2.0.0-5 +- Resolves: #1867027, more fixes for #89, #109, #110, #111, #112, #113, #114, #116 + +* Tue Jul 21 2020 Than Ngo - 2.0.0-4 +- Related: #1844190, more fixes for #84, #85, #86, #88, #98, #104, #105, #107 + +* Fri Jul 03 2020 Than Ngo - 2.0.0-3 +- Related: #1844190, drop 1944799.yml + +* Mon Jun 29 2020 Than Ngo - 2.0.0-2 +- Related: #1844190, more fixes for #78, #79, #81, #82, #94-#97, #99, #101-#102 + +* Mon Jun 08 2020 Than Ngo - 2.0.0-1 +- Resolves: #1844190, rebase to 2.0.0 + +* Thu May 07 2020 Than Ngo - 1.1.1-2 +- Resolves: #1829495, fix summary + * Mon Oct 21 2019 Than Ngo - 1.1.1-1 - rebase to 1.1.1 - always use ansible_hostname + ansible_domain instead of ansible_fqdn