community.sap_install icon indicating copy to clipboard operation
community.sap_install copied to clipboard

sap_install_media_detect: allow separate detection of exe and exedb for installations where exedb isn't required

Open rob0d opened this issue 1 year ago • 3 comments

@sean-freeman as per your message to track this enhancement suggestion. When set sap_install_media_detect_kernel the code in sap_install_media_detect currently detects both EXE and EXEDB parts of the SAP Kernel. Some types of installations don't require EXEDB, only EXE.

Suggestion is to change the behaviour to allow the kernel detection to separately check EXE or EXEDB or both. Options probably depend on how much we care about backwards compatibility as sap_install_media_detect_kernel is used in many places. Option 1: Allow more than just true/false, but keep true for compatibility purposes:

  • to detect both parts of kernel set this to: true or all
  • to detect part1/exe set this to: exe or part1
  • to detect part2/exedb set hit to: exedb or part2

Option2: Introduce new control parameters: sap_install_media_detect_kernel_part1 + sap_install_media_detect_kernel_part2 ans possibly for backward compatibility keep sap_install_media_detect_kernel which will override the two new parameters if set to true. This may lead to a slightly confusing behaviour is the three parameters are not inline.

rob0d avatar Apr 26 '24 15:04 rob0d

@rob0d @sean-freeman - According to the comments about sap_install_media_detect_kernel_db in defaults/main.yml, setting this parameter to the database type is only necessary if there is more than one SAPEXEDB file in the source directory. Taking into account the absence of this parameter in https://github.com/sap-linuxlab/ansible.playbooks_for_sap, I agree that we should be careful when modifying the meaning of the parameter sap_install_media_detect_kernel or sap_install_media_detect_kernel_db.

Wouldn't a new value for sap_install_media_detect_kernel_db, like for example absent, be sufficient? I wouldn't choose false because this could give the impression that this parameter is a boolean.

The new behavior would be as follows:

  • If sap_install_media_detect_kernel_db is not defined, the behavior is unchanged and the role will check for the presence of a single database dependent kernel file (SAPEXEDB).
  • If sap_install_media_detect_kernel_db is defined and if the value is not absent , the behavior is unchanged and the role will check for the presence of the correct database dependent kernel file (SAPEXEDB) for the specified database type (e.g. saphana).
  • If sap_install_media_detect_kernel_db is defined and if its value is equal to absent, the behavior is changed as follows:
    • The absence of SAPEXEDB does not fail the role, and
    • The role parameters sap_swpm_kernel_dependent_file_name_get_db_specific and the output parameters sap_swpm_kernel_dependent_path and sap_swpm_kernel_dependent_file_name are not set.

This can be achieved by adding all possible database types for parameter sap_install_media_detect_kernel_db as a when condition in the blocks https://github.com/sap-linuxlab/community.sap_install/blob/a97844d8d7cfb8022d8f11ffff844ece62451949/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml#L138 and https://github.com/sap-linuxlab/community.sap_install/blob/a97844d8d7cfb8022d8f11ffff844ece62451949/roles/sap_install_media_detect/tasks/find_files_after_extraction.yml#L147, and by modifying the when condition of the task https://github.com/sap-linuxlab/community.sap_install/blob/a97844d8d7cfb8022d8f11ffff844ece62451949/roles/sap_install_media_detect/tasks/set_global_vars.yml#L130 .

berndfinger avatar May 04 '24 21:05 berndfinger

Hi @berndfinger, yes this sounds better than what I suggested. I would just suggest to use 'none' instead of 'absent'.

rob0d avatar May 07 '24 09:05 rob0d

@rob0d I agree: 'none' is better than 'absent', as the meaning of 'absent' in Ansible is typically to ensure that something is not available.

berndfinger avatar May 07 '24 13:05 berndfinger

Solved in https://github.com/sap-linuxlab/community.sap_install/pull/732.

berndfinger avatar Jun 04 '24 11:06 berndfinger