From 14d44e313ca7398829d2d02a7be942d651d322f2 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 28 Apr 2016 08:07:57 -0400 Subject: [PATCH] ensure the current hostname is defined in /etc/hosts Signed-off-by: Alfredo Deza --- ansible/slave.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ansible/slave.yml b/ansible/slave.yml index 6fc1113e..0fa861c6 100644 --- a/ansible/slave.yml +++ b/ansible/slave.yml @@ -125,6 +125,14 @@ line: '%dist .el{{ ansible_distribution_major_version }}' when: ansible_pkg_mgr == "yum" + - name: ensure that the current host is in /etc/hosts. Yes this is a thing. + sudo: true + replace: + backup: yes + dest: /etc/hosts + regexp: '^(127\.0\.1\.1(?!.*\b{{ ansible_hostname }}\b).*)$' + replace: '\1 {{ ansible_hostname }}' + - name: install six, latest one sudo: true pip: name=six state=latest -- 2.39.5