]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ansible: if 127.0.1.1 add it and map it to ansible_hostname 446/head
authorAlfredo Deza <adeza@redhat.com>
Tue, 30 Aug 2016 12:31:03 +0000 (08:31 -0400)
committerAlfredo Deza <adeza@redhat.com>
Tue, 30 Aug 2016 14:02:54 +0000 (10:02 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ansible/examples/slave.yml

index 7e24181358911d6b9eda75fe92aafd08568ad2a4..ddb8efe3234560e9d3b64fd3e4724381956558ac 100644 (file)
         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