You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new code of #697 is not correctly matching the hostname as a full string separated by white space(s). It also matches the hostname as a substring of a longer string.
I tested this with a sample /etc/hosts file containing:
a line with ipv4 adress, the FQDN, the hostname and an alias, all separated by a tab, one, or two spaces, and a space at the end or not space at the end of the line.
and another line with a different ipv4 address, the FQDN with a hostname starting with the same characters as the previous one but with 3 more characters, and the hostname without the DNS domain, and an alias.
To be done: Find out why the original pattern incorrectly matched the second line as well.
The text was updated successfully, but these errors were encountered:
Also, an Ansible-only solution should limit the amount of output lines: When looping over a long /etc/hosts file, there will be many output lines, even when optimizing the output with the label variable in loop_control. So an Ansible-only solution should use Ansible filters like count. However, I do currently not have enough time to test and analyze any issues related to constructing regex patterns from multiple strings, which would be a requirement. So I'll now revert back to the awk method, which is easy to understand and analyze and also can easily produce lean output.
berndfinger
added a commit
to berndfinger/community.sap_install
that referenced
this issue
May 13, 2024
Solves issue sap-linuxlab#736.
It's essentially a backout of PR sap-linuxlab#697, especially of commit 1fc1459.
Signed-off-by: Bernd Finger <bfinger@redhat.com>
The new code of #697 is not correctly matching the hostname as a full string separated by white space(s). It also matches the hostname as a substring of a longer string.
A possible solution is to replace the line
community.sap_install/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-etc-hosts.yml
Line 92 in a97844d
by:
.
I tested this with a sample /etc/hosts file containing:
To be done: Find out why the original pattern incorrectly matched the second line as well.
The text was updated successfully, but these errors were encountered: