Skip to content

Commit

Permalink
sap_swpm: Use non-default loop vars
Browse files Browse the repository at this point in the history
Signed-off-by: Bernd Finger <[email protected]>
  • Loading branch information
berndfinger committed Mar 4, 2024
1 parent ac122b1 commit b76b655
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion roles/sap_swpm/tasks/swpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,12 @@
register: swpm_output_sapcontrol_files

- name: SAP SWPM - Get sapcontrol file/s
ansible.builtin.command: awk -v RS='(^|\n)GetInstanceProperties\n' 'END{printf "%s", $0}' {{ item }}
ansible.builtin.command: awk -v RS='(^|\n)GetInstanceProperties\n' 'END{printf "%s", $0}' {{ line_item }}
register: swpm_sapcontrol_file_contents
changed_when: false
loop: "{{ swpm_output_sapcontrol_files.files | map(attribute='path') | list | unique }}"
loop_control:
loop_var: line_item

- name: SAP SWPM - Display installation finished from success file
ansible.builtin.debug:
Expand Down
8 changes: 6 additions & 2 deletions roles/sap_swpm/tasks/swpm/prepare_software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@

- name: SAP SWPM Pre Install - Create list of absolute directory names from the find result
ansible.builtin.set_fact:
__sap_swpm_fact_directories: "{{ __sap_swpm_fact_directories | d([]) + [item.path] }}"
__sap_swpm_fact_directories: "{{ __sap_swpm_fact_directories | d([]) + [line_item.path] }}"
loop: "{{ __sap_swpm_register_find_result_directories.files }}"
loop_control:
loop_var: line_item
when: __sap_swpm_register_find_result_directories is defined

- name: SAP SWPM Pre Install - Create list of absolute file names for non-SAPCAR files from the find result
ansible.builtin.set_fact:
__sap_swpm_fact_files_non_sapcar: "{{ __sap_swpm_fact_files_non_sapcar | d([]) + [item.path] }}"
__sap_swpm_fact_files_non_sapcar: "{{ __sap_swpm_fact_files_non_sapcar | d([]) + [line_item.path] }}"
loop: "{{ __sap_swpm_register_find_result_files_non_sapcar.files }}"
loop_control:
loop_var: line_item
when: __sap_swpm_register_find_result_files_non_sapcar is defined

- name: SAP SWPM Pre Install - Ensure correct permissions and ownership of all directories
Expand Down

0 comments on commit b76b655

Please sign in to comment.