Make sure that localhost references 127.0.0.1
This commit is contained in:
parent
a6e370248d
commit
528840ece0
1 changed files with 12 additions and 0 deletions
|
@ -27,6 +27,18 @@
|
||||||
with_items:
|
with_items:
|
||||||
- '^127\.0\.0\.1(\s+){{ inventory_hostname }}.*'
|
- '^127\.0\.0\.1(\s+){{ inventory_hostname }}.*'
|
||||||
- '^::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
|
- name: ensure dnsmasq.d directory exists
|
||||||
file:
|
file:
|
||||||
|
|
Loading…
Reference in a new issue