Skip to content

Commit

Permalink
sap_install_media_detect: Allow disabling RAR handling
Browse files Browse the repository at this point in the history
Fixes #855.

Signed-off-by: Bernd Finger <[email protected]>
  • Loading branch information
berndfinger committed Sep 4, 2024
1 parent ca4ea52 commit e1a2dd1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions roles/sap_install_media_detect/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
---

# Set this parameter to `false` for skipping the handling of RAR files. In this case, also no unar or other RAR handling software
# will be installed.
sap_install_media_detect_rar_handling: true

# Set this parameter to use either the unar package from EPEL or another software package for handling RAR files.
# Based on this setting, the commands for listing and extracting RAR files are being set in tasks/prepare/enable_rar_handling.yml
sap_install_media_detect_rar_package: 'EPEL'
Expand Down
2 changes: 2 additions & 0 deletions roles/sap_install_media_detect/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
file: prepare/enable_rar_handling.yml
apply:
tags: sap_install_media_detect_rar_handling
when: sap_install_media_detect_rar_handling
tags: sap_install_media_detect_rar_handling

- name: SAP Install Media Detect - Prepare - Check directories
Expand Down Expand Up @@ -95,6 +96,7 @@
tags: sap_install_media_detect_rar_handling
tags: sap_install_media_detect_rar_handling
when:
- sap_install_media_detect_rar_handling
- sap_install_media_detect_rar_package == 'EPEL'
- ansible_os_family == 'RedHat'
- __sap_install_media_detect_register_rpm_q_epel.stdout != 'epel-release'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,23 @@
loop_control:
label: "{{ item.path }}"

- name: SAP Install Media Detect - Prepare - Iterate over files and determine file type
- name: SAP Install Media Detect - Prepare - Iterate over files and determine file type, including command for handling RAR files
ansible.builtin.command: "{{ __sap_install_media_detect_sapfile_path }} -e --lsar_file={{ __sap_install_media_detect_rar_list.split(' ')[0] }} --sapcar_file={{ __sap_install_media_detect_fact_sapcar_path }} {{ line_item }}"
register: __sap_install_media_detect_register_files_phase_2
loop: "{{ __sap_install_media_detect_fact_find_result_phase_2 }}"
loop_control:
loop_var: line_item
changed_when: false
when: sap_install_media_detect_rar_handling

- name: SAP Install Media Detect - Prepare - Iterate over files and determine file type, without command for handling RAR files
ansible.builtin.command: "{{ __sap_install_media_detect_sapfile_path }} -e --sapcar_file={{ __sap_install_media_detect_fact_sapcar_path }} {{ line_item }}"
register: __sap_install_media_detect_register_files_phase_2
loop: "{{ __sap_install_media_detect_fact_find_result_phase_2 }}"
loop_control:
loop_var: line_item
changed_when: false
when: not sap_install_media_detect_rar_handling

- name: SAP Install Media Detect - Prepare - Set fact with the results of the sapfile command
ansible.builtin.set_fact:
Expand Down

0 comments on commit e1a2dd1

Please sign in to comment.