-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sap_general_preconfigure: false duplicates in /etc/hosts due to partial matching #696
Labels
bug
Something isn't working
Comments
@ja9fuchs Thanks for reporting this. I already successfully tested with community.sap_install/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-etc-hosts.yml Line 57 in d36cc15
|
berndfinger
added a commit
to berndfinger/community.sap_install
that referenced
this issue
Apr 11, 2024
Solves issue sap-linuxlab#696. Signed-off-by: Bernd Finger <bfinger@redhat.com>
This was referenced Apr 11, 2024
berndfinger
added a commit
to berndfinger/community.sap_install
that referenced
this issue
Apr 17, 2024
…address Relates to sap-linuxlab#696. Signed-off-by: Bernd Finger <bfinger@redhat.com>
berndfinger
added a commit
to berndfinger/community.sap_install
that referenced
this issue
Apr 17, 2024
This speeds up processing and as a side effect reduces the number of programming languages. Relates to sap-linuxlab#696. Signed-off-by: Bernd Finger <bfinger@redhat.com>
berndfinger
added a commit
to berndfinger/community.sap_install
that referenced
this issue
Apr 17, 2024
Relates to sap-linuxlab#696. Signed-off-by: Bernd Finger <bfinger@redhat.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to #132, but an issue on its own and while comments are not there on fresh end-to-end installations, the following is a problem that can occur anytime.
The
awk
search for duplicate IPs in/etc/hosts
is not restricted to match the whole word. That leads to partial matches and a false error that ends the play and is an issue when IPs are randomly assigned during system deployment in a specified range, e.g. in cloud instances.Example: IP check for
10.1.1.12
will conflict with an existing entry for10.1.1.120
.File:
roles/sap_general_preconfigure/tasks/RedHat/generic/assert-etc-hosts.yml
Code:
awk 'BEGIN{a=0}/{{ sap_general_preconfigure_ip }}/{a++}END{print a}' /etc/hosts
Suggestion to only match the whole IP of an actual entry (no comment):
Add
^
and\s
to indicate the word ending.awk 'BEGIN{a=0}/^{{ sap_general_preconfigure_ip }}\s/{a++}END{print a}' /etc/hosts
Edit:
\w
didn't work for other entries, but\s
does.The text was updated successfully, but these errors were encountered: