diff --git a/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml b/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml index 87f31897..c97fbcd4 100644 --- a/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml +++ b/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml @@ -25,7 +25,7 @@ - name: SAP SWPM Pre Install - HA settings - Try to resolve sap_swpm_virtual_hostname from /etc/hosts ansible.builtin.shell: | - awk '/\s{{ sap_swpm_virtual_hostname }}\./||/\s{{ sap_swpm_virtual_hostname }}/{print $1}' /etc/hosts + awk '/^[^#]/&&(/\s{{ sap_swpm_virtual_hostname }}\./||/\s{{ sap_swpm_virtual_hostname }}/){print $1}' /etc/hosts register: __sap_swpm_register_virtual_ip_etc_hosts changed_when: false failed_when: false