From 87911f029dae9894a51bcd024f13dba85a09ae20 Mon Sep 17 00:00:00 2001 From: Greg Althaus Date: Tue, 19 Jan 2016 20:53:04 -0600 Subject: [PATCH] Make sure that localhost references 127.0.0.1 --- roles/dnsmasq/tasks/main.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/roles/dnsmasq/tasks/main.yml b/roles/dnsmasq/tasks/main.yml index a0bf29387..17b61ee1c 100644 --- a/roles/dnsmasq/tasks/main.yml +++ b/roles/dnsmasq/tasks/main.yml @@ -27,6 +27,18 @@ with_items: - '^127\.0\.0\.1(\s+){{ inventory_hostname }}.*' - '^::1(\s+){{ inventory_hostname }}.*' + - '^::1(\s+)localhost.*' + - '^127.0.0.1(\s+)localhost.*' + +- name: localhost in hosts file + lineinfile: + dest: /etc/hosts + line: "{{ item }}" + state: present + backup: yes + with_items: + - '127.0.0.1 localhost localhost.localdomain' + - '::1 localhost6 localhost6.localdomain' - name: ensure dnsmasq.d directory exists file: