Use more permissive regex to remove the offending 127.0.1.1
line from /etc/hosts
Ubuntu always uses 127.0.1.1 for that with some tricky sauce
around `hostname` depending on whether it contains '.' or not.
And when I mean `hostname` it's the one returned by `hostname`
command with no arguments.
ansible_hostname is always a single word so we can match on that.
I did not want to remove just any 127.0.1.1 in case someone
is using it for other purposes. :-)
Change-Id: I8bd3d42a5e3bd0f63336ed60a0af90d52b1650d6
Closes-bug: #1862739
(cherry picked from commit adbe115e39ef2320e2e1ab57f97d5191282951d7)
(cherry picked from commit ac158d19f5d0b5085b8c2fb2ba17cebd164f6582)
Reviewed: https:/ /review. opendev. org/711665 /git.openstack. org/cgit/ openstack/ kolla-ansible/ commit/ ?id=4a7b1dd726e d6015708f63838e 470cd9f44e405b
Committed: https:/
Submitter: Zuul
Branch: stable/rocky
commit 4a7b1dd726ed601 5708f63838e470c d9f44e405b
Author: Radosław Piliszek <email address hidden>
Date: Wed Feb 12 12:08:28 2020 +0100
Use more permissive regex to remove the offending 127.0.1.1
line from /etc/hosts
Ubuntu always uses 127.0.1.1 for that with some tricky sauce
around `hostname` depending on whether it contains '.' or not.
And when I mean `hostname` it's the one returned by `hostname`
command with no arguments.
ansible_ hostname is always a single word so we can match on that.
I did not want to remove just any 127.0.1.1 in case someone
is using it for other purposes. :-)
Change-Id: I8bd3d42a5e3bd0 f63336ed60a0af9 0d52b1650d6 0e2e1ab57f97d51 91282951d7) 85b8c2fb2ba17ce bd164f6582)
Closes-bug: #1862739
(cherry picked from commit adbe115e39ef232
(cherry picked from commit ac158d19f5d0b50