From f84c79761c1757b1e87fde33229cf67641878700 Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Wed, 27 Nov 2024 10:01:41 +0100 Subject: [PATCH 01/13] sap_ha_pacemaker_cluster: Fix haproxy config --- .../platform/preconfigure_cloud_gcp_ce_vm.yml | 26 ++++++++---- .../preconfigure_cloud_ibmcloud_vs.yml | 40 ++++++++++--------- 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml index d04162b0..e961fdca 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml @@ -33,14 +33,26 @@ insertafter: '^[Unit]$' notify: "systemd daemon-reload" - - name: "SAP HA Install Pacemaker - GCP CE VM - Update haproxy service template environment" - ansible.builtin.lineinfile: - backup: true + - name: "SAP HA Install Pacemaker - GCP CE VM - Update haproxy service template" + ansible.builtin.replace: + backup: false path: /etc/systemd/system/haproxy@.service - regexp: '^Environment=' - line: 'Environment="CONFIG=/etc/haproxy/haproxy-%i.cfg" "PIDFILE=/run/haproxy-%i.pid"' - state: present - insertafter: '^[Service]$' + regexp: '{{ replace_item.orig }}' + replace: '{{ replace_item.new | d() }}' + loop: + - orig: '^(.+)haproxy.cfg(.*)$' + new: '\1haproxy-%i.cfg\2' + label: 'Replace haproxy.cfg with haproxy-%i.cfg' + - orig: '^(.+)haproxy.pid(.*)$' + new: '\1haproxy-%i.pid\2' + label: 'Replace haproxy.pid with haproxy-%i.pid' + - orig: '\"CFGDIR=(\/\w*)*\.d\"' + label: 'Delete definition of CFGDIR' + - orig: '\ -f \$CFGDIR' + label: 'Remove "-f $CFGDIR"' + loop_control: + loop_var: replace_item + label: "{{ replace_item.label }}" notify: "systemd daemon-reload" - name: "SAP HA Install Pacemaker - GCP CE VM - Define healthcheck details for HANA" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml index f8675baa..55e467aa 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml @@ -55,24 +55,26 @@ insertafter: '^[Unit]$' notify: "systemd daemon-reload" -- name: "SAP HA Install Pacemaker - IBM Cloud VS - Update haproxy service template environment" - ansible.builtin.lineinfile: - backup: true - path: /etc/systemd/system/haproxy@.service - regexp: '^Environment=' - line: 'Environment="CONFIG=/etc/haproxy/haproxy-%i.cfg" "PIDFILE=/run/haproxy-%i.pid"' - state: present - insertafter: '^[Service]$' - notify: "systemd daemon-reload" - -- name: "SAP HA Install Pacemaker - IBM Cloud VS - Update haproxy service template environment" - ansible.builtin.lineinfile: - backup: true +- name: "SAP HA Install Pacemaker - IBM Cloud VS - Update haproxy service template" + ansible.builtin.replace: + backup: false path: /etc/systemd/system/haproxy@.service - regexp: '^Environment=' - line: 'Environment="CONFIG=/etc/haproxy/haproxy-%i.cfg" "PIDFILE=/run/haproxy-%i.pid"' - state: present - insertafter: '^[Service]$' + regexp: '{{ replace_item.orig }}' + replace: '{{ replace_item.new | d() }}' + loop: + - orig: '^(.+)haproxy.cfg(.*)$' + new: '\1haproxy-%i.cfg\2' + label: 'Replace haproxy.cfg with haproxy-%i.cfg' + - orig: '^(.+)haproxy.pid(.*)$' + new: '\1haproxy-%i.pid\2' + label: 'Replace haproxy.pid with haproxy-%i.pid' + - orig: '\"CFGDIR=(\/\w*)*\.d\"' + label: 'Delete definition of CFGDIR' + - orig: '\ -f \$CFGDIR' + label: 'Remove "-f $CFGDIR"' + loop_control: + loop_var: replace_item + label: "{{ replace_item.label }}" notify: "systemd daemon-reload" - name: "SAP HA Install Pacemaker - IBM Cloud VS - Define healthcheck details for HANA" @@ -100,7 +102,7 @@ when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 -- name: "SAP HA Install Pacemaker - GCP CE VM - Create haproxy config for HANA instances" +- name: "SAP HA Install Pacemaker - IBM Cloud VS - Create haproxy config for HANA instances" ansible.builtin.blockinfile: backup: false create: true @@ -141,7 +143,7 @@ - sap_ha_pacemaker_cluster_host_type | select('search', 'hana_scaleup') | length > 0 - haproxy_item.port | length > 4 -- name: "SAP HA Install Pacemaker - GCP CE VM - Create haproxy config for NWAS ASCS/ERS instances" +- name: "SAP HA Install Pacemaker - IBM Cloud VS - Create haproxy config for NWAS ASCS/ERS instances" ansible.builtin.blockinfile: create: true path: "/etc/haproxy/haproxy-{{ haproxy_item.name }}.cfg" From 08aee4e8412af0198393c02249f7375a5fcf048f Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Wed, 27 Nov 2024 10:15:03 +0100 Subject: [PATCH 02/13] sap_ha_pacemaker_cluster: Fix ansible-lint complaints --- roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml | 2 +- .../tasks/construct_vars_nwas_common.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml index de8e8b85..4e1640b6 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml @@ -4,7 +4,7 @@ # See IBM Db2 documentation 'HADR and network address translation (NAT) support' - https://www.ibm.com/docs/en/db2/11.5?topic=support-hadr-nat # These are the HADR Ports used for internode communication, and are unrelated to Health Check probe port from a Load Balancer - name: SAP HA AnyDB - IBM Db2 HADR - Append IBM Db2 HA Ports to /etc/services - ansible.builtin.lineinfile: + ansible.builtin.lineinfile: # noqa no-tabs path: /etc/services line: "{{ item }}" state: present diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml index a417108a..5d1c0317 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml @@ -81,7 +81,7 @@ {% set idname = __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name %} {% elif '/usr/sap/trans' in __mountpoint -%} {% set idname = __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name %} - {% elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid ) + '/SYS' in __mountpoint -%} + {% elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid) + '/SYS' in __mountpoint -%} {% set idname = __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name %} {% endif %} {{ idname }} @@ -162,7 +162,7 @@ {{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name }} - {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid ) + '/SYS' in __mountpoint -%} + {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid) + '/SYS' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name }} {%- endif %} resource_id: |- @@ -170,7 +170,7 @@ {{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name }} - {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid ) + '/SYS' in __mountpoint -%} + {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid) + '/SYS' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name }} {%- endif %} meta_attrs: From dfd3b3862098686780496f69c2ccfa613320299f Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Wed, 27 Nov 2024 10:49:46 +0100 Subject: [PATCH 03/13] sap_ha_pacemaker_cluster: Remove unnecessary parens --- .../tasks/construct_vars_nwas_common.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml index 5d1c0317..55bdbf42 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml @@ -81,7 +81,7 @@ {% set idname = __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name %} {% elif '/usr/sap/trans' in __mountpoint -%} {% set idname = __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name %} - {% elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid) + '/SYS' in __mountpoint -%} + {% elif '/usr/sap/' + __sap_ha_pacemaker_cluster_nwas_sid + '/SYS' in __mountpoint -%} {% set idname = __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name %} {% endif %} {{ idname }} @@ -162,7 +162,7 @@ {{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name }} - {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid) + '/SYS' in __mountpoint -%} + {%- elif '/usr/sap/' + __sap_ha_pacemaker_cluster_nwas_sid + '/SYS' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name }} {%- endif %} resource_id: |- @@ -170,7 +170,7 @@ {{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name }} - {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid) + '/SYS' in __mountpoint -%} + {%- elif '/usr/sap/' + __sap_ha_pacemaker_cluster_nwas_sid + '/SYS' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name }} {%- endif %} meta_attrs: From 4ba22dc4056ff0b7ffebc16f25ab141705cec64c Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 29 Nov 2024 12:36:46 +0100 Subject: [PATCH 04/13] sap_hana_preconfigure: Do not install compat-sap-c++-13 on RHEL 9.0 ... because HANA 2.0 SPS08 (GCC13 based) has only been validated by SAP starting with RHEL 9.2 Fixes issue #901. Signed-off-by: Bernd Finger --- .../sap_hana_preconfigure/vars/RedHat_9.0.yml | 306 ++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 roles/sap_hana_preconfigure/vars/RedHat_9.0.yml diff --git a/roles/sap_hana_preconfigure/vars/RedHat_9.0.yml b/roles/sap_hana_preconfigure/vars/RedHat_9.0.yml new file mode 100644 index 00000000..573d1026 --- /dev/null +++ b/roles/sap_hana_preconfigure/vars/RedHat_9.0.yml @@ -0,0 +1,306 @@ +# SPDX-License-Identifier: Apache-2.0 +--- + +# supported RHEL 9 minor releases for SAP HANA: +__sap_hana_preconfigure_supported_rhel_minor_releases: + - "9.0" + - "9.2" + - "9.4" + +# required repos for RHEL 9: +__sap_hana_preconfigure_req_repos_redhat_9_0_x86_64: + - "rhel-9-for-x86_64-baseos-e4s-rpms" + - "rhel-9-for-x86_64-appstream-e4s-rpms" + - "rhel-9-for-x86_64-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_0_ppc64le: + - "rhel-9-for-ppc64le-baseos-e4s-rpms" + - "rhel-9-for-ppc64le-appstream-e4s-rpms" + - "rhel-9-for-ppc64le-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_1_x86_64: + - "rhel-9-for-x86_64-baseos-rpms" + - "rhel-9-for-x86_64-appstream-rpms" + - "rhel-9-for-x86_64-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_1_ppc64le: + - "rhel-9-for-ppc64le-baseos-rpms" + - "rhel-9-for-ppc64le-appstream-rpms" + - "rhel-9-for-ppc64le-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_2_x86_64: + - "rhel-9-for-x86_64-baseos-e4s-rpms" + - "rhel-9-for-x86_64-appstream-e4s-rpms" + - "rhel-9-for-x86_64-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_2_ppc64le: + - "rhel-9-for-ppc64le-baseos-e4s-rpms" + - "rhel-9-for-ppc64le-appstream-e4s-rpms" + - "rhel-9-for-ppc64le-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_3_x86_64: + - "rhel-9-for-x86_64-baseos-rpms" + - "rhel-9-for-x86_64-appstream-rpms" + - "rhel-9-for-x86_64-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_3_ppc64le: + - "rhel-9-for-ppc64le-baseos-rpms" + - "rhel-9-for-ppc64le-appstream-rpms" + - "rhel-9-for-ppc64le-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_4_x86_64: + - "rhel-9-for-x86_64-baseos-e4s-rpms" + - "rhel-9-for-x86_64-appstream-e4s-rpms" + - "rhel-9-for-x86_64-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_4_ppc64le: + - "rhel-9-for-ppc64le-baseos-e4s-rpms" + - "rhel-9-for-ppc64le-appstream-e4s-rpms" + - "rhel-9-for-ppc64le-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_5_x86_64: + - "rhel-9-for-x86_64-baseos-rpms" + - "rhel-9-for-x86_64-appstream-rpms" + - "rhel-9-for-x86_64-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_5_ppc64le: + - "rhel-9-for-ppc64le-baseos-rpms" + - "rhel-9-for-ppc64le-appstream-rpms" + - "rhel-9-for-ppc64le-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_6_x86_64: + - "rhel-9-for-x86_64-baseos-e4s-rpms" + - "rhel-9-for-x86_64-appstream-e4s-rpms" + - "rhel-9-for-x86_64-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_6_ppc64le: + - "rhel-9-for-ppc64le-baseos-e4s-rpms" + - "rhel-9-for-ppc64le-appstream-e4s-rpms" + - "rhel-9-for-ppc64le-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_7_x86_64: + - "rhel-9-for-x86_64-baseos-rpms" + - "rhel-9-for-x86_64-appstream-rpms" + - "rhel-9-for-x86_64-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_7_ppc64le: + - "rhel-9-for-ppc64le-baseos-rpms" + - "rhel-9-for-ppc64le-appstream-rpms" + - "rhel-9-for-ppc64le-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_8_x86_64: + - "rhel-9-for-x86_64-baseos-e4s-rpms" + - "rhel-9-for-x86_64-appstream-e4s-rpms" + - "rhel-9-for-x86_64-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_8_ppc64le: + - "rhel-9-for-ppc64le-baseos-e4s-rpms" + - "rhel-9-for-ppc64le-appstream-e4s-rpms" + - "rhel-9-for-ppc64le-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_9_x86_64: + - "rhel-9-for-x86_64-baseos-rpms" + - "rhel-9-for-x86_64-appstream-rpms" + - "rhel-9-for-x86_64-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_9_ppc64le: + - "rhel-9-for-ppc64le-baseos-rpms" + - "rhel-9-for-ppc64le-appstream-rpms" + - "rhel-9-for-ppc64le-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_10_x86_64: + - "rhel-9-for-x86_64-baseos-rpms" + - "rhel-9-for-x86_64-appstream-rpms" + - "rhel-9-for-x86_64-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_10_ppc64le: + - "rhel-9-for-ppc64le-baseos-rpms" + - "rhel-9-for-ppc64le-appstream-rpms" + - "rhel-9-for-ppc64le-sap-solutions-rpms" + +# required SAP notes for RHEL 9: +__sap_hana_preconfigure_sapnotes_versions_x86_64: + - { number: '3108302', version: '11' } + - { number: '2382421', version: '47' } + - { number: '3024346', version: '11' } + +__sap_hana_preconfigure_sapnotes_versions_ppc64le: + - { number: '2055470', version: '90' } + - { number: '3108302', version: '11' } + - { number: '2382421', version: '47' } + - { number: '3024346', version: '11' } + +__sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" + +# In SAP Note XXX, certain minimal required packages for the different RHEL 9 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 9.0: +__sap_hana_preconfigure_min_packages_9_0_x86_64: + - [ 'kernel', '5.14.0-70.22.1.el9_0' ] + +__sap_hana_preconfigure_min_packages_9_0_ppc64le: + - [ 'kernel', '5.14.0-70.43.1.el9_0' ] + - [ 'glibc', '2.34-28.el9_0.3' ] + +__sap_hana_preconfigure_min_packages_9_1_x86_64: + +__sap_hana_preconfigure_min_packages_9_1_ppc64le: + +__sap_hana_preconfigure_min_packages_9_2_x86_64: + - [ 'kernel', '5.14.0-284.25.1.el9_2' ] + +__sap_hana_preconfigure_min_packages_9_2_ppc64le: + - [ 'kernel', '5.14.0-284.25.1.el9_2' ] + +__sap_hana_preconfigure_min_packages_9_3_x86_64: + +__sap_hana_preconfigure_min_packages_9_3_ppc64le: + +__sap_hana_preconfigure_min_packages_9_4_x86_64: + - [ 'kernel', '5.14.0-427.16.1.el9_4' ] + +__sap_hana_preconfigure_min_packages_9_4_ppc64le: + - [ 'kernel', '5.14.0-427.16.1.el9_4' ] + +__sap_hana_preconfigure_min_packages_9_5_x86_64: + +__sap_hana_preconfigure_min_packages_9_5_ppc64le: + +__sap_hana_preconfigure_min_packages_9_6_x86_64: + +__sap_hana_preconfigure_min_packages_9_6_ppc64le: + +__sap_hana_preconfigure_min_packages_9_7_x86_64: + +__sap_hana_preconfigure_min_packages_9_7_ppc64le: + +__sap_hana_preconfigure_min_packages_9_8_x86_64: + +__sap_hana_preconfigure_min_packages_9_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 3108316: + - expect +# package gtk2: only needed if the SAP HANA installation tools hdblcmgui and hdbsetup are used + - gtk2 + - krb5-workstation + - libatomic + - libcanberra-gtk2 + - libtool-ltdl + - numactl + - PackageKit-gtk3-module + - xorg-x11-xauth +# package chkconfig: needed by hdblcm to be able to access /etc/init.d + - chkconfig +# package compat-openssl11: needed for HANA scale-out and when configuring HANA backup on Azure + - compat-openssl11 +# package libxcrypt-compat: needed SAP HANA and also by sapstartsrv on RHEL 9: +# - libxcrypt-compat # now installed by role sap_general_preconfigure, see also SAP note 3108316, version 4. +# For support purposes: +# package graphwiz: graph visualization tools, for supportability) + - graphviz +# package iptraf-ng: TCP/IP network monitor, for supportability) + - iptraf-ng +# package lm-sensors: TCP/IP network monitor, for supportability) + - lm_sensors +# package nfs-utils: support utilities for NFS, for supportability) + - nfs-utils +# SAP NOTE 3108302: + - tuned-profiles-sap-hana + +__sap_hana_preconfigure_packages_min_install: +# SAP NOTE 3108316: + - expect +# package gtk2: only needed if the SAP HANA installation tools hdblcmgui and hdbsetup are used +# - gtk2 + - krb5-workstation + - libatomic + - libcanberra-gtk2 + - libtool-ltdl + - numactl + - PackageKit-gtk3-module + - xorg-x11-xauth +# package compat-openssl11: needed for HANA scale-out and when configuring HANA backup on Azure + - compat-openssl11 +# required for SAP HANA on RHEL 9: + - libxcrypt-compat +# For support purposes: +# package graphwiz: graph visualization tools, for supportability) +# - graphviz +# package iptraf-ng: TCP/IP network monitor, for supportability) +# - iptraf-ng +# package lm-sensors: TCP/IP network monitor, for supportability) +# - lm_sensors +# package nfs-utils: support utilities for NFS, for supportability) +# - nfs-utils +# SAP NOTE 3108302: + - tuned-profiles-sap-hana + +# URL for the IBM Power Systems service and productivity tools, see https://www.ibm.com/support/pages/service-and-productivity-tools +__sap_hana_preconfigure_ibm_power_repo_url: 'https://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-latest.noarch.rpm' + +__sap_hana_preconfigure_required_ppc64le: + - ibm-power-managed-rhel9 + +# Network related kernel parameters as set in SAP Note 2382421: +__sap_hana_preconfigure_kernel_parameters_default: +# The following parameter should always be set: + - { name: net.ipv4.tcp_max_syn_backlog, value: 8192 } +# The following two parameters are automatically set by SAP Host Agent +# - { name: net.ipv4.ip_local_port_range, value: "40000 61000" } +# - { name: net.ipv4.ip_local_reserved_ports, value: -> SAP NOTE 2477204 } +# The following two parameters do not work when communicating with hosts behind NAT firewall: +# - { name: net.ipv4.tcp_tw_reuse, value: 1 } +# - { name: net.ipv4.tcp_tw_recycle, value: 1 } +# The following parameter should always be set but might not work on Azure (see SAP Note 2382421): + - { name: net.ipv4.tcp_timestamps, value: 1 } +# The following parameter should always be set: + - { name: net.ipv4.tcp_slow_start_after_idle, value: 0 } +# Tune the next four parameters for low latency system replication: +# - { net.ipv4.tcp_wmem, value } +# - { net.ipv4.tcp_rmem, value } +# - { net.core.wmem_max, value } +# - { net.core.rmem_max, value } +# Should be set correctly already on most systems, according to SAP Note 2382421: +# - { net.ipv4.tcp_window_scaling, 1 } +# The following only applies to HANA 1 <= 122.14 and HANA 2 SPS00. +# So we do not change the default. +# - { name: net.ipv4.tcp_syn_retries, value: 8 } + +# Network related kernel parameters for ppc64le: +__sap_hana_preconfigure_kernel_parameters_default_ppc64le: + - { name: net.core.rmem_max, value: 56623104 } + - { name: net.core.wmem_max, value: 56623104 } + - { name: net.ipv4.tcp_rmem, value: "65536 262088 56623104" } + - { name: net.ipv4.tcp_wmem, value: "65536 262088 56623104" } + - { name: net.ipv4.tcp_mem, value: "56623104 56623104 56623104" } + +# Network related kernel parameters for NetApp NFS, as set in SAP Note 3024346: +__sap_hana_preconfigure_kernel_parameters_netapp_nfs: + - { name: net.core.rmem_max, value: 16777216 } + - { name: net.core.wmem_max, value: 16777216 } + - { name: net.ipv4.tcp_rmem, value: "4096 131072 16777216" } + - { name: net.ipv4.tcp_wmem, value: "4096 16384 16777216" } + - { name: net.core.netdev_max_backlog, value: 300000 } +# already set in SAP note 2382421: +# - { name: net.ipv4.tcp_slow_start_after_idle, value: 0 } + - { name: net.ipv4.tcp_no_metrics_save, value: 1 } + - { name: net.ipv4.tcp_moderate_rcvbuf, value: 1 } + - { name: net.ipv4.tcp_window_scaling, value: 1 } +# already set in SAP note 2382421: +# - { name: net.ipv4.tcp_timestamps, value: 1 } + - { name: net.ipv4.tcp_sack, value: 1 } + +# yamllint disable rule:commas rule:colons +__sap_hana_preconfigure_packages_and_services: + abrtd: { pkg: 'abrt', svc: 'abrtd', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } + abrt-ccpp: { pkg: 'abrt-addon-ccpp', svc: 'abrt-ccpp', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } + numad: { pkg: 'numad', svc: 'numad', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } + kdump: { pkg: 'kexec-tools', svc: 'kdump', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } + firewalld: { pkg: 'firewalld', svc: 'firewalld', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } +# yamllint enable rule:commas rule:colons From 34c8352ec31eb0a34a17f9cead7bfffe375bf4aa Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Fri, 29 Nov 2024 14:37:13 +0100 Subject: [PATCH 05/13] sap_ha_pacemaker_cluster: fix UUID discovery for IBM Cloud VS --- .../platform/register_sysinfo_cloud_ibmcloud_powervs.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml index f53320b6..478ae927 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml @@ -3,13 +3,12 @@ # Ansible facts rely on SMBIOS/DMI, which does not exist on ppc64le CPU Architecture. # Discovered input used for plug (via pcmk_host_map) -# The Instance ID in the IBM Power Virtual Server Workspace, is identical string to the UUID reported in the host -# alt command using IBM Power RSCT binary: /opt/rsct/bin/ctgethscid | grep PartitionUUID | cut -d \" -f2 -# alt command using cloud-init data: cat /run/cloud-init/instance-data.json | grep uuid | cut -d \" -f4 -# alt command using cloud-init data: cat /run/cloud-init/instance-data.json | grep instance_id | cut -d \" -f4 +# Reference - https://ibm.com/support/pages/node/7075598 +# The Instance ID in the IBM Power Virtual Server Workspace, must be identical string to the UUID reported in the host +# Use cloud-init data as definitive lookup on IBM Power VS, as IBM Power RSCT Binary /opt/rsct/bin/ctgethscid or Kernel data structure such as /proc/device-tree/ibm,partition-uuid - name: "SAP HA Prepare Pacemaker - IBM Cloud Power VS - IBM Power Virtual Server UUID" ansible.builtin.shell: | - set -o pipefail && echo $(tr -d '\0' < /proc/device-tree/ibm,partition-uuid) + set -o pipefail && echo $(cat /run/cloud-init/instance-data.json | grep instance_id | cut -d \" -f4) register: __sap_ha_pacemaker_cluster_register_ibmcloud_powervs_host changed_when: false check_mode: false From 2fa9c66e03430645c5feb5c85127d5c96d303ecc Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Fri, 29 Nov 2024 15:41:41 +0100 Subject: [PATCH 06/13] sap_ha_pacemaker_cluster: fix MS Azure repo name for RHEL --- roles/sap_ha_pacemaker_cluster/vars/redhat.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index 569c91c3..1e49fbff 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -31,8 +31,8 @@ __sap_ha_pacemaker_cluster_repos_dict: cloud_msazure_vm: - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rhui-rpms" name: High Availability - - id: "rhui-microsoft-azure-rhel8-sap-ha" - name: Microsoft Azure RPMs for Red Hat Enterprise Linux 8 (rhel8-sap-ha) + - id: "rhui-microsoft-azure-rhel{{ ansible_distribution_major_version }}-sap-ha" + name: Microsoft Azure RPMs for Red Hat Enterprise Linux {{ ansible_distribution_major_version }} (rhel{{ ansible_distribution_major_version }}-sap-ha) hyp_ibmpower_vm: - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rpms" name: High Availability E4S (4-Year) for Power, little endian From 443e30e206d2cad6177c970b9172d4dde3162cd1 Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Fri, 29 Nov 2024 15:54:18 +0100 Subject: [PATCH 07/13] sap_ha_pacemaker_cluster: fix RHEL 9+ resource agent package list on MS Azure --- roles/sap_ha_pacemaker_cluster/vars/redhat.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index 1e49fbff..d8fc31b4 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -87,6 +87,7 @@ __sap_ha_pacemaker_cluster_platform_extra_packages_dict: cloud_gcp_ce_vm: - resource-agents-gcp cloud_msazure_vm: + - "{{ 'resource-agents-cloud' if ansible_distribution_major_version is version('9', '>=') else '' }}" - socat # Dictionary with additional cluster packages for specific scenarios From ad347f3bce2c40cc4185762e8c1d950886a93236 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 29 Nov 2024 17:25:51 +0100 Subject: [PATCH 08/13] collection: prepare for v1.5.0 Signed-off-by: Bernd Finger --- CHANGELOG.rst | 76 +++++++++++++++++++++++++++++++++++++++ changelogs/changelog.yaml | 65 +++++++++++++++++++++++++++++++++ galaxy.yml | 2 +- 3 files changed, 142 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1bebd970..5191af6d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,82 @@ community.sap_install Release Notes .. contents:: Topics +v1.5.0 +====== + +Release Summary +--------------- +- Release Date: 2024-11-29 + +This is a minor release of the `community.sap_install` collection. + +Major Changes +------------- +- feat: collection: Readme overhaul for all roles in collection (https://github.com/sap-linuxlab/community.sap_install/pull/873) +- feat: sap_ha_pacemaker_cluster: JAVA HA scenarios and complete refactor of role (https://github.com/sap-linuxlab/community.sap_install/pull/882) +- feat: sap_ha_pacemaker_cluster: Stonith SBD enablement (https://github.com/sap-linuxlab/community.sap_install/pull/829) +- feat: sap_swpm: New improved and simplified version (https://github.com/sap-linuxlab/community.sap_install/pull/840) + +Minor Changes +------------- +- feat: collection: Add playbook for direct execution (https://github.com/sap-linuxlab/community.sap_install/pull/842) +- feat: sap_ha_pacemaker_cluster: New azure fence agent package for SUSE (https://github.com/sap-linuxlab/community.sap_install/pull/837) +- feat: sap_ha_pacemaker_cluster: Enhance corosync totem handling with new dictionaries (https://github.com/sap-linuxlab/community.sap_install/pull/834) +- feat: sap_ha_pacemaker_cluster: GCP VIP reworked, Health check names updated (https://github.com/sap-linuxlab/community.sap_install/pull/863) +- feat: sap_swpm: Option to enable SWPM observer mode (https://github.com/sap-linuxlab/community.sap_install/pull/749) +- feat: sap_storage_setup: Add support for HANA Scaleout NFS filesystems (https://github.com/sap-linuxlab/community.sap_install/pull/800) +- feat: sap_storage_setup: Add exact size disk check on top of approximate check (https://github.com/sap-linuxlab/community.sap_install/pull/839) +- feat: sap_hana_install: Implement an SAP HANA installation check only feature (https://github.com/sap-linuxlab/community.sap_install/pull/849) +- collection: Add collection dependency for community.general (https://github.com/sap-linuxlab/community.sap_install/pull/808) +- collection: Modify for yamllint requirements (https://github.com/sap-linuxlab/community.sap_install/pull/811) +- sap_ha_pacemaker_cluster: Add override to use Classic SAPHanaSR agents (https://github.com/sap-linuxlab/community.sap_install/pull/806) +- sap_ha_pacemaker_cluster: Packages on AWS for RHEL (https://github.com/sap-linuxlab/community.sap_install/pull/857) +- sap_ha_pacemaker_cluster: GCP haproxy handling and new platform VIP dictionary (https://github.com/sap-linuxlab/community.sap_install/pull/862) +- sap_ha_pacemaker_cluster: vip resources must be first in ASCS/ERS resource groups (https://github.com/sap-linuxlab/community.sap_install/pull/872) +- sap_swpm: Remove the pids module (https://github.com/sap-linuxlab/community.sap_install/pull/786) +- sap_swpm: sap_swpm_db_schema_password must be set explicitly for AAS (https://github.com/sap-linuxlab/community.sap_install/pull/760) +- sap_swpm: hdbuserstore default connection should use sap_swpm_db_schema_abap_password (https://github.com/sap-linuxlab/community.sap_install/pull/748) +- sap_swpm: Add default value for sap_swpm_java_scs_instance_hostname (https://github.com/sap-linuxlab/community.sap_install/pull/801) +- sap_swpm: Reduce the amount of empty lines in inifile.params (https://github.com/sap-linuxlab/community.sap_install/pull/822) +- sap_storage_setup: Defaults and documentation (https://github.com/sap-linuxlab/community.sap_install/pull/825) +- sap_general_preconfigure: Use the package module in most cases (https://github.com/sap-linuxlab/community.sap_install/pull/758) +- sap_general_preconfigure: Use FQCN for import_role (https://github.com/sap-linuxlab/community.sap_install/pull/827) +- sap_hana_preconfigure: Add RHEL 8.10 and 9.4 requirements (https://github.com/sap-linuxlab/community.sap_install/pull/869) +- sap_hana_preconfigure: Zypper lock handler for SUSE (https://github.com/sap-linuxlab/community.sap_install/pull/796) +- sap_hana_preconfigure: Enable TSX also for RHEL 9 (https://github.com/sap-linuxlab/community.sap_install/pull/797) +- sap_hana_preconfigure: Sync with SAP note 3024346 v.10 for RHEL/NetApp (https://github.com/sap-linuxlab/community.sap_install/pull/816) +- sap_hana_preconfigure: Refactor remove default saptune version (https://github.com/sap-linuxlab/community.sap_install/pull/818) +- sap_hana_preconfigure: Update azure override readme (https://github.com/sap-linuxlab/community.sap_install/pull/820) +- sap_hana_preconfigure: Set THP to madvise from RHEL 9.2 onwards (https://github.com/sap-linuxlab/community.sap_install/pull/880) +- sap_hana_preconfigure: Allow setting THP to any possible value (https://github.com/sap-linuxlab/community.sap_install/pull/886) +- sap_hana_preconfigure: No longer set net.core.somaxconn in RHEL 9 (https://github.com/sap-linuxlab/community.sap_install/pull/887) +- sap_hana_preconfigure: Add compat-sap-c++-13 (https://github.com/sap-linuxlab/community.sap_install/pull/895) +- sap_netweaver_preconfigure: Rename package libcpupower1 for SLES4SAP 15 SP6 (https://github.com/sap-linuxlab/community.sap_install/pull/876) +- sap_netweaver_preconfigure: Sync with applicable SAP notes for Adobe DS (https://github.com/sap-linuxlab/community.sap_install/pull/888) +- sap_hana_install: Use polling for hdblcm (https://github.com/sap-linuxlab/community.sap_install/pull/805) +- sap_hana_install: Set the install execution mode to 'optimized' (https://github.com/sap-linuxlab/community.sap_install/pull/896) +- sap_install_media_detect: AWS IGW slow impacts gpg key (https://github.com/sap-linuxlab/community.sap_install/pull/772) +- sap_install_media_detect: Search known subdirs on re-run (https://github.com/sap-linuxlab/community.sap_install/pull/773) +- sap_install_media_detect: Append loop labels (https://github.com/sap-linuxlab/community.sap_install/pull/781) +- sap_install_media_detect: Allow disabling RAR handling (https://github.com/sap-linuxlab/community.sap_install/pull/856) +- sap_ha_install_anydb_ibmdb2: Append ibmcloud_vs (https://github.com/sap-linuxlab/community.sap_install/pull/815) + +Bugfixes +-------- +- sap_ha_pacemaker_cluster: Add python3-pip and NFS fix for Azure (https://github.com/sap-linuxlab/community.sap_install/pull/754) +- sap_ha_pacemaker_cluster: Fix pcs resource restart (https://github.com/sap-linuxlab/community.sap_install/pull/769) +- sap_ha_pacemaker_cluster: Fix haproxy and minor lint issues (https://github.com/sap-linuxlab/community.sap_install/pull/898) +- sap_ha_pacemaker_cluster: Fix UUID discovery for IBM Cloud VS (https://github.com/sap-linuxlab/community.sap_install/pull/903) +- sap_swpm: Add error notes to dev doc (https://github.com/sap-linuxlab/community.sap_install/pull/795) +- sap_swpm: Fix error when observer user defined, but empty and observer mode is on (https://github.com/sap-linuxlab/community.sap_install/pull/850) +- sap_swpm: Fix issues with localhost delegation on certain control nodes (https://github.com/sap-linuxlab/community.sap_install/pull/891) +- sap_*_preconfigure: Fixes for testing with molecule (https://github.com/sap-linuxlab/community.sap_install/pull/807) +- sap_*_preconfigure: Edge case handling for SUSE packages +- sap_general_preconfigure: Reboot fix in handler (https://github.com/sap-linuxlab/community.sap_install/pull/892) +- sap_ha_install_hana_hsr: Fixes to work for multiple secondaries (https://github.com/sap-linuxlab/community.sap_install/pull/866) +- sap_ha_install_anydb_ibmdb2: Linting and sles bug fixes (https://github.com/sap-linuxlab/community.sap_install/pull/803) + + v1.4.1 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 8468089a..5d6e78e8 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -208,3 +208,68 @@ releases: | sap_swpm: optionally skip setting file permissions ' release_date: '2024-06-20' + 1.4.1: + changes: + release_summary: '| Release Date: 2024-11-29 + major_changes: + - feat: collection: Readme overhaul for all roles in collection (https://github.com/sap-linuxlab/community.sap_install/pull/873) + - feat: sap_ha_pacemaker_cluster: JAVA HA scenarios and complete refactor of role (https://github.com/sap-linuxlab/community.sap_install/pull/882) + - feat: sap_ha_pacemaker_cluster: Stonith SBD enablement (https://github.com/sap-linuxlab/community.sap_install/pull/829) + - feat: sap_swpm: New improved and simplified version (https://github.com/sap-linuxlab/community.sap_install/pull/840) + minor_changes: + - feat: collection: Add playbook for direct execution (https://github.com/sap-linuxlab/community.sap_install/pull/842) + - feat: sap_ha_pacemaker_cluster: New azure fence agent package for SUSE (https://github.com/sap-linuxlab/community.sap_install/pull/837) + - feat: sap_ha_pacemaker_cluster: Enhance corosync totem handling with new dictionaries (https://github.com/sap-linuxlab/community.sap_install/pull/834) + - feat: sap_ha_pacemaker_cluster: GCP VIP reworked, Health check names updated (https://github.com/sap-linuxlab/community.sap_install/pull/863) + - feat: sap_swpm: Option to enable SWPM observer mode (https://github.com/sap-linuxlab/community.sap_install/pull/749) + - feat: sap_storage_setup: Add support for HANA Scaleout NFS filesystems (https://github.com/sap-linuxlab/community.sap_install/pull/800) + - feat: sap_storage_setup: Add exact size disk check on top of approximate check (https://github.com/sap-linuxlab/community.sap_install/pull/839) + - feat: sap_hana_install: Implement an SAP HANA installation check only feature (https://github.com/sap-linuxlab/community.sap_install/pull/849) + - collection: Add collection dependency for community.general (https://github.com/sap-linuxlab/community.sap_install/pull/808) + - collection: Modify for yamllint requirements (https://github.com/sap-linuxlab/community.sap_install/pull/811) + - sap_ha_pacemaker_cluster: Add override to use Classic SAPHanaSR agents (https://github.com/sap-linuxlab/community.sap_install/pull/806) + - sap_ha_pacemaker_cluster: Packages on AWS for RHEL (https://github.com/sap-linuxlab/community.sap_install/pull/857) + - sap_ha_pacemaker_cluster: GCP haproxy handling and new platform VIP dictionary (https://github.com/sap-linuxlab/community.sap_install/pull/862) + - sap_ha_pacemaker_cluster: vip resources must be first in ASCS/ERS resource groups (https://github.com/sap-linuxlab/community.sap_install/pull/872) + - sap_swpm: Remove the pids module (https://github.com/sap-linuxlab/community.sap_install/pull/786) + - sap_swpm: sap_swpm_db_schema_password must be set explicitly for AAS (https://github.com/sap-linuxlab/community.sap_install/pull/760) + - sap_swpm: hdbuserstore default connection should use sap_swpm_db_schema_abap_password (https://github.com/sap-linuxlab/community.sap_install/pull/748) + - sap_swpm: Add default value for sap_swpm_java_scs_instance_hostname (https://github.com/sap-linuxlab/community.sap_install/pull/801) + - sap_swpm: Reduce the amount of empty lines in inifile.params (https://github.com/sap-linuxlab/community.sap_install/pull/822) + - sap_storage_setup: Defaults and documentation (https://github.com/sap-linuxlab/community.sap_install/pull/825) + - sap_general_preconfigure: Use the package module in most cases (https://github.com/sap-linuxlab/community.sap_install/pull/758) + - sap_general_preconfigure: Use FQCN for import_role (https://github.com/sap-linuxlab/community.sap_install/pull/827) + - sap_hana_preconfigure: Add RHEL 8.10 and 9.4 requirements (https://github.com/sap-linuxlab/community.sap_install/pull/869) + - sap_hana_preconfigure: Zypper lock handler for SUSE (https://github.com/sap-linuxlab/community.sap_install/pull/796) + - sap_hana_preconfigure: Enable TSX also for RHEL 9 (https://github.com/sap-linuxlab/community.sap_install/pull/797) + - sap_hana_preconfigure: Sync with SAP note 3024346 v.10 for RHEL/NetApp (https://github.com/sap-linuxlab/community.sap_install/pull/816) + - sap_hana_preconfigure: Refactor remove default saptune version (https://github.com/sap-linuxlab/community.sap_install/pull/818) + - sap_hana_preconfigure: Update azure override readme (https://github.com/sap-linuxlab/community.sap_install/pull/820) + - sap_hana_preconfigure: Set THP to madvise from RHEL 9.2 onwards (https://github.com/sap-linuxlab/community.sap_install/pull/880) + - sap_hana_preconfigure: Allow setting THP to any possible value (https://github.com/sap-linuxlab/community.sap_install/pull/886) + - sap_hana_preconfigure: No longer set net.core.somaxconn in RHEL 9 (https://github.com/sap-linuxlab/community.sap_install/pull/887) + - sap_hana_preconfigure: Add compat-sap-c++-13 (https://github.com/sap-linuxlab/community.sap_install/pull/895) + - sap_netweaver_preconfigure: Rename package libcpupower1 for SLES4SAP 15 SP6 (https://github.com/sap-linuxlab/community.sap_install/pull/876) + - sap_netweaver_preconfigure: Sync with applicable SAP notes for Adobe DS (https://github.com/sap-linuxlab/community.sap_install/pull/888) + - sap_hana_install: Use polling for hdblcm (https://github.com/sap-linuxlab/community.sap_install/pull/805) + - sap_hana_install: Set the install execution mode to "optimized" (https://github.com/sap-linuxlab/community.sap_install/pull/896) + - sap_install_media_detect: AWS IGW slow impacts gpg key (https://github.com/sap-linuxlab/community.sap_install/pull/772) + - sap_install_media_detect: Search known subdirs on re-run (https://github.com/sap-linuxlab/community.sap_install/pull/773) + - sap_install_media_detect: Append loop labels (https://github.com/sap-linuxlab/community.sap_install/pull/781) + - sap_install_media_detect: Allow disabling RAR handling (https://github.com/sap-linuxlab/community.sap_install/pull/856) + - sap_ha_install_anydb_ibmdb2: Append ibmcloud_vs (https://github.com/sap-linuxlab/community.sap_install/pull/815) + bugfixes: + - sap_ha_pacemaker_cluster: Add python3-pip and NFS fix for Azure (https://github.com/sap-linuxlab/community.sap_install/pull/754) + - sap_ha_pacemaker_cluster: Fix pcs resource restart (https://github.com/sap-linuxlab/community.sap_install/pull/769) + - sap_ha_pacemaker_cluster: Fix haproxy and minor lint issues (https://github.com/sap-linuxlab/community.sap_install/pull/898) + - sap_ha_pacemaker_cluster: Fix UUID discovery for IBM Cloud VS (https://github.com/sap-linuxlab/community.sap_install/pull/903) + - sap_swpm: Add error notes to dev doc (https://github.com/sap-linuxlab/community.sap_install/pull/795) + - sap_swpm: Fix error when observer user defined, but empty and observer mode is on (https://github.com/sap-linuxlab/community.sap_install/pull/850) + - sap_swpm: Fix issues with localhost delegation on certain control nodes (https://github.com/sap-linuxlab/community.sap_install/pull/891) + - sap_*_preconfigure: Fixes for testing with molecule (https://github.com/sap-linuxlab/community.sap_install/pull/807) + - sap_*_preconfigure: Edge case handling for SUSE packages + - sap_general_preconfigure: Reboot fix in handler (https://github.com/sap-linuxlab/community.sap_install/pull/892) + - sap_ha_install_hana_hsr: Fixes to work for multiple secondaries (https://github.com/sap-linuxlab/community.sap_install/pull/866) + - sap_ha_install_anydb_ibmdb2: Linting and sles bug fixes (https://github.com/sap-linuxlab/community.sap_install/pull/803) + ' + release_date: '2024-11-29' diff --git a/galaxy.yml b/galaxy.yml index e7b12a84..bb5e3566 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -11,7 +11,7 @@ namespace: community name: sap_install # The version of the collection. Must be compatible with semantic versioning -version: 1.4.1 +version: 1.5.0 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md From adc444f6ada6bbe362bfdb55cc9e72ee946b0842 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 29 Nov 2024 17:31:35 +0100 Subject: [PATCH 09/13] collection: Fix duplicate release entry in changelog.yaml Signed-off-by: Bernd Finger --- changelogs/changelog.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 5d6e78e8..b81cefc3 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -208,7 +208,7 @@ releases: | sap_swpm: optionally skip setting file permissions ' release_date: '2024-06-20' - 1.4.1: + 1.5.0: changes: release_summary: '| Release Date: 2024-11-29 major_changes: From bb0e98257fbbfadf2903724adcb9b39497b61a51 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Mon, 9 Dec 2024 10:47:53 +0100 Subject: [PATCH 10/13] feat: vars loading reworked, linting yes/no cleanup --- .../tasks/RedHat/assert-installation.yml | 22 ++++---- .../generic/assert-dns-name-resolution.yml | 6 +-- .../tasks/RedHat/generic/assert-etc-hosts.yml | 24 ++++----- .../tasks/RedHat/generic/assert-firewall.yml | 6 +-- .../tasks/RedHat/generic/assert-hostname.yml | 4 +- .../assert-kernel-parameters-loop-block.yml | 8 +-- .../RedHat/generic/assert-nofile-limits.yml | 16 +++--- .../RedHat/generic/assert-nproc-limits.yml | 16 +++--- .../tasks/RedHat/generic/assert-selinux.yml | 6 +-- .../tasks/RedHat/generic/assert-tmpfs.yml | 8 +-- .../tasks/RedHat/generic/assert-uuidd.yml | 4 +- .../RedHat/generic/configure-etc-hosts.yml | 4 +- .../RedHat/generic/configure-firewall.yml | 2 +- .../generic/configure-kernel-parameters.yml | 2 +- .../RedHat/generic/configure-selinux.yml | 6 +-- .../generic/configure-systemd-tmpfiles.yml | 4 +- .../tasks/RedHat/generic/configure-tmpfs.yml | 6 +-- .../tasks/RedHat/generic/configure-uuidd.yml | 4 +- .../RedHat/generic/increase-nofile-limits.yml | 4 +- .../RedHat/generic/increase-nproc-limits.yml | 4 +- .../tasks/RedHat/installation.yml | 4 +- .../tasks/SLES/assert-installation.yml | 10 ++-- .../tasks/SLES/installation.yml | 4 +- roles/sap_general_preconfigure/tasks/main.yml | 34 ++++++++++-- .../04-assert-network-time-and-date.yml | 4 +- .../04-configure-network-time-and-date.yml | 2 +- .../04-assert-network-time-and-date.yml | 4 +- .../04-configure-network-time-and-date.yml | 2 +- .../vars/{SLES_15.yml => Suse.yml} | 7 ++- .../Suse/post_steps_nwas_abap_ascs_ers.yml | 27 ++-------- .../Suse/post_steps_nwas_java_scs_ers.yml | 27 ++-------- .../tasks/include_vars_common.yml | 25 ++++++--- .../vars/{redhat.yml => RedHat.yml} | 0 .../sap_ha_pacemaker_cluster/vars/SLES_15.yml | 20 +++++++ .../vars/{suse.yml => Suse.yml} | 3 +- roles/sap_hana_install/defaults/main.yml | 42 ++++++++------- roles/sap_hana_install/tasks/post_install.yml | 12 +++-- .../tasks/post_install/firewall.yml | 10 ++-- .../tasks/post_install/update_firewall.yml | 4 +- roles/sap_hana_install/tasks/pre_install.yml | 53 ++++++++++--------- .../tasks/pre_install/hdblcm_prepare.yml | 2 +- .../tasks/pre_install/prepare_sarfiles.yml | 4 +- .../tasks/SLES/configuration.yml | 2 +- roles/sap_hana_preconfigure/tasks/main.yml | 43 ++++++++++----- .../defaults/main.yml | 2 +- .../tasks/RedHat/assert-installation.yml | 2 +- .../tasks/RedHat/configuration.yml | 12 +++-- .../sap_netweaver_preconfigure/tasks/main.yml | 43 ++++++++++----- .../vars/SLES_15.6.yml | 23 +++++--- .../vars/SLES_15.yml | 20 ++++--- 50 files changed, 342 insertions(+), 261 deletions(-) rename roles/sap_general_preconfigure/vars/{SLES_15.yml => Suse.yml} (62%) rename roles/sap_ha_pacemaker_cluster/vars/{redhat.yml => RedHat.yml} (100%) create mode 100644 roles/sap_ha_pacemaker_cluster/vars/SLES_15.yml rename roles/sap_ha_pacemaker_cluster/vars/{suse.yml => Suse.yml} (98%) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml index 135c2ccd..bba57f19 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml @@ -49,7 +49,7 @@ - name: Assert - Get info about enabled repos ansible.builtin.shell: set -o pipefail && subscription-manager repos --list-enabled | awk '/Repo ID:/{print $NF}' register: __sap_general_preconfigure_register_enabled_repos_assert - changed_when: no + changed_when: false - name: Assert that all required repos are enabled ansible.builtin.assert: @@ -69,8 +69,8 @@ - name: Detect if and how the minor RHEL release is set ansible.builtin.shell: set -o pipefail && subscription-manager release | awk 'NF==2{printf $NF}NF!=2{print}' register: __sap_general_preconfigure_register_subscription_manager_release_assert - changed_when: no - ignore_errors: yes + changed_when: false + ignore_errors: true - name: Assert that the RHEL release is locked correctly ansible.builtin.assert: @@ -104,7 +104,7 @@ - name: Check if required RHEL 7 package groups are installed # noqa command-instead-of-shell ansible.builtin.shell: "{{ __sap_general_preconfigure_fact_yum_group_list_installed_command_assert }}" register: __sap_general_preconfigure_register_yum_group_assert - changed_when: no + changed_when: false - name: Assert that all required RHEL 7 package groups are installed ansible.builtin.assert: @@ -133,7 +133,7 @@ - name: Check if required RHEL 8 environment groups are installed # noqa command-instead-of-shell ansible.builtin.shell: "{{ __sap_general_preconfigure_fact_yum_envgroup_list_installed_command_assert }}" register: __sap_general_preconfigure_register_yum_envgroup_assert - changed_when: no + changed_when: false - name: Assert that all required RHEL 8 environment groups are installed ansible.builtin.assert: @@ -162,7 +162,7 @@ set -o pipefail && yum info installed {{ __sap_general_preconfigure_required_ppc64le | map('quote') | join(' ') }} | awk '/Name/{n=$NF}/Version/{v=$NF}/Release/{r=$NF}/Description/{printf ("%s\n", n)}' register: __sap_general_preconfigure_register_required_ppc64le_packages_assert - changed_when: no + changed_when: false when: ansible_architecture == "ppc64le" ignore_errors: "{{ sap_general_preconfigure_assert_ignore_errors | d(false) }}" @@ -223,9 +223,9 @@ with_list: "{{ __sap_general_preconfigure_min_pkgs }}" loop_control: loop_var: pkg - check_mode: no + check_mode: false register: __sap_general_preconfigure_register_minpkglist_assert - changed_when: no + changed_when: false - name: Assert that minimum required package versions are installed # If the output includes the string "is already installed" (case 2b), we have a PASS. Otherwise, it's a FAIL. @@ -237,12 +237,12 @@ loop_control: loop_var: line_item label: "" - ignore_errors: yes + ignore_errors: true - name: Report if no minimum required package version is defined for this RHEL release ansible.builtin.debug: msg: "INFO: No minimum required package version defined (variable __sap_general_preconfigure_min_pkgs)." - ignore_errors: yes + ignore_errors: true when: not __sap_general_preconfigure_min_pkgs | d([]) # Reason for noqa: The yum module appears to not support the check-update option @@ -265,7 +265,7 @@ - name: Report if checking for possible package updates is not requested ansible.builtin.debug: msg: "INFO: Not checking for possible package updates (variable sap_general_preconfigure_update)." - ignore_errors: yes + ignore_errors: true when: not sap_general_preconfigure_update - name: "Assert - Set needs-restarting command in case of RHEL 7" diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-dns-name-resolution.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-dns-name-resolution.yml index 091a538d..c9465aa5 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-dns-name-resolution.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-dns-name-resolution.yml @@ -7,7 +7,7 @@ fail_msg: "FAIL: The DNS domain is not configured! So variable 'sap_general_preconfigure_domain' needs to be configured!" success_msg: "PASS: The DNS domain is configured." # ignore_errors: "{{ sap_general_preconfigure_assert_ignore_errors | d(false) }}" - ignore_errors: yes + ignore_errors: true - name: Assert that variable sap_general_preconfigure_domain is set ansible.builtin.assert: @@ -25,8 +25,8 @@ - name: Check if IP address for sap_general_preconfigure_hostname.sap_general_preconfigure_domain is resolved correctly ansible.builtin.command: dig {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }} +short register: __sap_general_preconfigure_register_dig_short_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false when: "'bind-utils' in ansible_facts.packages" - name: Assert that ansible_default_ipv4.address is set diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-etc-hosts.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-etc-hosts.yml index 282226b8..cd8771b9 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-etc-hosts.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-etc-hosts.yml @@ -11,8 +11,8 @@ - name: Check if ipv4 address, FQDN, and hostname are once in /etc/hosts ansible.builtin.command: awk 'BEGIN{a=0}/^{{ sap_general_preconfigure_ip }}\s/&&/\s{{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}\s/&&(/\s{{ sap_general_preconfigure_hostname }}\s/||/\s{{ sap_general_preconfigure_hostname }}$/){a++}END{print a}' /etc/hosts register: __sap_general_preconfigure_register_ipv4_fqdn_sap_hostname_once_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false - name: Assert that ipv4 address, FQDN, and hostname are once in /etc/hosts ansible.builtin.assert: @@ -25,8 +25,8 @@ - name: Count the number of sap_general_preconfigure_ip ({{ sap_general_preconfigure_ip }}) entries in /etc/hosts ansible.builtin.command: awk 'BEGIN{a=0}/^{{ sap_general_preconfigure_ip }}\s/{a++}END{print a}' /etc/hosts register: __sap_general_preconfigure_register_sap_ip_once_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false - name: Assert that there is exactly one line containing {{ sap_general_preconfigure_ip }} in /etc/hosts ansible.builtin.assert: @@ -40,8 +40,8 @@ /\s{{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}\s/|| /\s{{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}$/{a++}END{print a}' /etc/hosts register: __sap_general_preconfigure_register_fqdn_once_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false - name: Assert that there is just one line containing {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }} in /etc/hosts ansible.builtin.assert: @@ -55,8 +55,8 @@ /\s{{ sap_general_preconfigure_hostname }}\s/|| /\s{{ sap_general_preconfigure_hostname }}$/{a++}END{print a}' /etc/hosts register: __sap_general_preconfigure_register_sap_hostname_once_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false - name: Assert that there is just one line containing {{ sap_general_preconfigure_hostname }} in /etc/hosts ansible.builtin.assert: @@ -68,8 +68,8 @@ - name: Test hostname -s ansible.builtin.shell: test "$(hostname -s)" = "$(hostname)" register: __sap_general_preconfigure_register_hostname_s_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false - name: Assert that hostname -s matches the output of hostname ansible.builtin.assert: @@ -81,8 +81,8 @@ - name: Test hostname -f ansible.builtin.shell: test "$(hostname -f)" = "$(hostname).$(hostname -d)" register: __sap_general_preconfigure_register_hostname_f_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false - name: Assert that hostname -f matches the output of hostname.hostname -d ansible.builtin.assert: diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-firewall.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-firewall.yml index 4b0a0de8..ab5326cf 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-firewall.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-firewall.yml @@ -18,9 +18,9 @@ - name: Get status of firewalld # noqa command-instead-of-module ansible.builtin.command: systemctl status firewalld register: __sap_general_preconfigure_register_firewalld_status_assert - ignore_errors: yes - changed_when: no - no_log: yes + ignore_errors: true + changed_when: false + no_log: true - name: Assert that firewalld is disabled ansible.builtin.assert: diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-hostname.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-hostname.yml index 83ff80aa..60374bc1 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-hostname.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-hostname.yml @@ -4,8 +4,8 @@ - name: Check if hostname is set ansible.builtin.command: hostname register: __sap_general_preconfigure_register_hostname_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false - name: Assert that the output of hostname matches the content of variable sap_general_preconfigure_hostname ansible.builtin.assert: diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-kernel-parameters-loop-block.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-kernel-parameters-loop-block.yml index a5d2fa4b..2660929c 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-kernel-parameters-loop-block.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-kernel-parameters-loop-block.yml @@ -6,8 +6,8 @@ - name: Get {{ line_item.name }} from {{ sap_general_preconfigure_etc_sysctl_sap_conf }} ansible.builtin.shell: awk 'BEGIN{FS="="}/{{ line_item.name }}/{gsub ("^\\s*", "", $NF); print $NF}' {{ sap_general_preconfigure_etc_sysctl_sap_conf }} register: __sap_general_preconfigure_register_sysctl_sap_conf_kernel_parameter_assert - changed_when: no - ignore_errors: yes + changed_when: false + ignore_errors: true when: __sap_general_preconfigure_register_stat_sysctl_sap_conf_assert.stat.exists - name: Assert that {{ line_item.name }} is set correctly in {{ sap_general_preconfigure_etc_sysctl_sap_conf }} @@ -23,8 +23,8 @@ - name: Get {{ line_item.name }} from sysctl ansible.builtin.shell: sysctl -n {{ line_item.name }} | awk '{gsub ("\t", " "); print}' register: __sap_general_preconfigure_register_sysctl_kernel_parameter_assert - changed_when: no - ignore_errors: yes + changed_when: false + ignore_errors: true - name: Assert that {{ line_item.name }} is set correctly as per sysctl ansible.builtin.assert: diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nofile-limits.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nofile-limits.yml index ef40e884..ac4e3a5c 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nofile-limits.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nofile-limits.yml @@ -4,8 +4,8 @@ - name: Check if the hard limit of nofile for group sapsys is 1048576 ansible.builtin.command: awk '!/^#/&&/sapsys/&&/nofile/&&/hard/{print $NF}' /etc/security/limits.d/99-sap.conf register: __sap_general_preconfigure_register_limits_sap_conf_nofile_hard_assert - changed_when: no - ignore_errors: yes + changed_when: false + ignore_errors: true when: - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.exists - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.isreg @@ -25,8 +25,8 @@ - name: Check if the soft limit of nofile for group sapsys is 1048576 ansible.builtin.command: awk '!/^#/&&/sapsys/&&/nofile/&&/soft/{print $NF}' /etc/security/limits.d/99-sap.conf register: __sap_general_preconfigure_register_limits_sap_conf_nofile_soft_assert - changed_when: no - ignore_errors: yes + changed_when: false + ignore_errors: true when: - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.exists - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.isreg @@ -46,8 +46,8 @@ - name: Get the hard limit of nofile for the database group ansible.builtin.command: awk '!/^#/&&/@{{ sap_general_preconfigure_db_group_name }}/&&/nofile/&&/hard/{print $NF}' /etc/security/limits.d/99-sap.conf register: __sap_general_preconfigure_register_limits_sap_conf_db_group_nofile_hard_assert - changed_when: no - ignore_errors: yes + changed_when: false + ignore_errors: true when: - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.exists - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.isreg @@ -67,8 +67,8 @@ - name: Get the soft limit of nofile for the database group ansible.builtin.command: awk '!/^#/&&/@{{ sap_general_preconfigure_db_group_name }}/&&/nofile/&&/soft/{print $NF}' /etc/security/limits.d/99-sap.conf register: __sap_general_preconfigure_register_limits_sap_conf_db_group_nofile_soft_assert - changed_when: no - ignore_errors: yes + changed_when: false + ignore_errors: true when: - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.exists - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.isreg diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nproc-limits.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nproc-limits.yml index db05b0f1..70320201 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nproc-limits.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nproc-limits.yml @@ -4,8 +4,8 @@ - name: Check if the hard limit of nproc for group sapsys is unlimited ansible.builtin.command: awk '/sapsys/&&/nproc/&&/hard/{print $NF}' /etc/security/limits.d/99-sap.conf register: __sap_general_preconfigure_register_limits_sap_conf_nproc_hard_assert - changed_when: no - ignore_errors: yes + changed_when: false + ignore_errors: true when: - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.exists - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.isreg @@ -25,8 +25,8 @@ - name: Check if the soft limit of nproc for group sapsys is unlimited ansible.builtin.command: awk '/sapsys/&&/nproc/&&/soft/{print $NF}' /etc/security/limits.d/99-sap.conf register: __sap_general_preconfigure_register_limits_sap_conf_nproc_soft_assert - changed_when: no - ignore_errors: yes + changed_when: false + ignore_errors: true when: - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.exists - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.isreg @@ -46,8 +46,8 @@ - name: Get the hard limit of nproc for the database group ansible.builtin.command: awk '/@{{ sap_general_preconfigure_db_group_name }}/&&/nproc/&&/hard/{print $NF}' /etc/security/limits.d/99-sap.conf register: __sap_general_preconfigure_register_limits_sap_conf_db_group_nproc_hard_assert - changed_when: no - ignore_errors: yes + changed_when: false + ignore_errors: true when: - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.exists - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.isreg @@ -69,8 +69,8 @@ - name: Get the soft limit of nproc for the database group ansible.builtin.command: awk '/@{{ sap_general_preconfigure_db_group_name }}/&&/nproc/&&/soft/{print $NF}' /etc/security/limits.d/99-sap.conf register: __sap_general_preconfigure_register_limits_sap_conf_db_group_nproc_soft_assert - changed_when: no - ignore_errors: yes + changed_when: false + ignore_errors: true when: - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.exists - __sap_general_preconfigure_register_stat_limits_sap_conf_assert.stat.isreg diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-selinux.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-selinux.yml index 36e1c0c7..b2df48f2 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-selinux.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-selinux.yml @@ -16,21 +16,21 @@ - name: Info about SELinux being set to 'enforcing' ansible.builtin.debug: msg: "INFO: The SELinux state has been set to 'enforcing' (variable sap_general_preconfigure_selinux_state)." - ignore_errors: yes + ignore_errors: true when: "sap_general_preconfigure_selinux_state == 'enforcing'" - name: Warn about how SELinux would be set when role is run in normal mode ansible.builtin.debug: msg: "INFO: When running in normal mode, the role will set the SELinux state to '{{ sap_general_preconfigure_selinux_state }}' (variable sap_general_preconfigure_selinux_state)." - ignore_errors: yes + ignore_errors: true when: "sap_general_preconfigure_selinux_state != 'enforcing'" - name: "Check if the permanent configuration of the SELinux state is '{{ sap_general_preconfigure_selinux_state }}'" ansible.builtin.command: awk 'BEGIN{FS="="}/^SELINUX=/{print $NF}' /etc/selinux/config register: __sap_general_preconfigure_register_selinux_conf_assert changed_when: false - ignore_errors: yes + ignore_errors: true when: __sap_general_preconfigure_register_stat_selinux_conf_assert.stat.isreg - name: "Assert that the permanent configuration of the SELinux state is set to '{{ sap_general_preconfigure_selinux_state }}'" diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-tmpfs.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-tmpfs.yml index 290c9814..9a1588b7 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-tmpfs.yml @@ -4,8 +4,8 @@ - name: Check the size of tmpfs ansible.builtin.command: awk '/\/dev\/shm/&&/tmpfs/{gsub ("defaults,size=", "", $4); print $4}' /etc/fstab register: __sap_general_preconfigure_register_fstab_tmpfs_size_gb_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false - name: Assert that there is an entry for tmpfs in /etc/fstab ansible.builtin.assert: @@ -26,8 +26,8 @@ - name: Check if /dev/shm is available and has the expected size ansible.builtin.shell: df -kl /dev/shm | awk '/\/dev\/shm/&&/tmpfs/{printf ("%.0fG\n", $2/1024/1024)}' register: __sap_general_preconfigure_register_df_shm_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false - name: Assert that the current size of tmpfs is large enough as per df output ansible.builtin.assert: diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-uuidd.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-uuidd.yml index 51e46235..360ef790 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-uuidd.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-uuidd.yml @@ -20,8 +20,8 @@ - name: Get status of uuidd.socket # noqa command-instead-of-module ansible.builtin.command: systemctl status uuidd.socket register: __sap_general_preconfigure_register_uuidd_socket_status_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false - name: Report uuidd.socket service status ansible.builtin.debug: diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-etc-hosts.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-etc-hosts.yml index 1b517f91..306a8e04 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-etc-hosts.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-etc-hosts.yml @@ -67,7 +67,7 @@ fi register: __sap_general_preconfigure_register_duplicate_ip_check changed_when: false - ignore_errors: yes + ignore_errors: true when: not ansible_check_mode - name: Verify that variable sap_general_preconfigure_domain is set @@ -89,7 +89,7 @@ path: /etc/hosts regexp: '^{{ sap_general_preconfigure_ip }}\s' line: "{{ sap_general_preconfigure_ip }} {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }} {{ sap_general_preconfigure_hostname }}{{ __sap_general_preconfigure_register_sap_hostname_aliases.stdout }}" - backup: yes + backup: true when: - not ansible_check_mode - sap_general_preconfigure_domain | length > 0 diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-firewall.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-firewall.yml index 643b3968..3f31c1ff 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-firewall.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-firewall.yml @@ -5,5 +5,5 @@ ansible.builtin.systemd: name: firewalld state: stopped - enabled: no + enabled: false when: "'firewalld' in ansible_facts.packages" diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml index f498cdce..44989960 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml @@ -4,7 +4,7 @@ - name: Set kernel parameters ansible.builtin.lineinfile: path: "{{ sap_general_preconfigure_etc_sysctl_sap_conf }}" - create: yes + create: true mode: '0644' regexp: ^{{ line_item.name }}.* line: "{{ line_item.name }}={{ line_item.value }}" diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-selinux.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-selinux.yml index d39c1883..595a4067 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-selinux.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-selinux.yml @@ -54,7 +54,7 @@ - name: SELinux - Examine grub entries ansible.builtin.shell: set -o pipefail && grubby --info=ALL | awk 'BEGIN{a=0;b=0}/^args/{a++}/selinux=0/{b++}END{print a, b}' register: __sap_general_preconfigure_register_grubby_info_all_selinux - check_mode: no + check_mode: false changed_when: false - name: Disable SELinux on the kernel command line, RHEL 8 and RHEL 9 @@ -70,7 +70,7 @@ - name: Disable SELinux also on the kernel command line, RHEL 8 and RHEL 9 ansible.builtin.command: grubby --args="selinux=0" --update-kernel=ALL notify: __sap_general_preconfigure_reboot_handler - changed_when: yes + changed_when: true # Reason for noqa: We need to notify a handler in another role, which is not possible from a handler in the current role - name: SELinux, disable on the kernel command line - Set the flag that reboot is needed to apply changes # noqa no-handler @@ -89,7 +89,7 @@ - name: Make sure SELinux is not disabled on the kernel command line, RHEL 8 and RHEL 9 ansible.builtin.command: grubby --remove-args="selinux" --update-kernel=ALL notify: __sap_general_preconfigure_reboot_handler - changed_when: yes + changed_when: true # Reason for noqa: We need to notify a handler in another role, which is not possible from a handler in the current role - name: SELinux, enable on the kernel command line - Set the flag that reboot is needed to apply changes # noqa no-handler diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-systemd-tmpfiles.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-systemd-tmpfiles.yml index 750d1e96..4d12fa3b 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-systemd-tmpfiles.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-systemd-tmpfiles.yml @@ -8,7 +8,7 @@ owner: root group: root mode: '0644' - backup: yes + backup: true when: ansible_distribution_major_version != '9' - name: Copy file /etc/tmpfiles.d/sap.conf, RHEL 9 @@ -18,5 +18,5 @@ owner: root group: root mode: '0644' - backup: yes + backup: true when: ansible_distribution_major_version == '9' diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-tmpfs.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-tmpfs.yml index 1f7197b1..78fa3d26 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-tmpfs.yml @@ -14,9 +14,9 @@ - name: Get the current size of /dev/shm ansible.builtin.shell: df -hl /dev/shm | awk '/\/dev\/shm/&&/tmpfs/{gsub ("G", ""); print $2}' register: __sap_general_preconfigure_register_df_shm - ignore_errors: yes - changed_when: no - check_mode: no + ignore_errors: true + changed_when: false + check_mode: false - name: Trigger remounting if /dev/shm has not the expected size ansible.builtin.command: /bin/true diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-uuidd.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-uuidd.yml index 4e3e6cf7..8e145017 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-uuidd.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-uuidd.yml @@ -4,11 +4,11 @@ - name: Enable and start service uuidd ansible.builtin.systemd: name: uuidd - enabled: yes + enabled: true state: started - name: Enable and start service uuidd.socket ansible.builtin.systemd: name: uuidd.socket - enabled: yes + enabled: true state: started diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nofile-limits.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nofile-limits.yml index 350d6405..c83e1652 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nofile-limits.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nofile-limits.yml @@ -8,7 +8,7 @@ for group 'sapsys' # noqa no-tabs ansible.builtin.lineinfile: path: /etc/security/limits.d/99-sap.conf - create: yes + create: true mode: "0644" regexp: '^@sapsys\s+{{ line_item }}\s+nofile\s.*' line: "@sapsys\t{{ line_item }}\tnofile\t1048576" @@ -25,7 +25,7 @@ for group '{{ sap_general_preconfigure_db_group_name }}' # noqa no-tabs ansible.builtin.lineinfile: path: /etc/security/limits.d/99-sap.conf - create: yes + create: true mode: "0644" regexp: '^@{{ sap_general_preconfigure_db_group_name }}\s+{{ line_item }}\s+nofile\s.*' line: "@{{ sap_general_preconfigure_db_group_name }}\t{{ line_item }}\tnofile\t1048576" diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nproc-limits.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nproc-limits.yml index fa62cd8c..85ec1e90 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nproc-limits.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nproc-limits.yml @@ -8,7 +8,7 @@ for group 'sapsys' # noqa no-tabs ansible.builtin.lineinfile: path: /etc/security/limits.d/99-sap.conf - create: yes + create: true mode: "0644" regexp: '^@sapsys\s+{{ line_item }}\s+nproc\s.*' line: "@sapsys\t{{ line_item }}\tnproc\tunlimited" @@ -25,7 +25,7 @@ for group '{{ sap_general_preconfigure_db_group_name }}' # noqa no-tabs ansible.builtin.lineinfile: path: /etc/security/limits.d/99-sap.conf - create: yes + create: true mode: "0644" regexp: '^@{{ sap_general_preconfigure_db_group_name }}\s+{{ line_item }}\s+nproc\s.*' line: "@{{ sap_general_preconfigure_db_group_name }}\t{{ line_item }}\tnproc\tunlimited" diff --git a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml index 73bc2f49..2e39f2fe 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml @@ -208,9 +208,9 @@ with_list: "{{ __sap_general_preconfigure_min_pkgs }}" loop_control: loop_var: pkg - check_mode: no + check_mode: false register: __sap_general_preconfigure_register_minpkglist - changed_when: no + changed_when: false - name: Display the content of the minimum package list variable ansible.builtin.debug: diff --git a/roles/sap_general_preconfigure/tasks/SLES/assert-installation.yml b/roles/sap_general_preconfigure/tasks/SLES/assert-installation.yml index ecf4468e..6aa78761 100644 --- a/roles/sap_general_preconfigure/tasks/SLES/assert-installation.yml +++ b/roles/sap_general_preconfigure/tasks/SLES/assert-installation.yml @@ -58,9 +58,9 @@ with_list: "{{ __sap_general_preconfigure_min_pkgs }}" loop_control: loop_var: pkg - check_mode: no + check_mode: false register: __sap_general_preconfigure_register_minpkglist_assert - changed_when: no + changed_when: false - name: Assert that minimum required package versions are installed # If the output includes the string "is already installed" (case 2b), we have a PASS. Otherwise, it's a FAIL. @@ -72,12 +72,12 @@ loop_control: loop_var: line_item label: "" - ignore_errors: yes + ignore_errors: true - name: Report if no minimum required package version is defined for this RHEL release ansible.builtin.debug: msg: "INFO: No minimum required package version defined (variable __sap_general_preconfigure_min_pkgs)." - ignore_errors: yes + ignore_errors: true when: not __sap_general_preconfigure_min_pkgs | d([]) # Reason for noqa: The yum module appears to not support the check-update option @@ -99,7 +99,7 @@ - name: Report if checking for possible package updates is not requested ansible.builtin.debug: msg: "INFO: Not checking for possible package updates (variable sap_general_preconfigure_update)." - ignore_errors: yes + ignore_errors: true when: not sap_general_preconfigure_update - name: "Assert - Set needs-restarting command in case of RHEL 7" diff --git a/roles/sap_general_preconfigure/tasks/SLES/installation.yml b/roles/sap_general_preconfigure/tasks/SLES/installation.yml index 047d2337..4f9daed9 100644 --- a/roles/sap_general_preconfigure/tasks/SLES/installation.yml +++ b/roles/sap_general_preconfigure/tasks/SLES/installation.yml @@ -49,9 +49,9 @@ with_list: "{{ __sap_general_preconfigure_min_pkgs }}" loop_control: loop_var: pkg - check_mode: no + check_mode: false register: __sap_general_preconfigure_register_minpkglist - changed_when: no + changed_when: false - name: Display the content of the minimum package list variable ansible.builtin.debug: diff --git a/roles/sap_general_preconfigure/tasks/main.yml b/roles/sap_general_preconfigure/tasks/main.yml index 5682a761..69a8ece3 100644 --- a/roles/sap_general_preconfigure/tasks/main.yml +++ b/roles/sap_general_preconfigure/tasks/main.yml @@ -7,15 +7,39 @@ tags: - always +# Load variable files in order: +# Example for SUSE Linux Enterprise Server for SAP Applications 15 SP6: +# 1. Suse.yml - Specific to OS family. +# 2. SLES_15.yml - Specific to distribution (SLES and SLES_SAP) and major release. +# 3. SLES_15.6.yml - Specific to distribution (SLES and SLES_SAP) and minor release. +# 4. SLES_SAP_15.yml - Specific to distribution SLES_SAP and major release. +# 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. - name: Include OS specific vars, specific - ansible.builtin.include_vars: '{{ item }}' - with_first_found: - - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_version }}.yml' - - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_major_version }}.yml' - - '{{ ansible_os_family }}.yml' + ansible.builtin.include_vars: "{{ __vars_file }}" + loop: + - "{{ ansible_os_family }}.yml" + - "{{ ansible_distribution }}.yml" + # Enables loading of shared vars between SLES and SLES_SAP + - >- + {{ ansible_distribution.split("_")[0] ~ '_' ~ + ansible_distribution_major_version }}.yml + - >- + {{ ansible_distribution.split("_")[0] ~ '_' ~ + ansible_distribution_version }}.yml + + - >- + {{ ansible_distribution ~ '_' ~ + ansible_distribution_major_version }}.yml + - >- + {{ ansible_distribution ~ '_' ~ + ansible_distribution_version }}.yml + vars: + __vars_file: "{{ role_path }}/vars/{{ item }}" + when: __vars_file is file tags: - always + - name: Rename user sap_preconfigure variables if found, generic ansible.builtin.set_fact: sap_general_preconfigure_config_all: "{{ (sap_preconfigure_config_all | d(sap_general_preconfigure_config_all)) | d(true) }}" diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-assert-network-time-and-date.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-assert-network-time-and-date.yml index b23b7ca9..ba3ebe2a 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-assert-network-time-and-date.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-assert-network-time-and-date.yml @@ -11,8 +11,8 @@ - name: Get status of chronyd # noqa command-instead-of-module ansible.builtin.command: systemctl status chronyd register: __sap_general_preconfigure_register_chronyd_status_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false tags: - sap_general_preconfigure_network_time_and_date diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-configure-network-time-and-date.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-configure-network-time-and-date.yml index e796f0e4..3e92e9a6 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-configure-network-time-and-date.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-configure-network-time-and-date.yml @@ -11,6 +11,6 @@ ansible.builtin.systemd: name: chronyd state: started - enabled: yes + enabled: true tags: - sap_general_preconfigure_network_time_and_date diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-assert-network-time-and-date.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-assert-network-time-and-date.yml index 4113c99e..e87a2d45 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-assert-network-time-and-date.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-assert-network-time-and-date.yml @@ -11,8 +11,8 @@ - name: Get status of chronyd # noqa command-instead-of-module ansible.builtin.command: systemctl status chronyd register: __sap_general_preconfigure_register_chronyd_status_assert - ignore_errors: yes - changed_when: no + ignore_errors: true + changed_when: false tags: - sap_general_preconfigure_network_time_and_date diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-configure-network-time-and-date.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-configure-network-time-and-date.yml index 7bfb16d8..d369d843 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-configure-network-time-and-date.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-configure-network-time-and-date.yml @@ -11,6 +11,6 @@ ansible.builtin.systemd: name: chronyd state: started - enabled: yes + enabled: true tags: - sap_general_preconfigure_network_time_and_date diff --git a/roles/sap_general_preconfigure/vars/SLES_15.yml b/roles/sap_general_preconfigure/vars/Suse.yml similarity index 62% rename from roles/sap_general_preconfigure/vars/SLES_15.yml rename to roles/sap_general_preconfigure/vars/Suse.yml index b6b7f7bf..c1bba28a 100644 --- a/roles/sap_general_preconfigure/vars/SLES_15.yml +++ b/roles/sap_general_preconfigure/vars/Suse.yml @@ -1,5 +1,11 @@ # SPDX-License-Identifier: Apache-2.0 --- +# Variables specific to following versions: +# - SUSE Linux Enterprise Server for SAP Applications 15 +# - SUSE Linux Enterprise Server 15 +# - SUSE Linux Enterprise Server for SAP Applications 16 +# - SUSE Linux Enterprise Server 16 + __sap_general_preconfigure_sapnotes_versions: - '' @@ -9,7 +15,6 @@ __sap_general_preconfigure_packages: - psmisc - nfs-utils - bind-utils -# package hostname: needed by rhel-system-roles-sap - hostname __sap_general_preconfigure_min_pkgs: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml index 2d5c7d73..d1e876f9 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml @@ -7,19 +7,6 @@ # Following steps are similar to crmsh code in ha_cluster role, but they are # too SAP specific, so they are added here instead of there. -# Python3-pip and pexpect are required for ansible.builtin.expect -# Python installation was removed from sap_swpm role in PR#720 -- name: "SAP HA Install Pacemaker - Install required python3-pip" - ansible.builtin.package: - name: - - python3-pip - state: present - -- name: "SAP HA Install Pacemaker - Install required pip pexpect" - ansible.builtin.pip: - name: - - pexpect - - name: Block to ensure that changes are executed only once run_once: true # noqa: run_once[task] block: @@ -31,11 +18,8 @@ register: __sap_ha_pacemaker_cluster_cib_xml_backup - name: "SAP HA Install Pacemaker - Put cluster in maintenance mode" - ansible.builtin.expect: - command: crm configure property maintenance-mode=true - responses: - ".*is-managed.*": "n" - ".*already.*": "n" + ansible.builtin.command: + cmd: crm --force configure property maintenance-mode=true check_mode: false changed_when: true @@ -88,10 +72,7 @@ changed_when: true - name: "SAP HA Install Pacemaker - Disable maintenance mode" - ansible.builtin.expect: - command: crm configure property maintenance-mode=false - responses: - ".*is-managed.*": "n" - ".*already.*": "n" + ansible.builtin.command: + cmd: crm --force configure property maintenance-mode=false check_mode: false changed_when: true diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_java_scs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_java_scs_ers.yml index 2d5c7d73..d1e876f9 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_java_scs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_java_scs_ers.yml @@ -7,19 +7,6 @@ # Following steps are similar to crmsh code in ha_cluster role, but they are # too SAP specific, so they are added here instead of there. -# Python3-pip and pexpect are required for ansible.builtin.expect -# Python installation was removed from sap_swpm role in PR#720 -- name: "SAP HA Install Pacemaker - Install required python3-pip" - ansible.builtin.package: - name: - - python3-pip - state: present - -- name: "SAP HA Install Pacemaker - Install required pip pexpect" - ansible.builtin.pip: - name: - - pexpect - - name: Block to ensure that changes are executed only once run_once: true # noqa: run_once[task] block: @@ -31,11 +18,8 @@ register: __sap_ha_pacemaker_cluster_cib_xml_backup - name: "SAP HA Install Pacemaker - Put cluster in maintenance mode" - ansible.builtin.expect: - command: crm configure property maintenance-mode=true - responses: - ".*is-managed.*": "n" - ".*already.*": "n" + ansible.builtin.command: + cmd: crm --force configure property maintenance-mode=true check_mode: false changed_when: true @@ -88,10 +72,7 @@ changed_when: true - name: "SAP HA Install Pacemaker - Disable maintenance mode" - ansible.builtin.expect: - command: crm configure property maintenance-mode=false - responses: - ".*is-managed.*": "n" - ".*already.*": "n" + ansible.builtin.command: + cmd: crm --force configure property maintenance-mode=false check_mode: false changed_when: true diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml index 38b7e3ae..a122d2af 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml @@ -26,19 +26,32 @@ - sap_ha_pacemaker_cluster_vip_client_interface == '' -# Include vars files based on the environment. -# Respect order for potential variable precedence. +# Load variable files in order: +# Example for SUSE Linux Enterprise Server for SAP Applications 15 SP6: +# 1. Suse.yml - Specific to OS family. +# 2. SLES_15.yml - Specific to distribution (SLES and SLES_SAP) and major release. +# 3. SLES_15.6.yml - Specific to distribution (SLES and SLES_SAP) and minor release. +# 4. SLES_SAP_15.yml - Specific to distribution SLES_SAP and major release. +# 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. - name: "SAP HA Prepare Pacemaker - Include environment specific variables" when: __sap_ha_pacemaker_cluster_vars_file is file ansible.builtin.include_vars: "{{ __sap_ha_pacemaker_cluster_vars_file }}" loop: - - "{{ ansible_os_family | lower }}.yml" - - "{{ ansible_distribution | lower }}.yml" + - "{{ ansible_os_family }}.yml" + - "{{ ansible_distribution }}.yml" + # Enables loading of shared vars between SLES and SLES_SAP - >- - {{ ansible_distribution | lower ~ '_' ~ + {{ ansible_distribution.split("_")[0] ~ '_' ~ ansible_distribution_major_version }}.yml - >- - {{ ansible_distribution | lower ~ '_' ~ + {{ ansible_distribution.split("_")[0] ~ '_' ~ + ansible_distribution_version }}.yml + + - >- + {{ ansible_distribution ~ '_' ~ + ansible_distribution_major_version }}.yml + - >- + {{ ansible_distribution ~ '_' ~ ansible_distribution_version }}.yml vars: __sap_ha_pacemaker_cluster_vars_file: "{{ role_path }}/vars/{{ item }}" diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/RedHat.yml similarity index 100% rename from roles/sap_ha_pacemaker_cluster/vars/redhat.yml rename to roles/sap_ha_pacemaker_cluster/vars/RedHat.yml diff --git a/roles/sap_ha_pacemaker_cluster/vars/SLES_15.yml b/roles/sap_ha_pacemaker_cluster/vars/SLES_15.yml new file mode 100644 index 00000000..e97f264f --- /dev/null +++ b/roles/sap_ha_pacemaker_cluster/vars/SLES_15.yml @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: Apache-2.0 +--- +# Variables specific to following versions: +# - SUSE Linux Enterprise Server for SAP Applications 15 +# - SUSE Linux Enterprise Server 15 + +__sap_ha_pacemaker_cluster_sap_extra_packages_dict: + minimal: + # Pattern contains all required cluster packages + - patterns-ha-ha_sles + - ClusterTools2 + hana_scaleout: + - SAPHanaSR-ScaleOut + hana_scaleup: + - SAPHanaSR + hana_angi: + - SAPHanaSR-angi + nwas: + - sap-suse-cluster-connector + - sapstartsrv-resource-agents diff --git a/roles/sap_ha_pacemaker_cluster/vars/suse.yml b/roles/sap_ha_pacemaker_cluster/vars/Suse.yml similarity index 98% rename from roles/sap_ha_pacemaker_cluster/vars/suse.yml rename to roles/sap_ha_pacemaker_cluster/vars/Suse.yml index e8fe64ee..8e8d5f79 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/suse.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/Suse.yml @@ -52,8 +52,9 @@ __sap_ha_pacemaker_cluster_platform_extra_packages_dict: # Dictionary with additional cluster packages for specific scenarios __sap_ha_pacemaker_cluster_sap_extra_packages_dict: minimal: + # Pattern contains all required cluster packages + - patterns-ha-ha_sles - ClusterTools2 - - resource-agents hana_scaleout: - SAPHanaSR-ScaleOut hana_scaleup: diff --git a/roles/sap_hana_install/defaults/main.yml b/roles/sap_hana_install/defaults/main.yml index 6d4f47d3..6971068c 100644 --- a/roles/sap_hana_install/defaults/main.yml +++ b/roles/sap_hana_install/defaults/main.yml @@ -30,19 +30,23 @@ sap_hana_install_copy_sarfiles: false # removed after extraction. sap_hana_install_keep_copied_sarfiles: false +# (RedHat specific) fapolicyd package is present on RedHat systems # For installing SAP HANA with fapolicyd support, set the following variable to `true`: sap_hana_install_use_fapolicyd: false +# (RedHat specific) fapolicyd package is present on RedHat systems # When using fapolicyd, you can set the following variable to one of `none`, `size`, `sha256`, or `ima`. Note that before setting # to `ima`, it is essential to prepare the system accordingly (e.g. boot with a different kernel parameter). See the # RHEL 9 Managing, monitoring, and updating the kernel guide for more information on this topic. sap_hana_install_fapolicyd_integrity: 'sha256' +# (RedHat specific) fapolicyd package is present on RedHat systems # When using fapolicyd, the following variable is used to define the fapolicyd rule file in which the rules for # protecting shell scripts are stored. The rule file will be created in the directory '/etc/fapolicyd/rules.d'. # Note: The mandatory file ending '.rules' will be added in the corresponding task of this role. sap_hana_install_fapolicyd_rule_file: '71-sap-shellscripts' +# (RedHat specific) fapolicyd package is present on RedHat systems # When using fapolicyd, modify the following variable to change or add the directories which contain SAP HANA executables: sap_hana_install_fapolicyd_trusted_directories: - "{{ sap_hana_install_root_path }}" @@ -50,11 +54,11 @@ sap_hana_install_fapolicyd_trusted_directories: # File name of SAPCAR*EXE in the software directory. If the variable is not set and there is more than one SAPCAR executable # in the software directory, the latest SAPCAR executable for the CPU architecture will be selected automatically. -#sap_hana_install_sapcar_filename: SAPCAR_1115-70006178.EXE +# sap_hana_install_sapcar_filename: SAPCAR_1115-70006178.EXE # List of file names of SAR files to extract. Can be set in case there are more SAR files in the software directory # than needed or desired for the HANA installation. -#sap_hana_install_sarfiles: +# sap_hana_install_sarfiles: # - SAPHOSTAGENT54_54-80004822.SAR # - IMDB_SERVER20_060_0-80002031.SAR @@ -67,7 +71,7 @@ sap_hana_install_verify_checksums: false sap_hana_install_checksum_algorithm: sha256 # In case a global checksum file is present, use the following variable to specify the full path to this file: -#sap_hana_install_global_checksum_file: "{{ sap_hana_install_software_directory }}/SHA256" +# sap_hana_install_global_checksum_file: "{{ sap_hana_install_software_directory }}/SHA256" # Set the following variable to `true` to let hdbclm verify SAR file signatures. This corresponds to the hdblcm command line # argument `--verify_signature`. @@ -126,8 +130,8 @@ sap_hana_install_modify_selinux_labels: true sap_hana_install_components: 'all' # Pass some extra arguments to hdblcm, see some examples below. -#sap_hana_install_hdblcm_extraargs: '--verify_signature' -#sap_hana_install_hdblcm_extraargs: '--ignore=check_diskspace,check_min_mem' +# sap_hana_install_hdblcm_extraargs: '--verify_signature' +# sap_hana_install_hdblcm_extraargs: '--ignore=check_diskspace,check_min_mem' # Instance details sap_hana_install_sid: @@ -154,15 +158,15 @@ sap_hana_install_groupid: # Setting master password to 'y' will use that master password for all passwords - recommended sap_hana_install_use_master_password: 'y' # Set one or more of the following password variables in your playbook or inventory. -#sap_hana_install_master_password: -#sap_hana_install_sidadm_password: -#sap_hana_install_db_system_password: -#sap_hana_install_lss_user_password: -#sap_hana_install_lss_backup_password: -#sap_hana_install_ase_user_password: -#sap_hana_install_root_password: -#sap_hana_install_sapadm_password: -#sap_hana_install_xs_org_password: +# sap_hana_install_master_password: +# sap_hana_install_sidadm_password: +# sap_hana_install_db_system_password: +# sap_hana_install_lss_user_password: +# sap_hana_install_lss_backup_password: +# sap_hana_install_ase_user_password: +# sap_hana_install_root_password: +# sap_hana_install_sapadm_password: +# sap_hana_install_xs_org_password: # Optional steps sap_hana_install_update_firewall: false @@ -191,7 +195,7 @@ sap_hana_install_firewall: state: 'enabled' } # The following variable is no longer used. Setting /etc/hosts entries is done in role sap_general_preconfigure. -#sap_hana_install_update_etchosts: true +# sap_hana_install_update_etchosts: true # Post install parameters sap_hana_install_hdbuserstore_key: 'HDB_SYSTEMDB' @@ -199,8 +203,8 @@ sap_hana_install_nw_input_location: '/tmp' # License sap_hana_install_apply_license: false -#sap_hana_install_license_path: -#sap_hana_install_license_file_name: +# sap_hana_install_license_path: +# sap_hana_install_license_file_name: # Misc @@ -220,13 +224,13 @@ sap_hana_install_create_initial_tenant: 'y' # If unset or set to 'normal', the role will leave the log_mode to 'normal', which is required for SAP HANA # System Replication. The log_mode 'overwrite' is useful for limiting cost or capacity if System Replication # is not used. -#sap_hana_install_log_mode: 'overwrite' +# sap_hana_install_log_mode: 'overwrite' # If the following variable is specified, the role will perform a scaleout installation or it will add additional # hosts to an existing HANA system. # Corresponding hdblcm parameter: addhosts # Example: -#sap_hana_install_addhosts: 'host2:role=worker,host3:role=worker:group=g02,host4:role=standby:group=g02' +# sap_hana_install_addhosts: 'host2:role=worker,host3:role=worker:group=g02,host4:role=standby:group=g02' # The hostname is set by 'hdblcm --dump_configfile_template' during the preinstall phase but can also # be set to a different value in your playbook or hostvars: diff --git a/roles/sap_hana_install/tasks/post_install.yml b/roles/sap_hana_install/tasks/post_install.yml index c276775b..b774b371 100644 --- a/roles/sap_hana_install/tasks/post_install.yml +++ b/roles/sap_hana_install/tasks/post_install.yml @@ -33,7 +33,7 @@ # Optional Post Install Tasks # not needed because already done in sap_general_preconfigure -#- name: SAP HANA Post Install - Update /etc/hosts +# - name: SAP HANA Post Install - Update /etc/hosts # ansible.builtin.include_tasks: post_install/update_etchosts.yml # when: # - "sap_hana_install_update_etchosts | bool" @@ -70,11 +70,13 @@ !/^ /&&/^\n")} /^ /{split ($0, b, "[\*\*\*]"); gsub (">", ""); split ($0, a, "<"); printf ("%s\{\{ sap_hana_install_%s | d(sap_hana_install_master_password) \}\}%s\n", b[1], a[2], b[4])}' {{ sap_hana_install_configfile_directory }}/{{ sap_hana_install_configfile_template_prefix }}.cfg.xml > {{ sap_hana_install_configfile_directory }}/{{ sap_hana_install_configfile_template_prefix }}.xml.j2 register: __sap_hana_install_create_jinja2_template - changed_when: no + changed_when: false - name: SAP HANA hdblcm installation check - Display the location of the remote Jinja2 template ansible.builtin.debug: - msg: "The Jinja2 template for creating the hdblcm configfile xml has been saved to '{{ sap_hana_install_configfile_directory }}/{{ sap_hana_install_configfile_template_prefix }}.xml.j2'." + msg: | + The Jinja2 template for creating the hdblcm configfile xml has been saved to + '{{ sap_hana_install_configfile_directory }}/{{ sap_hana_install_configfile_template_prefix }}.xml.j2'. - name: SAP HANA hdblcm installation check - Download the Jinja2 template ansible.builtin.fetch: @@ -155,7 +157,7 @@ args: chdir: "{{ sap_hana_install_shared_path }}/{{ sap_hana_install_sid }}/hdblcm" register: __sap_hana_install_register_install_result - changed_when: no + changed_when: false when: not ansible_check_mode - name: Configure '/usr/sap' SELinux file contexts @@ -205,7 +207,7 @@ # - ' FQDN - {{ ansible_fqdn }}' when: not ansible_check_mode -- name: SAP HANA Post Install, fapolicyd - Update config for desired integrity level and backout if validation fails +- name: SAP HANA Post Install, fapolicyd - Update config for desired integrity level and revert if validation fails when: - sap_hana_install_use_fapolicyd - '"fapolicyd" in ansible_facts.packages' diff --git a/roles/sap_hana_install/tasks/post_install/firewall.yml b/roles/sap_hana_install/tasks/post_install/firewall.yml index aa7ede64..a213584a 100644 --- a/roles/sap_hana_install/tasks/post_install/firewall.yml +++ b/roles/sap_hana_install/tasks/post_install/firewall.yml @@ -5,7 +5,7 @@ ansible.builtin.systemd: name: firewalld state: started - enabled: yes + enabled: true tags: sap_hana_install_configure_firewall - name: SAP HANA Post Install - Construct the argument list for 'firewall-cmd --add-port' @@ -38,12 +38,12 @@ # of the no-changed-when rule, we just set changed_when to true here. - name: SAP HANA Post Install - Enable the required ports immediately ansible.builtin.command: "{{ __sap_hana_install_fact_firewall_cmd_command }}" - changed_when: yes + changed_when: true tags: sap_hana_install_configure_firewall - name: SAP HANA Post Install - Get the current firewall configuration of the default zone ansible.builtin.command: firewall-cmd --list-all - changed_when: no + changed_when: false register: __sap_hana_install_register_current_firewall_ports tags: sap_hana_install_configure_firewall @@ -57,12 +57,12 @@ # of the no-changed-when rule, we just set changed_when to true here. - name: SAP HANA Post Install - Enable the required ports permanently ansible.builtin.command: "{{ __sap_hana_install_fact_firewall_cmd_command }} --permanent" - changed_when: yes + changed_when: true tags: sap_hana_install_configure_firewall - name: SAP HANA Post Install - Get the permanent firewall configuration of the default zone ansible.builtin.command: firewall-cmd --list-all - changed_when: no + changed_when: false register: __sap_hana_install_register_permanent_firewall_ports tags: sap_hana_install_configure_firewall diff --git a/roles/sap_hana_install/tasks/post_install/update_firewall.yml b/roles/sap_hana_install/tasks/post_install/update_firewall.yml index a00d8304..d5fca3fe 100644 --- a/roles/sap_hana_install/tasks/post_install/update_firewall.yml +++ b/roles/sap_hana_install/tasks/post_install/update_firewall.yml @@ -6,6 +6,6 @@ ansible.posix.firewalld: zone: public port: "{{ passed_port }}/tcp" - permanent: yes - immediate: yes + permanent: true + immediate: true state: enabled diff --git a/roles/sap_hana_install/tasks/pre_install.yml b/roles/sap_hana_install/tasks/pre_install.yml index 22fef615..d0c57602 100644 --- a/roles/sap_hana_install/tasks/pre_install.yml +++ b/roles/sap_hana_install/tasks/pre_install.yml @@ -4,16 +4,16 @@ # Password Facts ################ -#- name: SAP HANA Pre Install - Set password facts when using master password -# ansible.builtin.set_fact: -# sap_hana_install_sapadm_password: "{{ sap_hana_install_master_password }}" -# sap_hana_install_sidadm_password: "{{ sap_hana_install_master_password }}" -# sap_hana_install_db_system_password: "{{ sap_hana_install_master_password }}" -# sap_hana_install_ase_user_password: "{{ sap_hana_install_master_password }}" -# sap_hana_install_xs_org_password: "{{ sap_hana_install_master_password }}" -# sap_hana_install_lss_user_password: "{{ sap_hana_install_master_password }}" -# sap_hana_install_lss_backup_password: "{{ sap_hana_install_master_password }}" -# when: sap_hana_install_use_master_password == 'y' +# - name: SAP HANA Pre Install - Set password facts when using master password +# ansible.builtin.set_fact: +# sap_hana_install_sapadm_password: "{{ sap_hana_install_master_password }}" +# sap_hana_install_sidadm_password: "{{ sap_hana_install_master_password }}" +# sap_hana_install_db_system_password: "{{ sap_hana_install_master_password }}" +# sap_hana_install_ase_user_password: "{{ sap_hana_install_master_password }}" +# sap_hana_install_xs_org_password: "{{ sap_hana_install_master_password }}" +# sap_hana_install_lss_user_password: "{{ sap_hana_install_master_password }}" +# sap_hana_install_lss_backup_password: "{{ sap_hana_install_master_password }}" +# when: sap_hana_install_use_master_password == 'y' ################ # Handle fapolicyd @@ -23,7 +23,10 @@ ansible.builtin.package: name: fapolicyd state: present - when: sap_hana_install_use_fapolicyd + when: + - sap_hana_install_use_fapolicyd + # Ensure fapolicyd is installed only on supported systems. + - ansible_os_family == 'RedHat' tags: sap_hana_install_use_fapolicyd ################ @@ -59,9 +62,9 @@ - name: SAP HANA Pre Install - Check availability of software directory '{{ __sap_hana_install_fact_software_directory }}' ansible.builtin.stat: path: "{{ __sap_hana_install_fact_software_directory }}" - check_mode: no + check_mode: false register: __sap_hana_install_register_stat_software_directory - failed_when: no + failed_when: false - name: SAP HANA Pre Install - Assert that the software directory exists ansible.builtin.assert: @@ -69,7 +72,9 @@ fail_msg: "FAIL: The software directory '{{ __sap_hana_install_fact_software_directory }}' does not exist!" success_msg: "PASS: The software directory '{{ __sap_hana_install_fact_software_directory }}' exist." - - name: SAP HANA Pre Install - Assert directory permissions in case `sap_hana_install_software_extract_directory` is below `sap_hana_install_software_extract_directory` + - name: > + SAP HANA Pre Install - Assert directory permissions in case `sap_hana_install_software_extract_directory` + is below `sap_hana_install_software_extract_directory` when: sap_hana_install_software_extract_directory is search(sap_hana_install_software_directory) block: @@ -135,15 +140,15 @@ - name: SAP HANA Pre Install - Get info about software extract directory '{{ sap_hana_install_software_extract_directory }}' ansible.builtin.stat: path: "{{ sap_hana_install_software_extract_directory }}" - check_mode: no + check_mode: false register: __sap_hana_install_register_stat_software_extract_directory - failed_when: no + failed_when: false - name: SAP HANA Pre Install - Change ownership of software extract directory '{{ sap_hana_install_software_extract_directory }}' ansible.builtin.file: path: "{{ sap_hana_install_software_extract_directory }}" state: directory - recurse: yes + recurse: true mode: '0755' owner: root group: root @@ -154,12 +159,12 @@ ansible.builtin.wait_for: path: "{{ sap_hana_install_software_extract_directory }}/__EXTRACTION_ONGOING__" state: absent - failed_when: no + failed_when: false - name: SAP HANA Pre Install - Find directory 'SAP_HANA_DATABASE' if '{{ sap_hana_install_software_extract_directory }}' exists ansible.builtin.find: paths: "{{ sap_hana_install_software_extract_directory }}" - recurse: yes + recurse: true file_type: directory patterns: 'SAP_HANA_DATABASE' register: __sap_hana_install_register_find_directory_sap_hana_database_initial @@ -178,9 +183,9 @@ - name: SAP HANA Pre Install - Get info about '{{ __sap_hana_install_fact_hdblcm_path }}/hdblcm' if found initially ansible.builtin.stat: path: "{{ __sap_hana_install_fact_hdblcm_path + '/hdblcm' }}" - check_mode: no + check_mode: false register: __sap_hana_install_register_stat_hdblcm_initial - failed_when: no + failed_when: false - name: SAP HANA Pre Install - Assert that file 'hdblcm' is available if found initially ansible.builtin.assert: @@ -207,9 +212,9 @@ - name: SAP HANA Pre Install - Get info about '{{ __sap_hana_install_fact_hdblcm_path }}/hdblcm' ansible.builtin.stat: path: "{{ __sap_hana_install_fact_hdblcm_path + '/hdblcm' }}" - check_mode: no + check_mode: false register: __sap_hana_install_register_stat_hdblcm - failed_when: no + failed_when: false - name: SAP HANA Pre Install - Assert that file 'hdblcm' is available ansible.builtin.assert: @@ -227,7 +232,7 @@ - name: SAP HANA Pre Install - Find directory 'SAP_HANA_DATABASE' in '{{ sap_hana_install_software_extract_directory }}' ansible.builtin.find: paths: "{{ sap_hana_install_software_extract_directory }}" - recurse: yes + recurse: true file_type: directory patterns: 'SAP_HANA_DATABASE' register: __sap_hana_install_register_find_directory_sap_hana_database_addhosts diff --git a/roles/sap_hana_install/tasks/pre_install/hdblcm_prepare.yml b/roles/sap_hana_install/tasks/pre_install/hdblcm_prepare.yml index bdff8d74..b112b322 100644 --- a/roles/sap_hana_install/tasks/pre_install/hdblcm_prepare.yml +++ b/roles/sap_hana_install/tasks/pre_install/hdblcm_prepare.yml @@ -55,7 +55,7 @@ - name: SAP HANA hdblcm prepare - Find 'SAP_HANA_DATABASE' in '{{ sap_hana_install_software_extract_directory }}' ansible.builtin.find: paths: "{{ sap_hana_install_software_extract_directory }}" - recurse: yes + recurse: true file_type: directory patterns: 'SAP_HANA_DATABASE' register: __sap_hana_install_register_find_directory_sap_hana_database diff --git a/roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml b/roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml index 299e8dbb..3131e844 100644 --- a/roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml +++ b/roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml @@ -23,7 +23,7 @@ - name: SAP HANA hdblcm prepare - Find all SAR files in '{{ __sap_hana_install_fact_software_directory }}' ansible.builtin.find: paths: "{{ __sap_hana_install_fact_software_directory }}" - recurse: no + recurse: false file_type: file patterns: '*.SAR' register: __sap_hana_install_register_find_sarfiles @@ -37,7 +37,7 @@ ansible.builtin.debug: var: __sap_hana_install_fact_sarfiles -- name: Copy SAR files to final destination if 'sap_hana_install_copy_sarfiles' is 'yes' +- name: Copy SAR files to final destination if 'sap_hana_install_copy_sarfiles' is 'true' when: sap_hana_install_copy_sarfiles block: diff --git a/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml b/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml index 61b9b081..c58c7159 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 --- -- name: Takover saptune and enable +- name: Takeover saptune and enable when: __sap_hana_preconfigure_run_saptune block: - name: Ensure sapconf is stopped and disabled diff --git a/roles/sap_hana_preconfigure/tasks/main.yml b/roles/sap_hana_preconfigure/tasks/main.yml index 1708ca6a..38404abb 100644 --- a/roles/sap_hana_preconfigure/tasks/main.yml +++ b/roles/sap_hana_preconfigure/tasks/main.yml @@ -5,21 +5,36 @@ ansible.builtin.debug: var: role_path -# Load variable file starting with actual version up to OS family. +# Load variable files in order: # Example for SUSE Linux Enterprise Server for SAP Applications 15 SP6: -# 1. SLES_SAP_15.6.yml - Specific to distribution with major and minor release. -# 2. SLES_SAP_15.yml - Specific to distribution and major release regardless of minor release. -# 3. SLES_15.6.yml - Specific to distribution family (SLES and SLES4SAP) and minor release. -# 4. SLES_15.yml - Specific to distribution. -# 5. Suse.yml - Specific to OS family. -- name: Include OS specific vars - ansible.builtin.include_vars: '{{ item }}' - with_first_found: - - '{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml' - - '{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml' - - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_version }}.yml' - - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_major_version }}.yml' - - '{{ ansible_os_family }}.yml' +# 1. Suse.yml - Specific to OS family. +# 2. SLES_15.yml - Specific to distribution (SLES and SLES_SAP) and major release. +# 3. SLES_15.6.yml - Specific to distribution (SLES and SLES_SAP) and minor release. +# 4. SLES_SAP_15.yml - Specific to distribution SLES_SAP and major release. +# 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. +- name: Include OS specific vars, specific + ansible.builtin.include_vars: "{{ __vars_file }}" + loop: + - "{{ ansible_os_family }}.yml" + - "{{ ansible_distribution }}.yml" + # Enables loading of shared vars between SLES and SLES_SAP + - >- + {{ ansible_distribution.split("_")[0] ~ '_' ~ + ansible_distribution_major_version }}.yml + - >- + {{ ansible_distribution.split("_")[0] ~ '_' ~ + ansible_distribution_version }}.yml + + - >- + {{ ansible_distribution ~ '_' ~ + ansible_distribution_major_version }}.yml + - >- + {{ ansible_distribution ~ '_' ~ + ansible_distribution_version }}.yml + vars: + __vars_file: "{{ role_path }}/vars/{{ item }}" + when: __vars_file is file + - name: Set filename prefix to empty string if role is run in normal mode ansible.builtin.set_fact: diff --git a/roles/sap_netweaver_preconfigure/defaults/main.yml b/roles/sap_netweaver_preconfigure/defaults/main.yml index 0a458da5..1e735b95 100644 --- a/roles/sap_netweaver_preconfigure/defaults/main.yml +++ b/roles/sap_netweaver_preconfigure/defaults/main.yml @@ -5,7 +5,7 @@ # Perform an assertion run: sap_netweaver_preconfigure_assert: false -# In case of an assertion run, if set to "yes", the role will abort for any assertion error: +# In case of an assertion run, if set to "true", the role will abort for any assertion error: sap_netweaver_preconfigure_assert_ignore_errors: false sap_netweaver_preconfigure_min_swap_space_mb: '20480' diff --git a/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml b/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml index d5d271e2..2c1f8eac 100644 --- a/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml +++ b/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml @@ -16,7 +16,7 @@ - name: Check if required packages for Adobe Document Services are installed # noqa command-instead-of-module ansible.builtin.shell: rpm -q --qf "%{NAME}.%{ARCH}\n" {{ __sap_netweaver_preconfigure_adobe_doc_services_packages | map('quote') | join(' ') }} register: __sap_netweaver_preconfigure_register_rpm_q_ads_packages - changed_when: no + changed_when: false when: sap_netweaver_preconfigure_use_adobe_doc_services | d(false) ignore_errors: "{{ sap_netweaver_preconfigure_assert_ignore_errors | d(false) }}" diff --git a/roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml b/roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml index 7ab03d9d..d169bfe2 100644 --- a/roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml @@ -14,17 +14,19 @@ - name: Warn if not enough swap space is configured ansible.builtin.fail: - msg: "The system has only {{ ansible_swaptotal_mb }} MB of swap space configured, - which is less than the minimum required amount of {{ sap_netweaver_preconfigure_min_swap_space_mb }} MB for SAP NetWeaver!" - ignore_errors: yes + msg: | + The system has only {{ ansible_swaptotal_mb }} MB of swap space configured, + which is less than the minimum required amount of {{ sap_netweaver_preconfigure_min_swap_space_mb }} MB for SAP NetWeaver! + ignore_errors: true when: - ansible_swaptotal_mb < sap_netweaver_preconfigure_min_swap_space_mb|int - not sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured|d(true) - name: Fail if not enough swap space is configured ansible.builtin.fail: - msg: "The system has only {{ ansible_swaptotal_mb }} MB of swap space configured, - which is less than the minimum required amount of {{ sap_netweaver_preconfigure_min_swap_space_mb }} MB for SAP NetWeaver!" + msg: | + The system has only {{ ansible_swaptotal_mb }} MB of swap space configured, + which is less than the minimum required amount of {{ sap_netweaver_preconfigure_min_swap_space_mb }} MB for SAP NetWeaver! when: - ansible_swaptotal_mb < sap_netweaver_preconfigure_min_swap_space_mb|int - sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured|d(true) diff --git a/roles/sap_netweaver_preconfigure/tasks/main.yml b/roles/sap_netweaver_preconfigure/tasks/main.yml index f0a525ab..451e1c52 100644 --- a/roles/sap_netweaver_preconfigure/tasks/main.yml +++ b/roles/sap_netweaver_preconfigure/tasks/main.yml @@ -5,21 +5,36 @@ ansible.builtin.debug: var: role_path -# Load variable file starting with actual version up to OS family. +# Load variable files in order: # Example for SUSE Linux Enterprise Server for SAP Applications 15 SP6: -# 1. SLES_SAP_15.6.yml - Specific to distribution with major and minor release. -# 2. SLES_SAP_15.yml - Specific to distribution and major release regardless of minor release. -# 3. SLES_15.6.yml - Specific to distribution family (SLES and SLES4SAP) and minor release. -# 4. SLES_15.yml - Specific to distribution. -# 5. Suse.yml - Specific to OS family. -- name: Include OS specific vars - ansible.builtin.include_vars: '{{ item }}' - with_first_found: - - '{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml' - - '{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml' - - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_version }}.yml' - - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_major_version }}.yml' - - '{{ ansible_os_family }}.yml' +# 1. Suse.yml - Specific to OS family. +# 2. SLES_15.yml - Specific to distribution (SLES and SLES_SAP) and major release. +# 3. SLES_15.6.yml - Specific to distribution (SLES and SLES_SAP) and minor release. +# 4. SLES_SAP_15.yml - Specific to distribution SLES_SAP and major release. +# 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. +- name: Include OS specific vars, specific + ansible.builtin.include_vars: "{{ __vars_file }}" + loop: + - "{{ ansible_os_family }}.yml" + - "{{ ansible_distribution }}.yml" + # Enables loading of shared vars between SLES and SLES_SAP + - >- + {{ ansible_distribution.split("_")[0] ~ '_' ~ + ansible_distribution_major_version }}.yml + - >- + {{ ansible_distribution.split("_")[0] ~ '_' ~ + ansible_distribution_version }}.yml + + - >- + {{ ansible_distribution ~ '_' ~ + ansible_distribution_major_version }}.yml + - >- + {{ ansible_distribution ~ '_' ~ + ansible_distribution_version }}.yml + vars: + __vars_file: "{{ role_path }}/vars/{{ item }}" + when: __vars_file is file + - name: Set filename prefix to empty string if role is run in normal mode ansible.builtin.set_fact: diff --git a/roles/sap_netweaver_preconfigure/vars/SLES_15.6.yml b/roles/sap_netweaver_preconfigure/vars/SLES_15.6.yml index 34ad9619..42032de7 100644 --- a/roles/sap_netweaver_preconfigure/vars/SLES_15.6.yml +++ b/roles/sap_netweaver_preconfigure/vars/SLES_15.6.yml @@ -8,28 +8,35 @@ __sap_netweaver_preconfigure_sapnotes: - "1275776" __sap_netweaver_preconfigure_packages: + # Mandatory packages + - tcsh + - acl + - insserv-compat + - system-user-uuidd + - uuidd + # gcc packages - libstdc++6 - libatomic1 - libgcc_s1 - libltdl7 - - insserv-compat + # System monitoring + - sysstat - cpupower - - hicolor-icon-theme - - libcpupower1 # libcpupower0 was removed in SP6 + - libcpupower1 - libsensors4 + # Patterns - patterns-base-basesystem - patterns-server-enterprise-sap_server - patterns-yast-yast2_basis + # Additional packages - procmail - - sysstat - - system-user-uuidd - - uuidd + # Not needed but kept for compatibility + - hicolor-icon-theme - yast2-auth-client - yast2-auth-server - yast2-theme - yast2-vpn - - tcsh - - acl + # SLES_SAP is using saptune, but SLES is using sapconf. # Default value true runs saptune, but installation.yml auto-detects base product and adjusts. diff --git a/roles/sap_netweaver_preconfigure/vars/SLES_15.yml b/roles/sap_netweaver_preconfigure/vars/SLES_15.yml index b6f0bacc..cc632e33 100644 --- a/roles/sap_netweaver_preconfigure/vars/SLES_15.yml +++ b/roles/sap_netweaver_preconfigure/vars/SLES_15.yml @@ -8,28 +8,34 @@ __sap_netweaver_preconfigure_sapnotes: - "1275776" __sap_netweaver_preconfigure_packages: + # Mandatory packages + - tcsh + - acl + - insserv-compat + - system-user-uuidd + - uuidd + # gcc packages - libstdc++6 - libatomic1 - libgcc_s1 - libltdl7 - - insserv-compat + # System monitoring + - sysstat - cpupower - - hicolor-icon-theme - libcpupower0 - libsensors4 + # Patterns - patterns-base-basesystem - patterns-server-enterprise-sap_server - patterns-yast-yast2_basis + # Additional packages - procmail - - sysstat - - system-user-uuidd - - uuidd + # Not needed but kept for compatibility + - hicolor-icon-theme - yast2-auth-client - yast2-auth-server - yast2-theme - yast2-vpn - - tcsh - - acl # SLES_SAP is using saptune, but SLES is using sapconf. # Default value true runs saptune, but installation.yml auto-detects base product and adjusts. From a3fc8dc3f43468d296b808a428eb92d9f07609db Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Mon, 9 Dec 2024 13:34:19 +0100 Subject: [PATCH 11/13] fix: add omit for duplicate var combinations --- roles/sap_general_preconfigure/tasks/main.yml | 25 ++++++--------- .../tasks/include_vars_common.yml | 31 ++++++++----------- roles/sap_hana_preconfigure/tasks/main.yml | 25 ++++++--------- .../defaults/main.yml | 2 +- .../sap_netweaver_preconfigure/tasks/main.yml | 27 +++++++--------- 5 files changed, 46 insertions(+), 64 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/main.yml b/roles/sap_general_preconfigure/tasks/main.yml index 69a8ece3..3a6fcb94 100644 --- a/roles/sap_general_preconfigure/tasks/main.yml +++ b/roles/sap_general_preconfigure/tasks/main.yml @@ -18,23 +18,18 @@ ansible.builtin.include_vars: "{{ __vars_file }}" loop: - "{{ ansible_os_family }}.yml" - - "{{ ansible_distribution }}.yml" - # Enables loading of shared vars between SLES and SLES_SAP - - >- - {{ ansible_distribution.split("_")[0] ~ '_' ~ - ansible_distribution_major_version }}.yml - - >- - {{ ansible_distribution.split("_")[0] ~ '_' ~ - ansible_distribution_version }}.yml - - - >- - {{ ansible_distribution ~ '_' ~ - ansible_distribution_major_version }}.yml - - >- - {{ ansible_distribution ~ '_' ~ - ansible_distribution_version }}.yml + - "{{ ansible_distribution ~ '.yml' if ansible_distribution != ansible_os_family else omit }}" + - "{{ __distribution_major_split ~ '.yml' if __distribution_major_split != __distribution_major else omit }}" + - "{{ __distribution_minor_split ~ '.yml' if __distribution_minor_split != __distribution_minor else omit }}" + - "{{ __distribution_major }}.yml" + - "{{ __distribution_minor }}.yml" vars: __vars_file: "{{ role_path }}/vars/{{ item }}" + __distribution_major: "{{ ansible_distribution ~ '_' ~ ansible_distribution_major_version }}" + __distribution_minor: "{{ ansible_distribution ~ '_' ~ ansible_distribution_version }}" + # Enables loading of shared vars between SLES and SLES_SAP + __distribution_major_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_major_version }}" + __distribution_minor_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_version }}" when: __vars_file is file tags: - always diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml index a122d2af..172022f2 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml @@ -34,24 +34,19 @@ # 4. SLES_SAP_15.yml - Specific to distribution SLES_SAP and major release. # 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. - name: "SAP HA Prepare Pacemaker - Include environment specific variables" - when: __sap_ha_pacemaker_cluster_vars_file is file - ansible.builtin.include_vars: "{{ __sap_ha_pacemaker_cluster_vars_file }}" + ansible.builtin.include_vars: "{{ __vars_file }}" loop: - "{{ ansible_os_family }}.yml" - - "{{ ansible_distribution }}.yml" - # Enables loading of shared vars between SLES and SLES_SAP - - >- - {{ ansible_distribution.split("_")[0] ~ '_' ~ - ansible_distribution_major_version }}.yml - - >- - {{ ansible_distribution.split("_")[0] ~ '_' ~ - ansible_distribution_version }}.yml - - - >- - {{ ansible_distribution ~ '_' ~ - ansible_distribution_major_version }}.yml - - >- - {{ ansible_distribution ~ '_' ~ - ansible_distribution_version }}.yml + - "{{ ansible_distribution ~ '.yml' if ansible_distribution != ansible_os_family else omit }}" + - "{{ __distribution_major_split ~ '.yml' if __distribution_major_split != __distribution_major else omit }}" + - "{{ __distribution_minor_split ~ '.yml' if __distribution_minor_split != __distribution_minor else omit }}" + - "{{ __distribution_major }}.yml" + - "{{ __distribution_minor }}.yml" vars: - __sap_ha_pacemaker_cluster_vars_file: "{{ role_path }}/vars/{{ item }}" + __vars_file: "{{ role_path }}/vars/{{ item }}" + __distribution_major: "{{ ansible_distribution ~ '_' ~ ansible_distribution_major_version }}" + __distribution_minor: "{{ ansible_distribution ~ '_' ~ ansible_distribution_version }}" + # Enables loading of shared vars between SLES and SLES_SAP + __distribution_major_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_major_version }}" + __distribution_minor_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_version }}" + when: __vars_file is file diff --git a/roles/sap_hana_preconfigure/tasks/main.yml b/roles/sap_hana_preconfigure/tasks/main.yml index 38404abb..07bae981 100644 --- a/roles/sap_hana_preconfigure/tasks/main.yml +++ b/roles/sap_hana_preconfigure/tasks/main.yml @@ -16,23 +16,18 @@ ansible.builtin.include_vars: "{{ __vars_file }}" loop: - "{{ ansible_os_family }}.yml" - - "{{ ansible_distribution }}.yml" - # Enables loading of shared vars between SLES and SLES_SAP - - >- - {{ ansible_distribution.split("_")[0] ~ '_' ~ - ansible_distribution_major_version }}.yml - - >- - {{ ansible_distribution.split("_")[0] ~ '_' ~ - ansible_distribution_version }}.yml - - - >- - {{ ansible_distribution ~ '_' ~ - ansible_distribution_major_version }}.yml - - >- - {{ ansible_distribution ~ '_' ~ - ansible_distribution_version }}.yml + - "{{ ansible_distribution ~ '.yml' if ansible_distribution != ansible_os_family else omit }}" + - "{{ __distribution_major_split ~ '.yml' if __distribution_major_split != __distribution_major else omit }}" + - "{{ __distribution_minor_split ~ '.yml' if __distribution_minor_split != __distribution_minor else omit }}" + - "{{ __distribution_major }}.yml" + - "{{ __distribution_minor }}.yml" vars: __vars_file: "{{ role_path }}/vars/{{ item }}" + __distribution_major: "{{ ansible_distribution ~ '_' ~ ansible_distribution_major_version }}" + __distribution_minor: "{{ ansible_distribution ~ '_' ~ ansible_distribution_version }}" + # Enables loading of shared vars between SLES and SLES_SAP + __distribution_major_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_major_version }}" + __distribution_minor_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_version }}" when: __vars_file is file diff --git a/roles/sap_netweaver_preconfigure/defaults/main.yml b/roles/sap_netweaver_preconfigure/defaults/main.yml index 1e735b95..a1bea12c 100644 --- a/roles/sap_netweaver_preconfigure/defaults/main.yml +++ b/roles/sap_netweaver_preconfigure/defaults/main.yml @@ -5,7 +5,7 @@ # Perform an assertion run: sap_netweaver_preconfigure_assert: false -# In case of an assertion run, if set to "true", the role will abort for any assertion error: +# In case of an assertion run, if set to true, the role will abort for any assertion error: sap_netweaver_preconfigure_assert_ignore_errors: false sap_netweaver_preconfigure_min_swap_space_mb: '20480' diff --git a/roles/sap_netweaver_preconfigure/tasks/main.yml b/roles/sap_netweaver_preconfigure/tasks/main.yml index 451e1c52..702e5106 100644 --- a/roles/sap_netweaver_preconfigure/tasks/main.yml +++ b/roles/sap_netweaver_preconfigure/tasks/main.yml @@ -16,24 +16,21 @@ ansible.builtin.include_vars: "{{ __vars_file }}" loop: - "{{ ansible_os_family }}.yml" - - "{{ ansible_distribution }}.yml" - # Enables loading of shared vars between SLES and SLES_SAP - - >- - {{ ansible_distribution.split("_")[0] ~ '_' ~ - ansible_distribution_major_version }}.yml - - >- - {{ ansible_distribution.split("_")[0] ~ '_' ~ - ansible_distribution_version }}.yml - - - >- - {{ ansible_distribution ~ '_' ~ - ansible_distribution_major_version }}.yml - - >- - {{ ansible_distribution ~ '_' ~ - ansible_distribution_version }}.yml + - "{{ ansible_distribution ~ '.yml' if ansible_distribution != ansible_os_family else omit }}" + - "{{ __distribution_major_split ~ '.yml' if __distribution_major_split != __distribution_major else omit }}" + - "{{ __distribution_minor_split ~ '.yml' if __distribution_minor_split != __distribution_minor else omit }}" + - "{{ __distribution_major }}.yml" + - "{{ __distribution_minor }}.yml" vars: __vars_file: "{{ role_path }}/vars/{{ item }}" + __distribution_major: "{{ ansible_distribution ~ '_' ~ ansible_distribution_major_version }}" + __distribution_minor: "{{ ansible_distribution ~ '_' ~ ansible_distribution_version }}" + # Enables loading of shared vars between SLES and SLES_SAP + __distribution_major_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_major_version }}" + __distribution_minor_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_version }}" when: __vars_file is file + tags: + - always - name: Set filename prefix to empty string if role is run in normal mode From 4916c2aeeef1c6b3bad547d294e448dd44eb768a Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Mon, 9 Dec 2024 15:12:31 +0100 Subject: [PATCH 12/13] fix: update example for var load order --- roles/sap_general_preconfigure/tasks/main.yml | 9 ++++----- .../tasks/include_vars_common.yml | 7 +++---- roles/sap_hana_preconfigure/tasks/main.yml | 7 +++---- roles/sap_netweaver_preconfigure/tasks/main.yml | 7 +++---- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/main.yml b/roles/sap_general_preconfigure/tasks/main.yml index 3a6fcb94..3abafab7 100644 --- a/roles/sap_general_preconfigure/tasks/main.yml +++ b/roles/sap_general_preconfigure/tasks/main.yml @@ -7,11 +7,10 @@ tags: - always -# Load variable files in order: -# Example for SUSE Linux Enterprise Server for SAP Applications 15 SP6: -# 1. Suse.yml - Specific to OS family. -# 2. SLES_15.yml - Specific to distribution (SLES and SLES_SAP) and major release. -# 3. SLES_15.6.yml - Specific to distribution (SLES and SLES_SAP) and minor release. +# Example of files loading order: +# 1. Suse.yml / RedHat.yml - Specific to OS family. +# 2. SLES_15.yml / RedHat_9.yml - Specific to distribution (SLES, SLES_SAP or RedHat) and major release. +# 3. SLES_15.6.yml / RedHat_9.2 - Specific to distribution (SLES, SLES_SAP or RedHat) and minor release. # 4. SLES_SAP_15.yml - Specific to distribution SLES_SAP and major release. # 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. - name: Include OS specific vars, specific diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml index 172022f2..0d1d1e6f 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml @@ -27,10 +27,9 @@ # Load variable files in order: -# Example for SUSE Linux Enterprise Server for SAP Applications 15 SP6: -# 1. Suse.yml - Specific to OS family. -# 2. SLES_15.yml - Specific to distribution (SLES and SLES_SAP) and major release. -# 3. SLES_15.6.yml - Specific to distribution (SLES and SLES_SAP) and minor release. +# 1. Suse.yml / RedHat.yml - Specific to OS family. +# 2. SLES_15.yml / RedHat_9.yml - Specific to distribution (SLES, SLES_SAP or RedHat) and major release. +# 3. SLES_15.6.yml / RedHat_9.2 - Specific to distribution (SLES, SLES_SAP or RedHat) and minor release. # 4. SLES_SAP_15.yml - Specific to distribution SLES_SAP and major release. # 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. - name: "SAP HA Prepare Pacemaker - Include environment specific variables" diff --git a/roles/sap_hana_preconfigure/tasks/main.yml b/roles/sap_hana_preconfigure/tasks/main.yml index 07bae981..91c6dd51 100644 --- a/roles/sap_hana_preconfigure/tasks/main.yml +++ b/roles/sap_hana_preconfigure/tasks/main.yml @@ -6,10 +6,9 @@ var: role_path # Load variable files in order: -# Example for SUSE Linux Enterprise Server for SAP Applications 15 SP6: -# 1. Suse.yml - Specific to OS family. -# 2. SLES_15.yml - Specific to distribution (SLES and SLES_SAP) and major release. -# 3. SLES_15.6.yml - Specific to distribution (SLES and SLES_SAP) and minor release. +# 1. Suse.yml / RedHat.yml - Specific to OS family. +# 2. SLES_15.yml / RedHat_9.yml - Specific to distribution (SLES, SLES_SAP or RedHat) and major release. +# 3. SLES_15.6.yml / RedHat_9.2 - Specific to distribution (SLES, SLES_SAP or RedHat) and minor release. # 4. SLES_SAP_15.yml - Specific to distribution SLES_SAP and major release. # 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. - name: Include OS specific vars, specific diff --git a/roles/sap_netweaver_preconfigure/tasks/main.yml b/roles/sap_netweaver_preconfigure/tasks/main.yml index 702e5106..d8d72e32 100644 --- a/roles/sap_netweaver_preconfigure/tasks/main.yml +++ b/roles/sap_netweaver_preconfigure/tasks/main.yml @@ -6,10 +6,9 @@ var: role_path # Load variable files in order: -# Example for SUSE Linux Enterprise Server for SAP Applications 15 SP6: -# 1. Suse.yml - Specific to OS family. -# 2. SLES_15.yml - Specific to distribution (SLES and SLES_SAP) and major release. -# 3. SLES_15.6.yml - Specific to distribution (SLES and SLES_SAP) and minor release. +# 1. Suse.yml / RedHat.yml - Specific to OS family. +# 2. SLES_15.yml / RedHat_9.yml - Specific to distribution (SLES, SLES_SAP or RedHat) and major release. +# 3. SLES_15.6.yml / RedHat_9.2 - Specific to distribution (SLES, SLES_SAP or RedHat) and minor release. # 4. SLES_SAP_15.yml - Specific to distribution SLES_SAP and major release. # 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. - name: Include OS specific vars, specific From 86807960c685f51e72025a98a62f6bbe07f05f99 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Mon, 9 Dec 2024 16:17:59 +0100 Subject: [PATCH 13/13] fix: replace omit with dynamic j2 list --- roles/sap_general_preconfigure/tasks/main.yml | 19 ++++++++++++------- .../tasks/include_vars_common.yml | 19 ++++++++++++------- roles/sap_hana_preconfigure/tasks/main.yml | 19 ++++++++++++------- .../sap_netweaver_preconfigure/tasks/main.yml | 19 ++++++++++++------- 4 files changed, 48 insertions(+), 28 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/main.yml b/roles/sap_general_preconfigure/tasks/main.yml index 3abafab7..0cdd514c 100644 --- a/roles/sap_general_preconfigure/tasks/main.yml +++ b/roles/sap_general_preconfigure/tasks/main.yml @@ -15,13 +15,7 @@ # 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. - name: Include OS specific vars, specific ansible.builtin.include_vars: "{{ __vars_file }}" - loop: - - "{{ ansible_os_family }}.yml" - - "{{ ansible_distribution ~ '.yml' if ansible_distribution != ansible_os_family else omit }}" - - "{{ __distribution_major_split ~ '.yml' if __distribution_major_split != __distribution_major else omit }}" - - "{{ __distribution_minor_split ~ '.yml' if __distribution_minor_split != __distribution_minor else omit }}" - - "{{ __distribution_major }}.yml" - - "{{ __distribution_minor }}.yml" + loop: "{{ __var_files }}" vars: __vars_file: "{{ role_path }}/vars/{{ item }}" __distribution_major: "{{ ansible_distribution ~ '_' ~ ansible_distribution_major_version }}" @@ -29,6 +23,17 @@ # Enables loading of shared vars between SLES and SLES_SAP __distribution_major_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_major_version }}" __distribution_minor_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_version }}" + __var_files: >- + {{ + [ + ansible_os_family ~ '.yml', + (ansible_distribution ~ '.yml') if ansible_distribution != ansible_os_family else None, + (__distribution_major_split ~ '.yml') if __distribution_major_split != __distribution_major else None, + (__distribution_minor_split ~ '.yml') if __distribution_minor_split != __distribution_minor else None, + __distribution_major ~ '.yml', + __distribution_minor ~ '.yml' + ] | select('defined') | select('string') | list + }} when: __vars_file is file tags: - always diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml index 0d1d1e6f..bdc6ea6d 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml @@ -34,13 +34,7 @@ # 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. - name: "SAP HA Prepare Pacemaker - Include environment specific variables" ansible.builtin.include_vars: "{{ __vars_file }}" - loop: - - "{{ ansible_os_family }}.yml" - - "{{ ansible_distribution ~ '.yml' if ansible_distribution != ansible_os_family else omit }}" - - "{{ __distribution_major_split ~ '.yml' if __distribution_major_split != __distribution_major else omit }}" - - "{{ __distribution_minor_split ~ '.yml' if __distribution_minor_split != __distribution_minor else omit }}" - - "{{ __distribution_major }}.yml" - - "{{ __distribution_minor }}.yml" + loop: "{{ __var_files }}" vars: __vars_file: "{{ role_path }}/vars/{{ item }}" __distribution_major: "{{ ansible_distribution ~ '_' ~ ansible_distribution_major_version }}" @@ -48,4 +42,15 @@ # Enables loading of shared vars between SLES and SLES_SAP __distribution_major_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_major_version }}" __distribution_minor_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_version }}" + __var_files: >- + {{ + [ + ansible_os_family ~ '.yml', + (ansible_distribution ~ '.yml') if ansible_distribution != ansible_os_family else None, + (__distribution_major_split ~ '.yml') if __distribution_major_split != __distribution_major else None, + (__distribution_minor_split ~ '.yml') if __distribution_minor_split != __distribution_minor else None, + __distribution_major ~ '.yml', + __distribution_minor ~ '.yml' + ] | select('defined') | select('string') | list + }} when: __vars_file is file diff --git a/roles/sap_hana_preconfigure/tasks/main.yml b/roles/sap_hana_preconfigure/tasks/main.yml index 91c6dd51..ef63a0b8 100644 --- a/roles/sap_hana_preconfigure/tasks/main.yml +++ b/roles/sap_hana_preconfigure/tasks/main.yml @@ -13,13 +13,7 @@ # 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. - name: Include OS specific vars, specific ansible.builtin.include_vars: "{{ __vars_file }}" - loop: - - "{{ ansible_os_family }}.yml" - - "{{ ansible_distribution ~ '.yml' if ansible_distribution != ansible_os_family else omit }}" - - "{{ __distribution_major_split ~ '.yml' if __distribution_major_split != __distribution_major else omit }}" - - "{{ __distribution_minor_split ~ '.yml' if __distribution_minor_split != __distribution_minor else omit }}" - - "{{ __distribution_major }}.yml" - - "{{ __distribution_minor }}.yml" + loop: "{{ __var_files }}" vars: __vars_file: "{{ role_path }}/vars/{{ item }}" __distribution_major: "{{ ansible_distribution ~ '_' ~ ansible_distribution_major_version }}" @@ -27,6 +21,17 @@ # Enables loading of shared vars between SLES and SLES_SAP __distribution_major_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_major_version }}" __distribution_minor_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_version }}" + __var_files: >- + {{ + [ + ansible_os_family ~ '.yml', + (ansible_distribution ~ '.yml') if ansible_distribution != ansible_os_family else None, + (__distribution_major_split ~ '.yml') if __distribution_major_split != __distribution_major else None, + (__distribution_minor_split ~ '.yml') if __distribution_minor_split != __distribution_minor else None, + __distribution_major ~ '.yml', + __distribution_minor ~ '.yml' + ] | select('defined') | select('string') | list + }} when: __vars_file is file diff --git a/roles/sap_netweaver_preconfigure/tasks/main.yml b/roles/sap_netweaver_preconfigure/tasks/main.yml index d8d72e32..2f99c60a 100644 --- a/roles/sap_netweaver_preconfigure/tasks/main.yml +++ b/roles/sap_netweaver_preconfigure/tasks/main.yml @@ -13,13 +13,7 @@ # 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release. - name: Include OS specific vars, specific ansible.builtin.include_vars: "{{ __vars_file }}" - loop: - - "{{ ansible_os_family }}.yml" - - "{{ ansible_distribution ~ '.yml' if ansible_distribution != ansible_os_family else omit }}" - - "{{ __distribution_major_split ~ '.yml' if __distribution_major_split != __distribution_major else omit }}" - - "{{ __distribution_minor_split ~ '.yml' if __distribution_minor_split != __distribution_minor else omit }}" - - "{{ __distribution_major }}.yml" - - "{{ __distribution_minor }}.yml" + loop: "{{ __var_files }}" vars: __vars_file: "{{ role_path }}/vars/{{ item }}" __distribution_major: "{{ ansible_distribution ~ '_' ~ ansible_distribution_major_version }}" @@ -27,6 +21,17 @@ # Enables loading of shared vars between SLES and SLES_SAP __distribution_major_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_major_version }}" __distribution_minor_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_version }}" + __var_files: >- + {{ + [ + ansible_os_family ~ '.yml', + (ansible_distribution ~ '.yml') if ansible_distribution != ansible_os_family else None, + (__distribution_major_split ~ '.yml') if __distribution_major_split != __distribution_major else None, + (__distribution_minor_split ~ '.yml') if __distribution_minor_split != __distribution_minor else None, + __distribution_major ~ '.yml', + __distribution_minor ~ '.yml' + ] | select('defined') | select('string') | list + }} when: __vars_file is file tags: - always