Skip to content

Commit 495411a

Browse files
committed
Enhance AzureDataParser to support additional mount point formats and update playbook loops to ensure unique host entries for configuration checks
1 parent c3b09fb commit 495411a

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

src/module_utils/collector.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,11 @@ def parse_disks_vars(self, check, context) -> str:
339339

340340
fs_entry = None
341341
for fs in filesystem_data:
342-
if fs.get("target") == mount_point:
342+
if fs.get("target") in (
343+
mount_point,
344+
f"{mount_point}/{context.get('database_sid', '').upper()}",
345+
f"{mount_point}/{context.get('sap_sid', '').upper()}",
346+
):
343347
fs_entry = fs
344348
break
345349

src/playbook_00_configuration_checks.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,12 @@
258258
'check_type': 'vm_info',
259259
'metadata': hostvars[item].vm_info_results_metadata
260260
| default({})}] }}"
261-
loop: "{{ groups[sap_sid | upper + '_SCS']|default([]) +
261+
loop: "{{ (groups[sap_sid | upper + '_SCS']|default([]) +
262262
groups[sap_sid | upper + '_ERS']|default([]) +
263263
groups[sap_sid | upper + '_DB']|default([]) +
264264
groups[sap_sid | upper + '_APP']|default([]) +
265265
groups[sap_sid | upper + '_WEB']|default([]) +
266-
groups[sap_sid | upper + '_PAS']|default([]) }}"
266+
groups[sap_sid | upper + '_PAS']|default([])) | unique }}"
267267
when: hostvars[item].vm_info_results is defined
268268

269269
- name: "Collect package info check results"
@@ -275,12 +275,12 @@
275275
'check_type': 'package_info',
276276
'metadata': hostvars[item].package_info_results_metadata
277277
| default({})}] }}"
278-
loop: "{{ groups[sap_sid | upper + '_SCS']|default([]) +
278+
loop: "{{ (groups[sap_sid | upper + '_SCS']|default([]) +
279279
groups[sap_sid | upper + '_ERS']|default([]) +
280280
groups[sap_sid | upper + '_DB']|default([]) +
281281
groups[sap_sid | upper + '_APP']|default([]) +
282282
groups[sap_sid | upper + '_WEB']|default([]) +
283-
groups[sap_sid | upper + '_PAS']|default([]) }}"
283+
groups[sap_sid | upper + '_PAS']|default([])) | unique }}"
284284
when: hostvars[item].package_info_results is defined
285285

286286
- name: "Collect common SAP check results"
@@ -292,12 +292,12 @@
292292
'check_type': 'common_sap',
293293
'metadata': hostvars[item].common_sap_results_metadata
294294
| default({})}] }}"
295-
loop: "{{ groups[sap_sid | upper + '_SCS']|default([]) +
295+
loop: "{{ (groups[sap_sid | upper + '_SCS']|default([]) +
296296
groups[sap_sid | upper + '_ERS']|default([]) +
297297
groups[sap_sid | upper + '_DB']|default([]) +
298298
groups[sap_sid | upper + '_APP']|default([]) +
299299
groups[sap_sid | upper + '_WEB']|default([]) +
300-
groups[sap_sid | upper + '_PAS']|default([]) }}"
300+
groups[sap_sid | upper + '_PAS']|default([])) | unique }}"
301301
when: hostvars[item].common_sap_results is defined
302302

303303
- name: "Collect networking check results"
@@ -309,12 +309,12 @@
309309
'check_type': 'networking',
310310
'metadata': hostvars[item].networking_results_metadata
311311
| default({})}] }}"
312-
loop: "{{ groups[sap_sid | upper + '_SCS']|default([]) +
312+
loop: "{{ (groups[sap_sid | upper + '_SCS']|default([]) +
313313
groups[sap_sid | upper + '_ERS']|default([]) +
314314
groups[sap_sid | upper + '_DB']|default([]) +
315315
groups[sap_sid | upper + '_APP']|default([]) +
316316
groups[sap_sid | upper + '_WEB']|default([]) +
317-
groups[sap_sid | upper + '_PAS']|default([]) }}"
317+
groups[sap_sid | upper + '_PAS']|default([])) | unique }}"
318318
when: hostvars[item].networking_results is defined
319319

320320
- name: "Collect DB (HANA) check results"
@@ -362,8 +362,8 @@
362362
'check_type': 'ascs_scs',
363363
'metadata': hostvars[item].ascs_scs_results_metadata
364364
| default({})}] }}"
365-
loop: "{{ groups[sap_sid | upper + '_SCS']|default([]) +
366-
groups[sap_sid | upper + '_ERS']|default([]) }}"
365+
loop: "{{ (groups[sap_sid | upper + '_SCS']|default([]) +
366+
groups[sap_sid | upper + '_ERS']|default([])) | unique }}"
367367
when: hostvars[item].ascs_scs_results is defined
368368

369369
- name: "Collect SCS/ERS HA configuration check results"
@@ -375,8 +375,8 @@
375375
'check_type': 'scs_ha_config',
376376
'metadata': hostvars[item].scs_ha_config_results_metadata
377377
| default({})}] }}"
378-
loop: "{{ groups[sap_sid | upper + '_SCS']|default([]) +
379-
groups[sap_sid | upper + '_ERS']|default([]) }}"
378+
loop: "{{ (groups[sap_sid | upper + '_SCS']|default([]) +
379+
groups[sap_sid | upper + '_ERS']|default([])) | unique }}"
380380
when: hostvars[item].scs_ha_config_results is defined
381381

382382
- name: "Collect Application Server check results"
@@ -388,9 +388,9 @@
388388
'check_type': 'app_server',
389389
'metadata': hostvars[item].app_server_results_metadata
390390
| default({})}] }}"
391-
loop: "{{ groups[sap_sid | upper + '_APP']|default([]) +
391+
loop: "{{ (groups[sap_sid | upper + '_APP']|default([]) +
392392
groups[sap_sid | upper + '_PAS']|default([]) +
393-
groups[sap_sid | upper + '_WEB']|default([]) }}"
393+
groups[sap_sid | upper + '_WEB']|default([])) | unique }}"
394394
when: hostvars[item].app_server_results is defined
395395

396396
- name: "Debug execution metadata"
@@ -427,12 +427,12 @@
427427
if scs_high_availability
428428
| default(false) | bool
429429
else 'N/A' }}"
430-
hostnames: "{{ groups[sap_sid | upper + '_SCS']|default([]) +
430+
hostnames: "{{ (groups[sap_sid | upper + '_SCS']|default([]) +
431431
groups[sap_sid | upper + '_ERS']|default([]) +
432432
groups[sap_sid | upper + '_DB']|default([]) +
433433
groups[sap_sid | upper + '_APP']|default([]) +
434434
groups[sap_sid | upper + '_WEB']|default([]) +
435-
groups[sap_sid | upper + '_PAS']|default([]) }}"
435+
groups[sap_sid | upper + '_PAS']|default([])) | unique }}"
436436
passed_count: "{{ all_results | selectattr('status', 'equalto', 'PASSED') | list | length }}"
437437
error_count: "{{ all_results | selectattr('status', 'equalto', 'FAILED') | list | length }}"
438438
warning_count: "{{ all_results | selectattr('status', 'equalto', 'WARNING') | list | length }}"
@@ -447,4 +447,4 @@
447447

448448
- name: "Debug the file name of the report generated"
449449
ansible.builtin.debug:
450-
msg: "Report file CONFIG_{{ sap_sid | upper }}_{{ platform | upper }} generated."
450+
msg: "Report file CONFIG_{{ sap_sid | upper }}_{{ platform | upper }}_{{ test_group_invocation_id }} generated."

0 commit comments

Comments
 (0)