]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Improve network interface discovery 248/head
authorZack Cerza <zack@redhat.com>
Thu, 16 Jun 2016 23:34:07 +0000 (17:34 -0600)
committerZack Cerza <zack@redhat.com>
Fri, 17 Jun 2016 17:14:24 +0000 (11:14 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
roles/testnode/tasks/resolvconf.yml

index caeab47ff772ee898e5cf942b73035ac0c8d0b5f..c57ca57ac39fc9cb42ea4fa81083b69674343ecd 100644 (file)
@@ -8,7 +8,7 @@
 
 - name: Set interface
   set_fact:
-    interface: "{{ hostvars[inventory_hostname].interface|default('eth0') }}"
+    interface: "{{ ansible_default_ipv4.interface }}"
 
 - name: Check for presence of /etc/network/interfaces
   stat:
@@ -41,7 +41,9 @@
 - name: ifdown and ifup
   shell: "ifdown {{ interface }} && ifup {{ interface }}"
   # Even if bounce_interface is False, we need to work around a Xenial issue
-  # where removing resolvconf breaks DNS by removing /etc/resolv.conf. Bouncing
+  # where purging resolvconf breaks DNS by removing /etc/resolv.conf. Bouncing
   # the interface rebuilds it.
+  # The Ubuntu bug is:
+  # https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1593489
   when: bounce_interface == "True" or 
         (ansible_lsb.id|lower == 'ubuntu' and ansible_lsb.major_release|int >= 16)