Skip to content

Commit a96cd4e

Browse files
committed
Enhance configuration checks to support IBM DB2 alongside SAP HANA, updating relevant documentation and playbook tasks for clarity and functionality.
1 parent 28174e8 commit a96cd4e

File tree

5 files changed

+592
-14
lines changed

5 files changed

+592
-14
lines changed

docs/CONFIGURATION_CHECKS.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ Configuration validation serves as a critical quality gate in the SAP deployment
2929
- Storage account redundancy settings
3030
- Disk caching policies
3131

32-
**SAP HANA Configuration**
33-
- Memory allocation
34-
- System replication parameters
32+
**SAP Database Configuration**
33+
- SAP HANA: Memory allocation, system replication parameters
34+
- IBM DB2: Hardware requirements, system language, OS tuning parameters
3535

36-
**Pacemaker Cluster**
36+
**Pacemaker Cluster (HANA only)**
3737
- Resource agent versions and parameters
3838
- Fencing (STONITH) configuration
3939
- Resource constraints and colocation rules
4040
- Cluster communication settings
4141

42-
**SAP HA Resources**
42+
**SAP HA Resources (HANA only)**
4343
- Virtual hostname configuration
4444
- File system mount options
4545
- Service startup ordering
@@ -56,6 +56,8 @@ Update the `TEST_TYPE` parameter in [`vars.yaml`](./../vars.yaml) file to `Confi
5656

5757
Follow the steps (2.1 - 2.2) in [Setup Guide for SAP Testing Automation Framework](./SETUP.MD#2-system-configuration) to configure your system details.
5858

59+
> **Note**: High Availability (HA) configuration checks and functional tests are currently supported only for SAP HANA databases. For IBM DB2 databases, only non-HA configuration checks are available.
60+
5961

6062
### 3. Test Execution
6163

@@ -71,7 +73,7 @@ To execute the script, run following command:
7173
# Run checks with verbose logging
7274
./scripts/sap_automation_qa.sh -vv
7375

74-
# Run only Database (HANA) configuration checks
76+
# Run only Database configuration checks (supports both HANA and DB2)
7577
./scripts/sap_automation_qa.sh --extra-vars='{"configuration_test_type":"Database"}'
7678

7779
# Run only ASCS/ERS configuration checks

src/modules/configuration_check_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ def run(self):
875875
context["hostname"] = custom_hostname
876876

877877
self.set_context(context)
878-
if self.context.get("check_type", {}).get("file_name") == "hana":
878+
if self.context.get("check_type", {}).get("file_name") in ["hana", "db2"]:
879879
temp_context = FileSystemCollector(parent=self).collect(
880880
check=None, context=self.context
881881
)

src/playbook_00_configuration_checks.yml

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
loop_control:
107107
loop_var: check_type
108108

109-
- name: "Run role-specific checks for DB hosts"
109+
- name: "Run role-specific checks for HANA DB hosts"
110110
ansible.builtin.include_tasks:
111111
file: "./roles/configuration_checks/tasks/main.yml"
112112
vars:
@@ -117,18 +117,44 @@
117117
results_var: "db_hana_results"
118118
when: >-
119119
role == 'DB' and
120+
(platform | default('HANA') | upper == 'HANA') and
120121
(configuration_test_type == 'all' or
121122
configuration_test_type == 'Database')
122123
123-
- name: "Debug DB checks execution"
124+
- name: "Debug HANA checks execution"
124125
ansible.builtin.debug:
125126
msg: "Executing Database (HANA) checks on host {{ inventory_hostname }}"
126127
when: >-
127128
role == 'DB' and
129+
(platform | default('HANA') | upper == 'HANA') and
128130
(configuration_test_type == 'all' or
129131
configuration_test_type == 'Database')
130132
131-
- name: "Run HA configuration checks for DB hosts"
133+
- name: "Run role-specific checks for DB2 DB hosts"
134+
ansible.builtin.include_tasks:
135+
file: "./roles/configuration_checks/tasks/main.yml"
136+
vars:
137+
check_type:
138+
name: "Database (DB2) Checks"
139+
file_name: "db2"
140+
checks_var: "db_db2_checks"
141+
results_var: "db_db2_results"
142+
when: >-
143+
role == 'DB' and
144+
(platform | default('HANA') | upper == 'DB2') and
145+
(configuration_test_type == 'all' or
146+
configuration_test_type == 'Database')
147+
148+
- name: "Debug DB2 checks execution"
149+
ansible.builtin.debug:
150+
msg: "Executing Database (DB2) checks on host {{ inventory_hostname }}"
151+
when: >-
152+
role == 'DB' and
153+
(platform | default('HANA') | upper == 'DB2') and
154+
(configuration_test_type == 'all' or
155+
configuration_test_type == 'Database')
156+
157+
- name: "Run HA configuration checks for HANA DB hosts"
132158
ansible.builtin.include_tasks:
133159
file: "./roles/configuration_checks/tasks/main.yml"
134160
vars:
@@ -138,9 +164,10 @@
138164
checks_var: "db_ha_config_checks"
139165
results_var: "db_ha_config_results"
140166
when:
141-
- role == 'DB' and
167+
- role == 'DB'
168+
- (platform | default('HANA') | upper == 'HANA')
142169
- database_high_availability | default(false) | bool
143-
- configuration_test_type == 'all' or configuration_test_type == 'Database')
170+
- (configuration_test_type == 'all' or configuration_test_type == 'Database')
144171

145172
- name: "Run role-specific checks for ASCS/SCS hosts"
146173
ansible.builtin.include_tasks:
@@ -297,6 +324,18 @@
297324
loop: "{{ groups[sap_sid | upper + '_DB']|default([]) }}"
298325
when: hostvars[item].db_hana_results is defined
299326

327+
- name: "Collect DB (DB2) check results"
328+
ansible.builtin.set_fact:
329+
all_results: "{{ all_results + hostvars[item].db_db2_results
330+
| default([]) }}"
331+
execution_metadata: "{{ execution_metadata + [
332+
{'host': item,
333+
'check_type': 'db_db2',
334+
'metadata': hostvars[item].db_db2_results_metadata
335+
| default({})}] }}"
336+
loop: "{{ groups[sap_sid | upper + '_DB']|default([]) }}"
337+
when: hostvars[item].db_db2_results is defined
338+
300339
- name: "Collect DB HA configuration check results"
301340
ansible.builtin.set_fact:
302341
all_results: "{{ all_results + hostvars[item].db_ha_config_results

0 commit comments

Comments
 (0)