Skip to content

Commit

Permalink
sap_install_media_detect: handle SIGNATURE.SMF inside sapcar extracti…
Browse files Browse the repository at this point in the history
…on task
  • Loading branch information
berndfinger committed Sep 19, 2023
1 parent 729e620 commit 586361c
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions roles/sap_install_media_detect/tasks/organize_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,26 @@
- line_item.archive_type == 'rarexe'
- line_item.extract_archive == 'y'

- name: SAP Install Media Detect - Organize all files - Create temp dir for sapcar archive files - {{ __sap_install_media_detect_software_main_directory }}/tmp_extract
ansible.builtin.file:
path: "{{ __sap_install_media_detect_software_main_directory }}/tmp_extract"
state: directory
owner: root
group: root
mode: '0755'

- name: SAP Install Media Detect - Organize all files - Extract sapcar archive files
ansible.builtin.command: >-
ansible.builtin.shell: >-
{{ __sap_install_media_detect_fact_sapcar_path }}
-R {{ __sap_install_media_detect_software_main_directory }}/{{ line_item.extraction_dir }}
-xvf {{ line_item.file }}
-R {{ __sap_install_media_detect_software_main_directory }}/tmp_extract
-xvf {{ __sap_install_media_detect_software_main_directory }}/{{ line_item.file }}
-manifest SIGNATURE.SMF
&& extracted_dir=$(ls -d */)
&& mv SIGNATURE.SMF $extracted_dir
&& mkdir -p {{ __sap_install_media_detect_software_main_directory }}/{{ line_item.extraction_dir }}/$extracted_dir
&& mv $extracted_dir {{ __sap_install_media_detect_software_main_directory }}/{{ line_item.extraction_dir }}/
args:
chdir: "{{ __sap_install_media_detect_software_main_directory }}"
chdir: "{{ __sap_install_media_detect_software_main_directory }}/tmp_extract"
loop: "{{ __sap_install_media_detect_fact_files_sapfile_results }}"
loop_control:
loop_var: line_item
Expand All @@ -148,17 +160,10 @@
- line_item.archive_type == 'sapcar'
- line_item.extract_archive == 'y'

- name: SAP Install Media Detect - Organize all files - Move SIGNATURE.SMF into subdir for SAP HANA non-export files
ansible.builtin.shell: |
extracted_dir=$(ls -d */)
mv SIGNATURE.SMF ${extracted_dir}
args:
chdir: "{{ __sap_install_media_detect_software_main_directory }}/{{ line_item.extraction_dir }}"
loop: "{{ __sap_install_media_detect_fact_files_sapfile_results }}"
loop_control:
loop_var: line_item
when:
- line_item.sap_file_type is search("saphana")
- name: SAP Install Media Detect - Organize all files - Remove temp dir - {{ __sap_install_media_detect_software_main_directory }}/tmp_extract
ansible.builtin.file:
path: "{{ __sap_install_media_detect_software_main_directory }}/tmp_extract"
state: absent

- name: SAP Install Media Detect - Organize all files - Copy certain files to 'sap_hana' directory
ansible.builtin.copy:
Expand Down

0 comments on commit 586361c

Please sign in to comment.