community.sap_install
community.sap_install copied to clipboard
sap_install_media_detect: allow separate detection of exe and exedb for installations where exedb isn't required
@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:
trueorall - to detect part1/exe set this to:
exeorpart1 - to detect part2/exedb set hit to:
exedborpart2
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 @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_dbis 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_dbis defined and if the value is notabsent, 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_dbis defined and if its value is equal toabsent, 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_specificand the output parameterssap_swpm_kernel_dependent_pathandsap_swpm_kernel_dependent_file_nameare 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 .
Hi @berndfinger, yes this sounds better than what I suggested. I would just suggest to use 'none' instead of 'absent'.
@rob0d I agree: 'none' is better than 'absent', as the meaning of 'absent' in Ansible is typically to ensure that something is not available.
Solved in https://github.com/sap-linuxlab/community.sap_install/pull/732.