]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ensure the current hostname is defined in /etc/hosts 377/head
authorAlfredo Deza <adeza@redhat.com>
Thu, 28 Apr 2016 12:07:57 +0000 (08:07 -0400)
committerAlfredo Deza <adeza@redhat.com>
Thu, 28 Apr 2016 14:15:21 +0000 (10:15 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ansible/slave.yml

index 6fc1113e3ac82378acaed5eecc3795c8ad61d7f6..0fa861c6ead468098d9aa90494ab05d60a9b367c 100644 (file)
         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