aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-11-06 04:42:35 +0000
committerGerrit Code Review <review@openstack.org>2016-11-06 04:42:35 +0000
commitb66bea9e9c5cbd3f1cfca927bbee6b5bcc091cc5 (patch)
tree4a8f7730ee521569b4f4644ecafd9e627cb8f681 /ansible
parent74d836659c771f0271f140885fffb7c9e0844812 (diff)
parent34c7d15f2e71a866e4c164a11ddb110fcb77860f (diff)
downloadkolla-b66bea9e9c5cbd3f1cfca927bbee6b5bcc091cc5.tar.gz
kolla-b66bea9e9c5cbd3f1cfca927bbee6b5bcc091cc5.zip
Merge "Remove hostname from 127.0.0.1"
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/baremetal/tasks/pre-install.yml12
1 files changed, 4 insertions, 8 deletions
diff --git a/ansible/roles/baremetal/tasks/pre-install.yml b/ansible/roles/baremetal/tasks/pre-install.yml
index 9d79e4611..0ea5e5a18 100644
--- a/ansible/roles/baremetal/tasks/pre-install.yml
+++ b/ansible/roles/baremetal/tasks/pre-install.yml
@@ -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"