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)
Reviewed: https:/ /review. opendev. org/710126 /git.openstack. org/cgit/ openstack/ kolla-ansible/ commit/ ?id=87a5063bd23 e54a6fdad741790 f1961f2ffb84fc
Committed: https:/
Submitter: Zuul
Branch: stable/train
commit 87a5063bd23e54a 6fdad741790f196 1f2ffb84fc
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)
Closes-bug: #1862739
(cherry picked from commit adbe115e39ef232