From 8744fac3cc559a3d18072e945744e63d699a44ae Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Tue, 9 Feb 2016 13:06:53 +0100
Subject: [PATCH] Workaround, see
 https://github.com/ansible/ansible/issues/14331

---
 tasks/cleanup.yml | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tasks/cleanup.yml b/tasks/cleanup.yml
index 12c3399..ab9e61e 100644
--- a/tasks/cleanup.yml
+++ b/tasks/cleanup.yml
@@ -9,7 +9,7 @@
     - '{{ static_ipv4|default(False) }}'
     - '{{ host }}'
 
-- name: "Remove host from hosts file"
+- name: "Remove host from hosts file 1"
   lineinfile:
     dest=/etc/hosts
     regexp='{{ item }}'
@@ -17,4 +17,12 @@
   become: yes
   with_items:
     - '^{{ static_ipv4|default(False) }} '
+
+- name: "Remove host from hosts file 2"
+  lineinfile:
+    dest=/etc/hosts
+    regexp='{{ item }}'
+    state=absent
+  become: yes
+  with_items:
     - '.*{{ host }}$'
-- 
GitLab