Skip to content

Commit 0686f6c

Browse files
authored
Merge pull request #911 from ja9fuchs/angi-on-rhel
sap_ha_pacemaker_cluster: ANGI on RHEL and small improvements
2 parents a96da30 + ffd9ffc commit 0686f6c

10 files changed

+108
-32
lines changed

roles/sap_ha_pacemaker_cluster/defaults/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ sap_ha_pacemaker_cluster_hana_resource_name: '' # Default: rsc_SAPHa
113113
sap_ha_pacemaker_cluster_hana_resource_clone_name: '' # Default: cln_SAPHana_<SID>_HDB<Instance Number>
114114
sap_ha_pacemaker_cluster_hana_resource_clone_msl_name: '' # Default: msl_SAPHana_<SID>_HDB<Instance Number>
115115
sap_ha_pacemaker_cluster_hanacontroller_resource_name: '' # Default: rsc_SAPHanaCon_<SID>_HDB<Instance Number>
116-
sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name: '' # Default: cln_SAPHanaCon_<SID>_HDB<Instance Number>
116+
sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name: '' # Default: <cln|mst>_SAPHanaCon_<SID>_HDB<Instance Number>
117117
sap_ha_pacemaker_cluster_hana_topology_resource_name: '' # Default: rsc_SAPHanaTop_<SID>_HDB<Instance Number>
118118
sap_ha_pacemaker_cluster_hana_topology_resource_clone_name: '' # Default: cln_SAPHanaTop_<SID>_HDB<Instance Number>
119119
sap_ha_pacemaker_cluster_hana_filesystem_resource_name: '' # Default: rsc_SAPHanaFil_<SID>_HDB<Instance Number>

roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ argument_specs:
427427
- Customize the cluster resource name of the SAP HANA Controller.
428428

429429
sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name:
430-
default: "cln_SAPHanaCon_<SID>_HDB<Instance Number>"
430+
default: "<cln|mst>_SAPHanaCon_<SID>_HDB<Instance Number>"
431431
description:
432432
- Customize the cluster resource name of the SAP HANA Controller clone.
433433

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,51 @@
11
# SPDX-License-Identifier: Apache-2.0
22
---
3-
# Identify if SAPHanaSR-angi package is available for installation.
4-
# SAPHanaSR-angi replaces SAPHanaSR and SAPHanaSR-ScaleOut.
3+
# Identify if 'sap-hana-ha' package is available for installation.
4+
# sap-hana-ha replaces resource-agents-sap-hana and resource-agents-sap-hana-scaleout.
55

6-
# TODO:
7-
# Add RedHat specific steps to identify SAPHanaSR-angi package.
6+
- name: "SAP HA Prepare Pacemaker - Block for detection of 'SAPHanaSR-angi'"
7+
when: (sap_ha_pacemaker_cluster_saphanasr_angi_detection | bool)
8+
block:
9+
10+
- name: "SAP HA Prepare Pacemaker - Gather installed packages facts"
11+
ansible.builtin.package_facts:
12+
manager: auto
13+
14+
- name: "SAP HA Prepare Pacemaker - Check the availability of 'sap-hana-ha'"
15+
ansible.builtin.command:
16+
cmd: dnf provides sap-hana-ha
17+
changed_when: false
18+
register: __sap_ha_pacemaker_cluster_saphanasr_angi_check
19+
failed_when: false
20+
21+
# The provision role should not fix packages if run against systems that
22+
# were previously installed with the conflicting packages. System state is
23+
# unclear at this moment and the role should rather fail early.
24+
- name: "SAP HA Prepare Pacemaker - Fail if there are package conflicts"
25+
ansible.builtin.assert:
26+
that:
27+
- "'resource-agents-sap-hana' not in packages or
28+
__sap_ha_pacemaker_cluster_saphanasr_angi_check.rc == 0"
29+
fail_msg: |
30+
31+
ERROR: Conflicting packages.
32+
33+
Package available and to be installed: sap-hana-ha
34+
35+
Conflicting packages are installed:
36+
{% for finding in (packages | select('match', 'resource-agents-sap.*')) %}
37+
- {{ finding }}
38+
{% endfor %}
39+
40+
Remove the conflicting packages to continue the setup with the
41+
detected resource agent package.
42+
Alternatively: Disable the package detection
43+
(sap_ha_pacemaker_cluster_saphanasr_angi_detection = false)
44+
to continue the setup using the installed resource agents.
45+
46+
- name: "SAP HA Prepare Pacemaker - Set fact angi_available"
47+
ansible.builtin.set_fact:
48+
__sap_ha_pacemaker_cluster_saphanasr_angi_available: true
49+
when:
50+
- __sap_ha_pacemaker_cluster_saphanasr_angi_check is defined
51+
- __sap_ha_pacemaker_cluster_saphanasr_angi_check.rc == 0

roles/sap_ha_pacemaker_cluster/tasks/configure_srhook.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
__sap_ha_pacemaker_cluster_hana_hook_chksrv: false
2727

2828
# tkover and chksrv variables are updated if their providers are detected
29-
- name: "SAP HA Pacemaker srHook - Set tkover true if present"
29+
- name: "SAP HA Pacemaker srHook - Set tkover true if defined and enabled"
3030
ansible.builtin.set_fact:
3131
__sap_ha_pacemaker_cluster_hana_hook_tkover: true
3232
when:
3333
- sap_ha_pacemaker_cluster_hana_hooks | selectattr(
3434
'provider', 'search', 'tkover', 'i') | list | length > 0
3535

36-
- name: "SAP HA Pacemaker srHook - Set chksrv true if present"
36+
- name: "SAP HA Pacemaker srHook - Set chksrv true if defined and enabled"
3737
ansible.builtin.set_fact:
3838
__sap_ha_pacemaker_cluster_hana_hook_chksrv: true
3939
when:

roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_constraints_hana.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
__constraint_order_vip:
1010
id: "{{ __sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name }}"
1111
resource_first:
12-
id: "{{ __sap_ha_pacemaker_cluster_hana_resource_clone_name }}"
12+
id: "{{ __sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name
13+
if __sap_ha_pacemaker_cluster_saphanasr_angi_available
14+
else __sap_ha_pacemaker_cluster_hana_resource_clone_name }}"
1315
action: promote
1416
resource_then:
1517
id: "{{ __res_or_grp }}"
@@ -48,7 +50,9 @@
4850
__constraint_order_vip:
4951
id: "{{ __sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name }}"
5052
resource_first:
51-
id: "{{ __sap_ha_pacemaker_cluster_hana_resource_clone_name }}"
53+
id: "{{ __sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name
54+
if __sap_ha_pacemaker_cluster_saphanasr_angi_available
55+
else __sap_ha_pacemaker_cluster_hana_resource_clone_name }}"
5256
action: start
5357
resource_then:
5458
id: "{{ __res_or_grp }}"

roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Detect presence of SAPHanaSR-angi package before loading HANA variables
44
# Detection of package availability was chosen instead of OS version check.
55
# SAPHanaSR-angi will be retrofitted to older SP repositories in future.
6-
- name: "SAP HA Prepare Pacemaker - Detect SAPHanaSR-angi availability"
6+
- name: "SAP HA Install Pacemaker - Run SAP HANA pre-steps"
77
ansible.builtin.include_tasks:
88
file: "{{ ansible_facts['os_family'] }}/pre_steps_hana.yml"
99
when:
@@ -81,7 +81,7 @@
8181
else sap_ha_pacemaker_cluster_hanacontroller_resource_name }}"
8282

8383
__sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name:
84-
"{{ 'mst_SAPHanaCon_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr
84+
"{{ ('mst' if ansible_os_family == 'Suse' else 'cln') ~ '_SAPHanaCon_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr
8585
if sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name | string | length == 0
8686
else sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }}"
8787

roles/sap_ha_pacemaker_cluster/tasks/platform/ascertain_platform_type.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@
8181
changed_when: false
8282
when: ansible_architecture == "ppc64le"
8383

84-
- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Power - RSCT binary check"
84+
- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Power - Fail if RSCT binary is missing"
8585
ansible.builtin.fail:
8686
msg: Please install RSCT from IBM Power Systems service and productivity tools repository
8787
when:
8888
- ansible_architecture == "ppc64le"
8989
- __sap_ha_pacemaker_cluster_power_rsct_check.stdout == ""
9090

91-
- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Power - RSCT binary check"
91+
- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Power - Run 'ctgethscid'"
9292
ansible.builtin.shell: |
9393
/opt/rsct/bin/ctgethscid
9494
register: __sap_ha_pacemaker_cluster_power_rsct_hscid

roles/sap_ha_pacemaker_cluster/vars/RedHat.yml

+34-14
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ __sap_ha_pacemaker_cluster_platform_extra_packages_dict:
9292

9393
# Dictionary with additional cluster packages for specific scenarios
9494
__sap_ha_pacemaker_cluster_sap_extra_packages_dict:
95+
hana_angi:
96+
- sap-hana-ha
9597
hana_scaleout:
9698
- resource-agents-sap-hana-scaleout
9799
hana_scaleup:
@@ -106,13 +108,10 @@ __sap_ha_pacemaker_cluster_sap_extra_packages_dict:
106108
__sap_ha_pacemaker_cluster_resource_agents:
107109
saphanatopology: "ocf:heartbeat:SAPHanaTopology"
108110
saphana: "ocf:heartbeat:SAPHana"
109-
# TODO: Uncomment when SAPHanaSR-angi is available on Red Hat
110-
# saphanacontroller: "ocf:heartbeat:SAPHanaController"
111-
# saphanafilesystem: "ocf:heartbeat:SAPHanaFilesystem"
112-
# TODO: Uncomment when SAPStartSrv is available on Red Hat
113-
# sapstartsrv: "ocf:heartbeat:SAPStartSrv"
111+
saphanacontroller: "ocf:heartbeat:SAPHanaController"
112+
saphanafilesystem: "ocf:heartbeat:SAPHanaFilesystem"
113+
sapstartsrv: "ocf:heartbeat:SAPStartSrv"
114114

115-
# TODO: Uncomment when SAPHanaSR-angi is available on Red Hat
116115
__sap_ha_pacemaker_cluster_saphanasr_angi_available: false
117116

118117
# Default SAP HANA hook parameters combined based on user decision
@@ -123,18 +122,39 @@ __sap_ha_pacemaker_cluster_hook_hana_scaleup_perf:
123122
options:
124123
- name: execution_order
125124
value: 1
126-
# TODO: Add additional hooks
125+
chksrv:
126+
- provider: ChkSrv
127+
path: /usr/share/SAPHanaSR/srHook/
128+
options:
129+
- name: execution_order
130+
value: 2
131+
- name: action_on_lost
132+
value: stop
133+
134+
__sap_ha_pacemaker_cluster_hook_hana_scaleup_perf_angi:
135+
saphanasr:
136+
- provider: HanaSR
137+
path: /usr/share/sap-hana-ha/
138+
options:
139+
- name: execution_order
140+
value: 1
141+
chksrv:
142+
- provider: ChkSrv
143+
path: /usr/share/sap-hana-ha/
144+
options:
145+
- name: execution_order
146+
value: 2
147+
- name: action_on_lost
148+
value: stop
149+
- name: stop_timeout
150+
value: 25
127151

128-
# Placeholder dictionaries
129-
# TODO: Define hooks when SAPHanaSR-angi is available on Red Hat
130-
__sap_ha_pacemaker_cluster_hook_hana_scaleup_perf_angi: []
131152
__sap_ha_pacemaker_cluster_hook_hana_scaleout: []
132153
__sap_ha_pacemaker_cluster_hook_hana_scaleout_angi: []
133154

134-
# Disabled additional hooks until they are present in dictionary above
135-
# TODO: Remove when additional hooks are specified above.
136-
__sap_ha_pacemaker_cluster_hana_hook_tkover: false
137-
__sap_ha_pacemaker_cluster_hana_hook_chksrv: false
155+
# Enable default OS recommended hooks
156+
sap_ha_pacemaker_cluster_hana_hook_tkover: false
157+
sap_ha_pacemaker_cluster_hana_hook_chksrv: true
138158

139159
# Central Services Cluster Simple Mount: Enabled as default
140160
# TODO: Enable when SAPStartSrv resource agents are available on Red Hat

roles/sap_ha_pacemaker_cluster/vars/Suse.yml

+4
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,9 @@ __sap_ha_pacemaker_cluster_hook_hana_scaleup_perf_angi:
133133
__sap_ha_pacemaker_cluster_hook_hana_scaleout: []
134134
__sap_ha_pacemaker_cluster_hook_hana_scaleout_angi: []
135135

136+
# Enable default OS recommended hooks
137+
sap_ha_pacemaker_cluster_hana_hook_tkover: true
138+
sap_ha_pacemaker_cluster_hana_hook_chksrv: true
139+
136140
# Central Services Cluster Simple Mount: Enabled as default
137141
sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount: true

roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_perf.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ __sap_ha_pacemaker_cluster_hana_hook_dictionary:
2020

2121
# Recommended srhooks are set to true only if default dictionary is populated
2222
__sap_ha_pacemaker_cluster_hana_hook_tkover:
23-
"{{ true if lookup('ansible.builtin.vars', __sap_ha_pacemaker_cluster_hana_hook_dictionary).tkover
24-
is defined else false }}"
23+
"{{ true if
24+
(lookup('ansible.builtin.vars', __sap_ha_pacemaker_cluster_hana_hook_dictionary).tkover
25+
is defined and (sap_ha_pacemaker_cluster_hana_hook_tkover | bool))
26+
else false }}"
2527
__sap_ha_pacemaker_cluster_hana_hook_chksrv:
26-
"{{ true if lookup('ansible.builtin.vars', __sap_ha_pacemaker_cluster_hana_hook_dictionary).chksrv
27-
is defined else false }}"
28+
"{{ true if
29+
(lookup('ansible.builtin.vars', __sap_ha_pacemaker_cluster_hana_hook_dictionary).chksrv
30+
is defined and (sap_ha_pacemaker_cluster_hana_hook_chksrv | bool))
31+
else false }}"
2832

2933
# Combine final list of srhooks based on user input and angi availability
3034
__sap_ha_pacemaker_cluster_hana_hooks: "{{

0 commit comments

Comments
 (0)