Merge "Remove hostname from 127.0.0.1"
This commit is contained in:
commit
b66bea9e9c
@ -7,20 +7,16 @@
|
||||
- name: Gather facts
|
||||
setup:
|
||||
|
||||
- name: Get node hostname
|
||||
shell: echo $(hostname)
|
||||
register: node_hostname
|
||||
|
||||
- name: Update /etc/hosts with hostname
|
||||
- name: Ensure localhost in /etc/hosts
|
||||
lineinfile:
|
||||
dest: /etc/hosts
|
||||
regexp: "127.0.0.1 {{ node_hostname.stdout }} localhost"
|
||||
line: "127.0.0.1 {{ node_hostname.stdout }} localhost"
|
||||
regexp: "^127.0.0.1.*"
|
||||
line: "127.0.0.1 localhost"
|
||||
state: present
|
||||
become: True
|
||||
when: customize_etc_hosts | bool == True
|
||||
|
||||
- name: Generate /etc/hosts
|
||||
- name: Generate /etc/hosts for all of the nodes
|
||||
blockinfile:
|
||||
dest: /etc/hosts
|
||||
marker: "# {mark} ANSIBLE GENERATED HOSTS"
|
||||
|
Loading…
x
Reference in New Issue
Block a user