Skip to content

Commit

Permalink
sap_install_media_detect: Use Jinja2 for conditionally setting the va…
Browse files Browse the repository at this point in the history
…riable

Signed-off-by: Bernd Finger <[email protected]>
  • Loading branch information
berndfinger committed Sep 5, 2024
1 parent da32e3b commit 2a2e185
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
changed_when: false
when: sap_install_media_detect_rar_handling

- name: SAP Install Media Detect - Prepare - Set fact from determining the file type, including RAR handling
ansible.builtin.set_fact:
__sap_install_media_detect_register_files_phase_2: "{{ __sap_install_media_detect_register_files_phase_2_rar }}"
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_norar
Expand All @@ -48,10 +43,11 @@
changed_when: false
when: not sap_install_media_detect_rar_handling

- name: SAP Install Media Detect - Prepare - Set fact from determining the file type, without RAR handling
- name: SAP Install Media Detect - Prepare - Set fact from determining the file type
ansible.builtin.set_fact:
__sap_install_media_detect_register_files_phase_2: "{{ __sap_install_media_detect_register_files_phase_2_norar }}"
when: not sap_install_media_detect_rar_handling
__sap_install_media_detect_register_files_phase_2: "{{ __sap_install_media_detect_register_files_phase_2_rar
if sap_install_media_detect_rar_handling
else __sap_install_media_detect_register_files_phase_2_norar }}"

- 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 2a2e185

Please sign in to comment.