diff --git a/roles/sap_install_media_detect/defaults/main.yml b/roles/sap_install_media_detect/defaults/main.yml index 961ffd693..a1a1fe264 100644 --- a/roles/sap_install_media_detect/defaults/main.yml +++ b/roles/sap_install_media_detect/defaults/main.yml @@ -74,6 +74,7 @@ sap_install_media_detect_kernel: false sap_install_media_detect_kernel_db: '' # saphana, sapase, sapmaxdb, oracledb, ibmdb2 # (only necessary if there is more than one SAPEXEDB file in the source directory) sap_install_media_detect_webdisp: false +sap_install_media_detect_mpstack: false sap_install_media_detect_export: '' # saps4hana, sapbw4hana, sapecc, sapecc_ides, # sapnwas_abap, sapnwas_java, sapsolman_abap, sapsolman_java diff --git a/roles/sap_install_media_detect/files/tmp/sapfile b/roles/sap_install_media_detect/files/tmp/sapfile index 860e1bf8f..6a37c1f7d 100755 --- a/roles/sap_install_media_detect/files/tmp/sapfile +++ b/roles/sap_install_media_detect/files/tmp/sapfile @@ -197,6 +197,7 @@ for _FILE in "$@"; do /RAR archive data/{_file_type="rar"} /Zip archive data/{_file_type="zip"} /SAPCAR archive data/{_file_type="sapcar"} + /XML/&&/ASCII/{_file_type="xml"} /directory/{_file_type="dir"} END{print _file_type}') if [[ ${_GENERIC_FILE_TYPE}. == "rarexe." ]]; then @@ -207,6 +208,8 @@ for _FILE in "$@"; do _list_content="zipinfo -1" elif [[ ${_GENERIC_FILE_TYPE}. == "sapcar." ]]; then _list_content="${_SAPCAR_FILE} -tvf" + elif [[ ${_GENERIC_FILE_TYPE}. == "xml." ]]; then + _list_content="cat" elif [[ ${_GENERIC_FILE_TYPE}. == "dir." ]]; then _list_content="" fi @@ -240,7 +243,7 @@ for _FILE in "$@"; do /S4/&&/LANG/{_sap_file_type="sap_s4hana_lang"} /S4/&&/EXPORT/{_sap_file_type="sap_export_s4hana"} /BW4/&&/EXPORT/{_sap_file_type="sap_export_bw4hana"} - /VCH/&&/\.SAR/{_sap_file_type="sap_vch_afl"} + /VCH/&&/\.SAR/{_sap_file_type="saphana_vch_afl"} END{print _sap_file_type}') if [[ ${SAP_FILE_TYPE_FROM_FILENAME}. == "sap_kernel_db." ]]; then SAP_FILE_TYPE_FROM_FILENAME=$(eval "${_list_content}" "${_FILE}" | awk ' @@ -256,7 +259,8 @@ for _FILE in "$@"; do elif [[ ${_GENERIC_FILE_TYPE}. == "rarexe." || ${_GENERIC_FILE_TYPE}. == "rar." || ${_GENERIC_FILE_TYPE}. == "zip." || - ${_GENERIC_FILE_TYPE}. == "sapcar." ]]; then + ${_GENERIC_FILE_TYPE}. == "sapcar." || + ${_GENERIC_FILE_TYPE}. == "xml." ]]; then _SAP_FILE_TYPE=$(eval "${_list_content}" "${_FILE}" | awk ' BEGIN{_sap_file_type="sap_unknown"} /BD_SYBASE_ASE/{_sap_file_type="sapase"} @@ -273,6 +277,7 @@ for _FILE in "$@"; do /DATA_UNITS\/EXP[0-9]/{_sap_file_type="sap_export_nwas_abap"} /DATA_UNITS\/JAVA_EXPORT_JDMP/{_sap_file_type="sap_export_nwas_java"} /DATA_UNITS\/SOLMAN/&&/_JAVA_UT/{_sap_file_type="sap_export_solman_java"} + / 1 +- name: SAP Install Media Detect - Find files after extraction - Find Maintenance Planner Stack XML file + ansible.builtin.shell: set -o pipefail && ls -1tr *.xml | tail -1 + args: + chdir: "{{ sap_swpm_software_path }}" + register: sap_swpm_mp_xml_file_name_get + changed_when: false + when: sap_install_media_detect_mpstack + - name: SAP Install Media Detect - Find files after extraction - Find SAP ECC Export ansible.builtin.find: paths: "{{ __sap_install_media_detect_software_main_directory }}/sap_export_ecc_extracted" diff --git a/roles/sap_install_media_detect/tasks/organize_files.yml b/roles/sap_install_media_detect/tasks/organize_files.yml index 8605d257a..dea5bfb1c 100644 --- a/roles/sap_install_media_detect/tasks/organize_files.yml +++ b/roles/sap_install_media_detect/tasks/organize_files.yml @@ -62,7 +62,8 @@ - (line_item.archive_type == 'zip' or line_item.archive_type == 'rarexe' or line_item.archive_type == 'rar' or - line_item.archive_type == 'sapcar') + line_item.archive_type == 'sapcar' or + line_item.archive_type == 'xml') - name: SAP Install Media Detect - Organize all files - Create target directory 'sap_hana' ansible.builtin.file: diff --git a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml index 7d06d4efe..91268cb29 100644 --- a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml +++ b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml @@ -47,6 +47,7 @@ when: (item.stdout.split(';')[1] == 'sapcar') or (item.stdout.split(';')[1] == 'sap_jvm') or + (item.stdout.split(';')[1] == 'sap_mp_xml') or (item.stdout.split(';')[1] == 'sap_unknown') or (sap_install_media_detect_swpm and item.stdout.split(';')[1] == 'sap_swpm') or (sap_install_media_detect_hostagent and item.stdout.split(';')[1] == 'sap_hostagent') or @@ -56,7 +57,8 @@ (sap_install_media_detect_webdisp and item.stdout.split(';')[1] == 'sap_webdisp') or (sap_install_media_detect_db == 'saphana' and ( item.stdout.split(';')[1] == 'saphana' or - item.stdout.split(';')[1] == 'saphana_other') + item.stdout.split(';')[1] == 'saphana_other' or + item.stdout.split(';')[1] == 'saphana_vch_afl') ) or (sap_install_media_detect_db_client == 'saphana' and item.stdout.split(';')[1] == 'saphana_client') or (sap_install_media_detect_db == 'sapmaxdb' and item.stdout.split(';')[1] == 'sapmaxdb') or diff --git a/roles/sap_install_media_detect/tasks/set_global_vars.yml b/roles/sap_install_media_detect/tasks/set_global_vars.yml index 32e07d394..659090141 100644 --- a/roles/sap_install_media_detect/tasks/set_global_vars.yml +++ b/roles/sap_install_media_detect/tasks/set_global_vars.yml @@ -148,6 +148,13 @@ sap_swpm_igs_helper_file_name: "{{ sap_swpm_igs_helper_file_name_get.stdout }}" when: sap_install_media_detect_igs +- name: SAP Install Media Detect - Detection completed - Set facts for SAP Maintenance Planner Stack XML files + ansible.builtin.set_fact: + sap_swpm_mp_stack_path: "{{ sap_swpm_software_path }}/" + sap_swpm_mp_stack_file_name: "{{ sap_swpm_mp_xml_file_name_get.stdout }}" + ignore_errors: true + when: sap_install_media_detect_mpstack + - name: SAP Install Media Detect - Detection completed - Set facts for WebDisp ansible.builtin.set_fact: sap_swpm_web_dispatcher_path: "{{ sap_swpm_software_path }}/" @@ -241,6 +248,8 @@ - sap_swpm_kernel_independent_file_name - sap_swpm_web_dispatcher_path - sap_swpm_web_dispatcher_file_name + - sap_swpm_mp_stack_path + - sap_swpm_mp_stack_file_name - name: SAP Install Media Detect - Detection completed - Display result ansible.builtin.debug: