Skip to content
Snippets Groups Projects
Commit 34c7d15f authored by Michal (inc0) Jastrzebski's avatar Michal (inc0) Jastrzebski
Browse files

Remove hostname from 127.0.0.1

We need this hostname to resolve to api_interface.

Change-Id: Ie66c1abc2d5a16c56cb5b83e48787efd5bf54fc3
Closes-Bug: #1634910
parent 520ac182
No related branches found
No related tags found
No related merge requests found
...@@ -7,20 +7,16 @@ ...@@ -7,20 +7,16 @@
- name: Gather facts - name: Gather facts
setup: setup:
- name: Get node hostname - name: Ensure localhost in /etc/hosts
shell: echo $(hostname)
register: node_hostname
- name: Update /etc/hosts with hostname
lineinfile: lineinfile:
dest: /etc/hosts dest: /etc/hosts
regexp: "127.0.0.1 {{ node_hostname.stdout }} localhost" regexp: "^127.0.0.1.*"
line: "127.0.0.1 {{ node_hostname.stdout }} localhost" line: "127.0.0.1 localhost"
state: present state: present
become: True become: True
when: customize_etc_hosts | bool == True when: customize_etc_hosts | bool == True
- name: Generate /etc/hosts - name: Generate /etc/hosts for all of the nodes
blockinfile: blockinfile:
dest: /etc/hosts dest: /etc/hosts
marker: "# {mark} ANSIBLE GENERATED HOSTS" marker: "# {mark} ANSIBLE GENERATED HOSTS"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment