From: Alfredo Deza Date: Thu, 28 Apr 2016 12:07:57 +0000 (-0400) Subject: ensure the current hostname is defined in /etc/hosts X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=14d44e313ca7398829d2d02a7be942d651d322f2;p=ceph-build.git ensure the current hostname is defined in /etc/hosts Signed-off-by: Alfredo Deza --- 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