Skip to content

Commit

Permalink
sap_swpm: Improve the fail message for virt hostname resolution
Browse files Browse the repository at this point in the history
Signed-off-by: Bernd Finger <[email protected]>
  • Loading branch information
berndfinger committed Nov 6, 2024
1 parent c1ec503 commit a4e582f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion roles/sap_ha_pacemaker_cluster/vars/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ __sap_ha_pacemaker_cluster_fence_agent_packages_dict:
# Dictionary with extra platform specific packages
__sap_ha_pacemaker_cluster_platform_extra_packages_dict:
cloud_aws_ec2_vs:
- awscli
- "{{ 'resource-agents-cloud' if ansible_distribution_major_version is version('9', '>=') else 'awscli' }}"
- "{{ 'awscli2' if ansible_distribution_version is version('9.5', '>=') else '' }}"
cloud_gcp_ce_vm:
- resource-agents-gcp
cloud_msazure_vm:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

- 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
register: __sap_install_media_detect_register_files_phase_2_rar
loop: "{{ __sap_install_media_detect_fact_find_result_phase_2 }}"
loop_control:
loop_var: line_item
Expand All @@ -36,13 +36,19 @@

- 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
register: __sap_install_media_detect_register_files_phase_2_norar
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 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_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:
__sap_install_media_detect_fact_files_sapfile_results: "{{ __sap_install_media_detect_fact_files_sapfile_results + [__new_dict] }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
- name: SAP SWPM Pre Install - HA settings - Assert that sap_swpm_virtual_hostname can be resolved
ansible.builtin.assert:
that: __sap_swpm_fact_virtual_ip is defined and __sap_swpm_fact_virtual_ip | length > 0
fail_msg: "FAIL: 'sap_swpm_virtual_hostname' is not defined or cannot be resolved correctly!"
fail_msg: "FAIL: 'sap_swpm_virtual_hostname' is not defined, cannot be resolved, or has multiple entries in /etc/hosts!"
success_msg: "PASS: {{ sap_swpm_virtual_hostname }} can be resolved."

- name: SAP SWPM Pre Install - HA settings - Assert that sap_swpm_fact_virtual_ip is part of ansible_all_ipv4_addresses
Expand Down

0 comments on commit a4e582f

Please sign in to comment.