From: Alfredo Deza Date: Tue, 30 Aug 2016 12:31:03 +0000 (-0400) Subject: ansible: if 127.0.1.1 add it and map it to ansible_hostname X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F446%2Fhead;p=ceph-build.git ansible: if 127.0.1.1 add it and map it to ansible_hostname Signed-off-by: Alfredo Deza --- diff --git a/ansible/examples/slave.yml b/ansible/examples/slave.yml index 7e241813..ddb8efe3 100644 --- a/ansible/examples/slave.yml +++ b/ansible/examples/slave.yml @@ -143,6 +143,13 @@ regexp: '^(127\.0\.1\.1(?!.*\b{{ ansible_hostname }}\b).*)$' replace: '\1 {{ ansible_hostname }}' + - name: ensure that 127.0.1.1 is present with an actual hostname + sudo: true + lineinfile: + dest: /etc/hosts + regexp: '^(127\.0\.1\.1(?!.*\b{{ ansible_hostname }}\b).*)$' + line: '127.0.1.1 {{ ansible_hostname }}' + - name: install six, latest one sudo: true pip: name=six state=latest