Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sap_ha_pacemaker_cluster/SUSE: Rework SAPHanaSR-angi pre-steps and add SLES 16 vars #928

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion roles/sap_ha_pacemaker_cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,8 @@ sap_ha_pacemaker_cluster_resource_defaults:
- _Type:_ `string`<br>
- _Default:_ `True`<br>

Disabling this variable enables to use Classic SAPHanaSR agents even on server, with SAPHanaSR-angi is available.<br>
Disabling this variable enables to use Classic SAPHanaSR agents even on server, where SAPHanaSR-angi is available.<br>
Value `false` (Classic) is ignored when only SAPHanaSR-angi packages are available.<br>

### sap_ha_pacemaker_cluster_sbd_devices
- _Type:_ `list`<br>
Expand Down
3 changes: 2 additions & 1 deletion roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ argument_specs:
default: true
description:
- Disabling this variable enables to use Classic SAPHanaSR agents even on server,
with SAPHanaSR-angi is available.
where SAPHanaSR-angi is available.
- Value `false` (Classic) is ignored when only SAPHanaSR-angi packages are available.

##########################################################################
# NetWeaver specific parameters
Expand Down
47 changes: 46 additions & 1 deletion roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# This is destructive step if executed on running cluster
# without proper migration from SAPHanaSR to SAPHanaSR-angi!

- name: "SAP HA Prepare Pacemaker - Block for detection of SAPHanaSR-angi"

- name: "SAP HA Prepare Pacemaker - Block for preparation of SAPHanaSR-angi HANA cluster"
when: (sap_ha_pacemaker_cluster_saphanasr_angi_detection | bool)
block:
# Requirement for package_facts Ansible Module
Expand All @@ -27,6 +28,8 @@
register: __sap_ha_pacemaker_cluster_zypper_angi_check
failed_when: false


# Uninstall SAPHanaSR package on SLES 15
# package can be replaced with "rpm -e --nodeps {{ item }}"
- name: "SAP HA Prepare Pacemaker - Remove SAPHanaSR and SAPHanaSR-doc"
ansible.builtin.package:
Expand All @@ -39,10 +42,52 @@
- __sap_ha_pacemaker_cluster_zypper_angi_check is defined
- __sap_ha_pacemaker_cluster_zypper_angi_check.rc == 0
- "'SAPHanaSR' in ansible_facts.packages"
# SAPHanaSR (Classic) is not available on SLES 16
- ansible_distribution_major_version | int < 16

- name: "SAP HA Prepare Pacemaker - Set fact angi_available"
ansible.builtin.set_fact:
__sap_ha_pacemaker_cluster_saphanasr_angi_available: true
when:
- __sap_ha_pacemaker_cluster_zypper_angi_check is defined
- __sap_ha_pacemaker_cluster_zypper_angi_check.rc == 0


- name: "SAP HA Prepare Pacemaker - Block for preparation of Classic HANA cluster"
when:
- not (sap_ha_pacemaker_cluster_saphanasr_angi_detection | bool)
# SAPHanaSR (Classic) is not available on SLES 16
- ansible_distribution_major_version | int < 16
block:
# Requirement for package_facts Ansible Module
# SLES: Ensure OS Package for Python Lib of rpm bindings is enabled for System Python
- name: "SAP HA Prepare Pacemaker - Ensure python3-rpm package is present"
ansible.builtin.package:
name: python3-rpm
state: present

- name: "SAP HA Prepare Pacemaker - Gather installed packages facts"
ansible.builtin.package_facts:
manager: auto

# package can be replaced with "rpm -e --nodeps {{ item }}"
- name: "SAP HA Prepare Pacemaker - Remove SAPHanaSR-angi"
ansible.builtin.package:
name: "{{ item }}"
state: absent
loop:
- SAPHanaSR-angi
when:
- "'SAPHanaSR-angi' in ansible_facts.packages"

- name: "SAP HA Prepare Pacemaker - Set fact angi_available"
ansible.builtin.set_fact:
__sap_ha_pacemaker_cluster_saphanasr_angi_available: false


# Ensure that angi flag is always set for SLES 16
- name: "SAP HA Prepare Pacemaker - Ensure angi_available is set for SLES 16"
ansible.builtin.set_fact:
__sap_ha_pacemaker_cluster_saphanasr_angi_available: true
when:
- ansible_distribution_major_version | int > 15
35 changes: 35 additions & 0 deletions roles/sap_ha_pacemaker_cluster/vars/SLES_16.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SPDX-License-Identifier: Apache-2.0
---
# Variables specific to following versions:
# - SUSE Linux Enterprise Server for SAP Applications 16
# - SUSE Linux Enterprise Server 16

# Dictionary with additional cluster packages for specific scenarios
__sap_ha_pacemaker_cluster_sap_extra_packages_dict:
minimal: [] # All minimal packages are part of patterns
hana_scaleout:
- patterns-sap-HADB
hana_scaleup:
- patterns-sap-HADB
hana_angi: [] # SAPHanaSR-angi package is part of patterns-sap-HADB
nwas:
- patterns-sap-HAAPP

# Package list was simplified because of new patterns below:

# patterns-sap-HADB contains:
# - patterns-sles_sap_DB
# - patterns-ha-ha_sles
# - SAPHanaSR-angi
# - ClusterTools2
# - supportutils-plugin-ha-sap
# - socat

# patterns-sap-HAAPP contains:
# - patterns-sles_sap_APP
# - patterns-ha-ha_sles
# - sapstartsrv-resource-agents
# - sap-suse-cluster-connector
# - ClusterTools2
# - supportutils-plugin-ha-sap
# - socat
15 changes: 2 additions & 13 deletions roles/sap_ha_pacemaker_cluster/vars/Suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,9 @@ __sap_ha_pacemaker_cluster_platform_extra_packages_dict:
- socat

# Dictionary with additional cluster packages for specific scenarios
# All packages are defined in SLES_15 and SLES_16 var files.
__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
{}

# Dictionary with preferred platform specific VIP method that differs from default
__sap_ha_pacemaker_cluster_vip_method_dict:
Expand Down
Loading